From patchwork Wed Dec 15 10:15:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1831 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3A82F3F18E for ; Wed, 15 Dec 2021 11:16:04 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id q2-20020a056a00084200b004a2582fcec1sf13339035pfk.15 for ; Wed, 15 Dec 2021 02:16:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639563363; cv=pass; d=google.com; s=arc-20160816; b=e4sDxRbWD5UBG6SSFnS9sUG1eKD0bEnNXSCQ7e8TloAyXqb9LWLZIO7cSura5fqwq9 WvCeAG0Y/nS3k6sjATTmR7/XbddCNgpYskiMxInn/wVG0yv2jtiX38s8lA0XzZDgcSH3 +v5oZv+4Zx2P8J2Ieuf4jUVWhcLdvB6DR58k3zAh+pNCitA4aN/Xz1WNSeXUzY/ExqsV oHaeqtH7bl9tJc+zuk2115o2LFv2pMlwC9KHm+sMaEdvoWc7wPTsTI54hQaOpY5iq7zb FNBxYqZcN1LoB0D7W7FSRP91cTk6kAs63oNxsp0h5ndH5HZ/RObl3TckT+rj1iFKXrNc yj7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DXreobVupq51iXT4NV6fs8fsewfVquJRuxwtjjECoqE=; b=ou/XkGyRXi9ToJibs3bmvmOFp3hdKVKlh5hZj3/T6jOCzEfjwgAq3yj9fEmGqoULRb 8Br3mb2qvoZT/o7AkZrzqmcYATRPYFuhpz+/uPd94N3D+qG9af8jdYCPRfToS8UaNa12 ey9V3PgDxcOBXnuUsqk60ETREMjQLFSWoZ+7oYNKOo3TByzvtJxqw8kdCPPnD+p/rKj5 R0PlYibDTVuWVyYK4rpY0AkdYvNCckE2eVBlun1QO2mtRNRYk8vMIrAzlkXVBVODfnGO zaRVjoKb1++I/+HiAwoTq9+orBKOgvoYkJf4ZW6wNp3cuuNc0oahflbdoNuQZL4z0zZz /9/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qOZAhpjK; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=DXreobVupq51iXT4NV6fs8fsewfVquJRuxwtjjECoqE=; b=X7cR65b5U6w2zZE3myduxYbuuUdDqpk/dAR9AEPcWC+9JcO8Sgf1WxwgzA6/KuZ7j+ 9K5lbQ2be1UtCYxi2tuSdkELRNMaHMzcCfI41vylT99SeUdhfy1WwmtCliqwWU5EEooa 7UlZa4OUyKAngzbNKyug2ZVenWwKc1VKWi1KU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=DXreobVupq51iXT4NV6fs8fsewfVquJRuxwtjjECoqE=; b=CHlIShTNHeFXq8gjAfEul0bxf71zUdtvbwyM7oyoY4cIpIOotMwV/goMOhY0a3g4Oz +v8ZJZowq4q9mCX+4WJvi0j68N7abMOwFuTK/mXHI5BLAac482jb9HObNRaBC4gtbfRx Uz47Ye/7SSyB9Y/DsV0R9CrvDlWAFpOKuldvKuwbyfynAjJsW7e9hMCWhh/78lwtwRmq 6bzn4H2yKXVs3BuTSmwHTMceMOHChOipEfMt50EcNEuR13da5LDm1YNUL+Eq2eOrSH/x AIPV0ENdlzuR6cs5vPtibHpWDUyZxnAfhSu8PeStK0ObhR48MWGE2oCF4kT7fkKF8UEM qb7Q== X-Gm-Message-State: AOAM533Qqv6RdJUTnX/9sEeQOjkwGNUmC8+Sv9k83LxLfOTewQPnz1rA 13XDLnnPWLQ5yNvqOvAiGKiITh5F X-Google-Smtp-Source: ABdhPJzYbJlFDVT91gi/S2h+5Os0sjFDcBzpq9WiD1CSB5hOg3zYut6A6jewcj0hOTCL2rsU3IROdA== X-Received: by 2002:a17:902:d88b:b0:142:8acf:615b with SMTP id b11-20020a170902d88b00b001428acf615bmr10351103plz.62.1639563363031; Wed, 15 Dec 2021 02:16:03 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d4cc:: with SMTP id o12ls1194999plg.11.gmail; Wed, 15 Dec 2021 02:16:02 -0800 (PST) X-Received: by 2002:a17:902:b408:b0:148:aaf2:ea81 with SMTP id x8-20020a170902b40800b00148aaf2ea81mr1538131plr.123.1639563362294; Wed, 15 Dec 2021 02:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639563362; cv=none; d=google.com; s=arc-20160816; b=WwXJAaEymhBRSLoHldjumzHTYtcnMm8J0npG72/+4rAnwtgBqv1xEEBhSawbDk73mt QkmNRL8VApbwD+giFEdJwj7rIgrSl663k4P54TLIAq0YKfM42ZoEwp5nLb4D4uflvC0F P59p/4or7pAKBV4n8oPr2rySkkfImSKbGC4APAohXFlid0hKhIdJKDX6TKXywDVStWeg z3DdJk+78b5ZRwRDhyuSpfhPbBSeK8QeBS1Y+GVsPx3OfdD2N1TvdadMclRvZVk0TCz/ 6660y5ml9hFTVZ+l4/a1cxvPMWCMEx/Zgo0AOiMVPJBdT7h8YgB1ZFfV+1SI+kpOpH+n /hcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aUe7iWsFUanDnWU/hqGWtr7c387T6EcARkQ4NxMuaBw=; b=l1g4uljnFhPy6fZHHb+Z2WPjiaLB//DRb64ynanfPFOmr4BvCxCLOL1LujQ9UV5/im A18T7jREyTkm1DoldCTk1m5Gl697QlIDflH3L+NxD75LhxYvVg4GwCMnhILpqdSkCmrx RDznJKjpyZFCyGSV4HKia9zNGZsKl8ZrWcw2JpiGWh2uDpTMbCHcFw4vTi/7cEjEJ1cs Y6NC3E/FA1mxF8goxKy9hHWcjCm68sWDOHJHj8g6G0O7v4t8/g+MYPtKK+0JfTiMHcv7 VaOypmAVed0MFez3HqNibpa3qDBDe2Zmy4ibUtg1xPiStgOlF72ZnT/8Hye1BxPTahpl 41FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qOZAhpjK; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id t9sor750124pgp.31.2021.12.15.02.16.02 for (Google Transport Security); Wed, 15 Dec 2021 02:16:02 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a65:6a45:: with SMTP id o5mr7516185pgu.273.1639563362025; Wed, 15 Dec 2021 02:16:02 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:a7:8328:d9c4:5bc9]) by smtp.gmail.com with ESMTPSA id v11sm2408149pfu.184.2021.12.15.02.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 02:16:01 -0800 (PST) From: Jagan Teki To: Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Sam Ravnborg , Michael Nazzareno Trimarchi , Inki Dae Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v4 5/6] drm: exynos: dsi: Get the mode from bridge Date: Wed, 15 Dec 2021 15:45:33 +0530 Message-Id: <20211215101534.45003-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215101534.45003-1-jagan@amarulasolutions.com> References: <20211215101534.45003-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qOZAhpjK; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Now the exynos dsi driver is fully aware of bridge handling, so get the display mode from bridge, mode_set API instead of legacy encoder crtc. This makes bridge usage more efficient instead of relying on encoder stack. Add mode_set in drm_bridge_funcs. Signed-off-by: Jagan Teki --- Changes for v4, v3: - none drivers/gpu/drm/exynos/exynos_drm_dsi.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 983e7cb65e2a..774ca265ed3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -276,6 +276,7 @@ struct exynos_dsi { u32 format; int state; + struct drm_display_mode mode; struct drm_property *brightness; struct completion completed; @@ -880,10 +881,9 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) return 0; } -static void exynos_dsi_set_display_mode(struct drm_bridge *bridge) +static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) { - struct exynos_dsi *dsi = bridge_to_dsi(bridge); - struct drm_display_mode *m = &bridge->encoder->crtc->state->adjusted_mode; + struct drm_display_mode *m = &dsi->mode; unsigned int num_bits_resol = dsi->driver_data->num_bits_resol; u32 reg; @@ -1398,7 +1398,7 @@ static void exynos_dsi_atomic_enable(struct drm_bridge *bridge, { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - exynos_dsi_set_display_mode(bridge); + exynos_dsi_set_display_mode(dsi); exynos_dsi_set_display_enable(dsi, true); dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; @@ -1428,6 +1428,15 @@ static void exynos_dsi_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static void exynos_dsi_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct exynos_dsi *dsi = bridge_to_dsi(bridge); + + drm_mode_copy(&dsi->mode, adjusted_mode); +} + static int exynos_dsi_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { @@ -1444,6 +1453,7 @@ static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { .atomic_enable = exynos_dsi_atomic_enable, .atomic_disable = exynos_dsi_atomic_disable, .atomic_post_disable = exynos_dsi_atomic_post_disable, + .mode_set = exynos_dsi_mode_set, .attach = exynos_dsi_attach, };