From patchwork Sun Dec 12 18:14:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1821 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0D4483F071 for ; Sun, 12 Dec 2021 19:15:08 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id n22-20020a6563d6000000b0029261ffde9bsf7715726pgv.22 for ; Sun, 12 Dec 2021 10:15:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639332907; cv=pass; d=google.com; s=arc-20160816; b=hdMImXmwn1zWQeePeDQKcu1F6eynW/cr+LfHLTc5+ts1jqrGvP1GTHSvfPpor4734O +aFflDroi2+oZOo+CCnfe1LBgPkn4lpr2vXkYHNNL6vA4XAqEBqOkjqo4IBxflimZIKC k482jxkpEHgM3xW8MWcglSeeyFhePC2TeCnxdSdp+ZuVHAhyqGDYfDLl4TkOG2NDFfjP 59+zWlNCerOXRgO0b6a1/q5/Ao4z42CPxRZ6ArafK/nyQkXbytnIHPGRieW2OiIkK58X qNwJMiTa+ySNz3aaQvXCn7bqSvVN7JN/qGA+aeMecze8rbPc00bfMG6n/OOsONP+Ljkx P3QA== 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=Nwkf6oArF8cy+QfimmV9frUtVi9jPxaN1+xXZ9juF5U=; b=DL+8IXt62yJflCf7Wp9ye3FYxQOq8SZyCr88z1Q7gfgMgTvSOGN+Dj1r6P4+Oq//jA 7iP2d54u5rJEzs2rjQF8hsZdykc+ymDLt9IZ5G5GF88wWIlWWxKinJFBrWaS2GIBYmVj QhRmSjad/fXkuRT3QH/FFjONoJpa5NQJke9655GJLxjmMHuK86N5kw5dOxTYdQ/suYgc L+OylqGvjSPG8VJmiq3r7JZ3Jc1VyF6E1v3gAYNFnDHwB7ATyrZRmPzlXbW3LcutIDii VNFcc46nQp7R3iHONye4W89QP87kx0OoycsCU8IuSOwvLiz+F7KTpCESr4sw9zTM2VIU JWDA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CPENh9t1; 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=Nwkf6oArF8cy+QfimmV9frUtVi9jPxaN1+xXZ9juF5U=; b=OKucd8yLfmoBZ+vyGHfzcgzI5ZkAVXzNfwRN3ruK1wrcDgK3wOL0p2qzPVSITQkMxQ 4+xwSbHpABCVRVjCnXgCnzn6DfDwEssOrzJH+GbKAoDV2RLAvIydiCl2u8mm/N59XAWe 7oiJCC8pbZopmnin10t4T+uboXthoxltHMK2E= 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=Nwkf6oArF8cy+QfimmV9frUtVi9jPxaN1+xXZ9juF5U=; b=u7h17JvMezJAi6QHt4pYbn7+9+E6Uo8GxJEJoNghHLy5QckFcCc86UuL8frIjmBwB9 g+L89A2IqtAE+DniwvjV6lods7mK78nqiVsUrEPUYJC+Q20H63CxEMAZv2wZX1HO4+8Z vlOxf3kmoTHBSgcJHbGTsr3z7oH21/BJHNj7MwmH1Q3kpYPp6txS08TrOQ/K+HNoMxUE 2D0ofX1kLgzqbR33fn1KuYTMFdmLma2QFTnnZhtpsL0jtU5WH2H4h63Pde2aNxRhYs3Y cIka9ex3CaHfekDQijEcMo8q0egGElpTaR4gHehwXnvH9XHIsRKseoYqmoyqsEjOuGBM jYoQ== X-Gm-Message-State: AOAM530DHroSyfAmdzVgCtrow13FF+ZkkWtDge4PzPo73k7zIe17c6IJ OBIr26ztdcKyaR3DAxN9+eJPIDq7 X-Google-Smtp-Source: ABdhPJxGXDMsz3N9q5O1Kp4oqyTeJ6gAMe4RFlqc4WITc7HgkfFN+KSxCjo0ZzH8tVDPZhdQFTVzpg== X-Received: by 2002:a63:141d:: with SMTP id u29mr42942859pgl.412.1639332906622; Sun, 12 Dec 2021 10:15:06 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:181e:: with SMTP id y30ls5037388pfa.8.gmail; Sun, 12 Dec 2021 10:15:06 -0800 (PST) X-Received: by 2002:a05:6a00:170d:b0:4a0:c6a9:622b with SMTP id h13-20020a056a00170d00b004a0c6a9622bmr28673618pfc.41.1639332905918; Sun, 12 Dec 2021 10:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639332905; cv=none; d=google.com; s=arc-20160816; b=fgkfxqiCSyOaXqpks8kYPaGXT4jCvR/Ip9BeUAclCTY1jfo7V6qAFVqkeTO4zJTJZi RKKmfaV6YIE82Ml+NFeoI7O67QsZOJlA1tWERChlQXYYtmM0aaRC4kLeNRbBs6L0vElI d5APlu1lHNvTOb/CvF8h54vDPpDJaM3Mm36NUTUDus5D9EuykHxGRfzd6Ki/a9NNTVKN 5z3m1i36N6ySaV+IpOiREjM0Q48a4lI/DfT++g2D3jD8lhdoTHP7WJp1HVIt24Ouh73C rMezKTmTUbfT4/g5cDIIy4hVJO2OjAwMrhSKrcjjQiV7hnz4yr/O5MwJ2Xo1/U8jVJDb w1OQ== 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=AcqL/1AAMwG1X29U8NMxgk5ik806Z4Dgf7qHxGXF4Tg=; b=KlzTDkvhEes1/5W7ggkA7Fd0P4ZWIQGiJlwQrcdU2W6+52edONNYmZks0rj7UQcGOj goSDZdhEGMUhlV8Diqg2+4EPdIIjwLZdhRhwft9a8JnuckhFHVPzp3QGy1S6czSXqUWH MaCGLg3HeFOuo6UI6Dv437fi5Y3pwDJ5My6LUYfA3Bg3sFwamlsh3icZ9NY2DgM77j0R wq7TEGMVSjCSe1L9m2lCawUnUaGWaxFIyVpRgMsBSta+zISTzdVDrKgGSiS2SkwJMGnk 7Gpwu6LJCkP/3KU1XzxTcfodZSbwomYX4IYMk3jKKZtd4V9LKMxyARfioIm1Sk1X1ClQ om3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CPENh9t1; 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 n5sor4209238pgt.76.2021.12.12.10.15.05 for (Google Transport Security); Sun, 12 Dec 2021 10:15:05 -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:a63:fc0a:: with SMTP id j10mr48421414pgi.36.1639332905452; Sun, 12 Dec 2021 10:15:05 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:264b:de7a:bc69:cfbd]) by smtp.gmail.com with ESMTPSA id bt2sm4567904pjb.33.2021.12.12.10.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Dec 2021 10:15:05 -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 v3 6/7] drm: exynos: dsi: Get the mode from bridge Date: Sun, 12 Dec 2021 23:44:15 +0530 Message-Id: <20211212181416.3312656-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211212181416.3312656-1-jagan@amarulasolutions.com> References: <20211212181416.3312656-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=CPENh9t1; 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 v3: - new patch 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 feb36a5dc646..a2eb82bbb30f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -278,6 +278,7 @@ struct exynos_dsi { u32 format; int state; + struct drm_display_mode mode; struct drm_property *brightness; struct completion completed; @@ -882,10 +883,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; @@ -1400,7 +1400,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; @@ -1430,6 +1430,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) { @@ -1446,6 +1455,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, };