| Message ID | 20221212182923.29155-4-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBHHG3WOAMGQEEMBPWDA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B028D3F1DA for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 12 Dec 2022 19:29:49 +0100 (CET) Received: by mail-pj1-f70.google.com with SMTP id o18-20020a17090aac1200b00219ca917708sf434797pjq.8 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 12 Dec 2022 10:29:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670869788; cv=pass; d=google.com; s=arc-20160816; b=pGSujwAd5JjOzra3dqmBAyJZsY67yHGdrLHQ0DiF9kcKk9PsP1J13nGfvFRN5QCRaG PHFa0powR5NVI0igOjpx8w1SKsrAoYuuQ8HFA7NZ9zmX4839xGbjCvl7iEOJB50MXvCH pRvKWVI2Fut/F6ZPKS7QvD4BwdicgXU9jc2IhKImDJYLWU6mD3bHpE7HAxmw9XBXTLdf ARMTCRA4hEnXZ/3uVehZOefm963BQ/N87dQ9ZauXmAfrvoKPGFHeI7c5j1cynN18MpzN fcwO4uscDbarCJ2Lr1QVMGfTwHnifRKVb7ca/tUFUpfap8ozVR68/Klr5b44bq6J+a9r yTAA== 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=Ad00E/Q4GFPsoPpt94axr+8ndxM9prseWstVAvqb4PU=; b=z7aeOwnIkt4EiWnq5jwYfb06hDh+5Wl0fDsCImBznNUuf2/YnT2S22O2rVxONK2xhr YgcDbScF6RNMR0vcZxyYJF4myPvyWNyv32TRcFinUIqQ39YTjZLFErsazKBiChNYzK+j 7GQgJqmxMv1w3xaURFDRkHVJD31O8LxaTxcuQCRoA0jSjc1dmQcC+Ugbymy9yrsTYSaW ORicbk1TbidfuKR16xkq7mXFvWxjJ5XI6jShlhfIRpbDmuQUv07wF+8jGEn6QIXcrIeP JLT/c773Hcy3yLMgi5ZMxzUQ+djAdk/Skwl9CM+U0Kbz5HRpi1zJzhELRZdMDh/iW5xl GWgQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gh4sGxHl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ad00E/Q4GFPsoPpt94axr+8ndxM9prseWstVAvqb4PU=; b=nns/TJ+eReSScIU/ZqnpVb9zp2yvmegObHYeiacxha/T3CgxOdIE56VFCzbF852hjA zjXavMk2uW6f2SiTZnFIfYDjsviFbnHyvAWZfu/jnhT8PAArDTpW+6ABRzi+XXEvezJt bajrs6kkZuLF1+sVpWNFmqmJvQ4c2sPIhuWus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ad00E/Q4GFPsoPpt94axr+8ndxM9prseWstVAvqb4PU=; b=hERnvGdTwpKfce8DFwDbo2lSKtAk17hBhdzj8zvvRyVH/8ZF0F4lh/6q8NP8YNkqjH CvXklLFSZOwyd2APX24UokbvjC8CwszVVFBhZM8KR4JPN+KYlzxwdRHROW/PiTbaiyq8 4P4BBQD0ODk+8lQ7NpW9gVsxAlBfsRD0aUbNpfwi/3VCuRzDHD6I9nALCCVfkOFG9rVL Kgv0PRKc+W1CT96cPJoKmTVDjPSvulQmMrqui0eAsoqhHnu/SY3TVi7iA08WYOg4YQRF GYWY7aWy7xxEnJtmfEFNGqv2MXtNqkujjVwpLG2Qm5C7nBfX86VudlSHyZ5wVfVV+tl1 Kc+Q== X-Gm-Message-State: ANoB5pk82KgTe+rw0/RnT6Uq7ffeyPc0hK0V5BLw2O07jNmow0zQLGc8 TifuQiYVjiDN9AGFyZvUo6ZMFIUc X-Google-Smtp-Source: AA0mqf7+bTErR1cEVh2XZ21yULlnwxt/N0IYpRvzLNnH/8jKTT+4/sClXdLt+uk9/Gx/p8q3ECiFPQ== X-Received: by 2002:a17:902:700c:b0:18f:438a:cfe3 with SMTP id y12-20020a170902700c00b0018f438acfe3mr472299plk.124.1670869788357; Mon, 12 Dec 2022 10:29:48 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7894:b0:178:5938:29de with SMTP id q20-20020a170902789400b00178593829dels16240509pll.2.-pod-prod-gmail; Mon, 12 Dec 2022 10:29:47 -0800 (PST) X-Received: by 2002:a17:902:7088:b0:188:d4ea:252c with SMTP id z8-20020a170902708800b00188d4ea252cmr17509988plk.6.1670869787491; Mon, 12 Dec 2022 10:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670869787; cv=none; d=google.com; s=arc-20160816; b=NQRq4jN/Nj+yABsORNu2zPAfnrZpx0J2MBjU1H+xLPcNldIZFT3BB9ZJ23a8nvy3f6 VHaUxia0UztvsrH65NYtHWS8hQBB6uUzKfp13i9cOLTyUuXlBPummAyQfUzZlZO1xN5S I6z9mXJUSbZWlGfEADEpaxZSzVXZnd7hmHpZqsYhn2tFKD57X+cNTfwKEsxlTSvXS5za 0pKTCFddUcBo+ANTAq9B1cL9PxiaHpa3Xg3KwpRtjAHFVRbB19UEEybTTOPkD9LlTFir 1ME5OMb0FY4o0Ea7Laxj4ISKllSKcApjO8O03uoAcf7FtEMLmxCw7li00HhSTrRjJc/u Ghgg== 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=+3thu+TFV75UQnUKi5H5iMkprh+mVb/ueAKw6cINH6Y=; b=zRWqSPKa9/1SO2BkVDmmzVGJ32E6lUyHTlpFOEvrY0ROLFhXnYBcjPoxsMHGosPIlh qkczY9DcXzawQONK2skRMN+Nfy0bTxZ2NDxW9izX1jyX8Fdyrty1m9mD+5e/mcsc4SBL 42CukfsOnKCB+7r6qJ+BCvXuYiuKZO6m6d5VbQOWPAQOE6jiDAHt5q+xzvH3tOaDSbRj zwISd0tohC21WYZxvbaKDjBaIwVreXYLluI1czllXI6YXSYoEIJgqqnmiCvvrzqbheqA Qdzj8YSLQOHyQS99ombaLRx8Jbp0aPLxIuKHUJhaJCxFKsLjieE5I3K9qpand0ZyfPba u50w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Gh4sGxHl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 e2-20020a170902744200b001895afb6979sor4530186plt.182.2022.12.12.10.29.47 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Mon, 12 Dec 2022 10:29:47 -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:a05:6a21:3996:b0:a7:345a:1024 with SMTP id ad22-20020a056a21399600b000a7345a1024mr22612382pzc.50.1670869787169; Mon, 12 Dec 2022 10:29:47 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:c713:dc69:f2de:e52f]) by smtp.gmail.com with ESMTPSA id n28-20020a634d5c000000b0046fefb18a09sm5357998pgl.91.2022.12.12.10.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 10:29:46 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Marek Szyprowski <m.szyprowski@samsung.com>, Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, Neil Armstrong <narmstrong@linaro.org>, Robert Foss <robert.foss@linaro.org>, Andrzej Hajda <andrzej.hajda@intel.com>, Sam Ravnborg <sam@ravnborg.org> Cc: Marek Vasut <marex@denx.de>, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-amarula <linux-amarula@amarulasolutions.com>, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v11 3/3] drm: exynos: dsi: Restore proper bridge chain order Date: Mon, 12 Dec 2022 23:59:23 +0530 Message-Id: <20221212182923.29155-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221212182923.29155-1-jagan@amarulasolutions.com> References: <20221212182923.29155-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=Gh4sGxHl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm: exynos: dsi: Restore the bridge chain
|
|
Commit Message
Jagan Teki
Dec. 12, 2022, 6:29 p.m. UTC
Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL. This establishes a proper bridge chain while attaching downstream bridges. Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> --- Changes for v11: - add bridge.pre_enable_prev_first Changes for v10: - collect Marek review tag drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Comments
On 12.12.22 19:29, Jagan Teki wrote: > Restore the proper bridge chain by finding the previous bridge > in the chain instead of passing NULL. > > This establishes a proper bridge chain while attaching downstream > bridges. > > Reviewed-by: Marek Vasut <marex@denx.de> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Hi Jagan Responding due to Marek's comment on the "Add Samsung MIPI DSIM bridge" series, although I know very little about the Exynos specifics, and may well be missing context of what you're trying to achieve. On Mon, 12 Dec 2022 at 18:29, Jagan Teki <jagan@amarulasolutions.com> wrote: > > Restore the proper bridge chain by finding the previous bridge > in the chain instead of passing NULL. > > This establishes a proper bridge chain while attaching downstream > bridges. > > Reviewed-by: Marek Vasut <marex@denx.de> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > Changes for v11: > - add bridge.pre_enable_prev_first > Changes for v10: > - collect Marek review tag > > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > index ec673223d6b7..9d10a89d28f1 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, > { > struct exynos_dsi *dsi = bridge_to_dsi(bridge); > > - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); > + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, > + flags); Agreed on this change. > } > > static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { > @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, > > drm_bridge_add(&dsi->bridge); > > - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); > + drm_bridge_attach(encoder, &dsi->bridge, > + list_first_entry_or_null(&encoder->bridge_chain, > + struct drm_bridge, > + chain_node), 0); What bridge are you expecting between the encoder and this bridge? The encoder is the drm_simple_encoder_init encoder that you've created in exynos_dsi_bind, so separating that from the bridge you're also creating here seems weird. > > /* > * This is a temporary solution and should be made by more generic way. > @@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) > dsi->bridge.funcs = &exynos_dsi_bridge_funcs; > dsi->bridge.of_node = dev->of_node; > dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; > + dsi->bridge.pre_enable_prev_first = true; Setting dsi->bridge.pre_enable_prev_first on what is presumably the DSI host controller seems a little odd. Same question again - what bridge are you expecting to be upstream of the DSI host that needs to be preenabled before it? Whilst it's possible that there's another bridge, I'd have expected that to be the first link from your encoder as they appear to both belong to the same bit of driver. Dave > ret = component_add(dev, &exynos_dsi_component_ops); > if (ret) > -- > 2.25.1 >
Hi Dave, On Sat, Jan 21, 2023 at 12:26 AM Dave Stevenson <dave.stevenson@raspberrypi.com> wrote: > > Hi Jagan > > Responding due to Marek's comment on the "Add Samsung MIPI DSIM > bridge" series, although I know very little about the Exynos > specifics, and may well be missing context of what you're trying to > achieve. > > On Mon, 12 Dec 2022 at 18:29, Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > Restore the proper bridge chain by finding the previous bridge > > in the chain instead of passing NULL. > > > > This establishes a proper bridge chain while attaching downstream > > bridges. > > > > Reviewed-by: Marek Vasut <marex@denx.de> > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > Changes for v11: > > - add bridge.pre_enable_prev_first > > Changes for v10: > > - collect Marek review tag > > > > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > index ec673223d6b7..9d10a89d28f1 100644 > > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, > > { > > struct exynos_dsi *dsi = bridge_to_dsi(bridge); > > > > - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); > > + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, > > + flags); > > Agreed on this change. > > > } > > > > static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { > > @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, > > > > drm_bridge_add(&dsi->bridge); > > > > - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); > > + drm_bridge_attach(encoder, &dsi->bridge, > > + list_first_entry_or_null(&encoder->bridge_chain, > > + struct drm_bridge, > > + chain_node), 0); > > What bridge are you expecting between the encoder and this bridge? > The encoder is the drm_simple_encoder_init encoder that you've created > in exynos_dsi_bind, so separating that from the bridge you're also > creating here seems weird. > > > > > /* > > * This is a temporary solution and should be made by more generic way. > > @@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) > > dsi->bridge.funcs = &exynos_dsi_bridge_funcs; > > dsi->bridge.of_node = dev->of_node; > > dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; > > + dsi->bridge.pre_enable_prev_first = true; > > Setting dsi->bridge.pre_enable_prev_first on what is presumably the > DSI host controller seems a little odd. > Same question again - what bridge are you expecting to be upstream of > the DSI host that needs to be preenabled before it? Whilst it's > possible that there's another bridge, I'd have expected that to be the > first link from your encoder as they appear to both belong to the same > bit of driver. Let me answer all together here. I can explain a bit about one of the pipelines used in Exynos. Exynos DSI DRM drivers have some strict host initialization which is not the same as what we used in i.MX8M even though it uses the same DSIM IP. Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel Here MIC is the bridge, Exynos DSI is the bridge and the requirement is to expect the upstream bridge to pre_enable first from DSI which means the MIC. Jagan.
Hi Jagan On Fri, 20 Jan 2023 at 19:10, Jagan Teki <jagan@amarulasolutions.com> wrote: > > Hi Dave, > > On Sat, Jan 21, 2023 at 12:26 AM Dave Stevenson > <dave.stevenson@raspberrypi.com> wrote: > > > > Hi Jagan > > > > Responding due to Marek's comment on the "Add Samsung MIPI DSIM > > bridge" series, although I know very little about the Exynos > > specifics, and may well be missing context of what you're trying to > > achieve. > > > > On Mon, 12 Dec 2022 at 18:29, Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > > > Restore the proper bridge chain by finding the previous bridge > > > in the chain instead of passing NULL. > > > > > > This establishes a proper bridge chain while attaching downstream > > > bridges. > > > > > > Reviewed-by: Marek Vasut <marex@denx.de> > > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > --- > > > Changes for v11: > > > - add bridge.pre_enable_prev_first > > > Changes for v10: > > > - collect Marek review tag > > > > > > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > > index ec673223d6b7..9d10a89d28f1 100644 > > > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > > @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, > > > { > > > struct exynos_dsi *dsi = bridge_to_dsi(bridge); > > > > > > - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); > > > + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, > > > + flags); > > > > Agreed on this change. > > > > > } > > > > > > static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { > > > @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, > > > > > > drm_bridge_add(&dsi->bridge); > > > > > > - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); > > > + drm_bridge_attach(encoder, &dsi->bridge, > > > + list_first_entry_or_null(&encoder->bridge_chain, > > > + struct drm_bridge, > > > + chain_node), 0); > > > > What bridge are you expecting between the encoder and this bridge? > > The encoder is the drm_simple_encoder_init encoder that you've created > > in exynos_dsi_bind, so separating that from the bridge you're also > > creating here seems weird. > > > > > > > > /* > > > * This is a temporary solution and should be made by more generic way. > > > @@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) > > > dsi->bridge.funcs = &exynos_dsi_bridge_funcs; > > > dsi->bridge.of_node = dev->of_node; > > > dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; > > > + dsi->bridge.pre_enable_prev_first = true; > > > > Setting dsi->bridge.pre_enable_prev_first on what is presumably the > > DSI host controller seems a little odd. > > Same question again - what bridge are you expecting to be upstream of > > the DSI host that needs to be preenabled before it? Whilst it's > > possible that there's another bridge, I'd have expected that to be the > > first link from your encoder as they appear to both belong to the same > > bit of driver. > > Let me answer all together here. I can explain a bit about one of the > pipelines used in Exynos. Exynos DSI DRM drivers have some strict host > initialization which is not the same as what we used in i.MX8M even > though it uses the same DSIM IP. > > Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel > > Here MIC is the bridge, Exynos DSI is the bridge and the requirement > is to expect the upstream bridge to pre_enable first from DSI which > means the MIC. That makes sense for the pre_enable_prev_first flag. The drm_bridge_attach(... list_first_entry_or_null) still seems a little weird. I think you are making the assumption that there is only ever going to be the zero or one bridge (the MIC) between encoder and DSI bridge - the DSI bridge is linking itself to the first entry off the encoder bridge_chain (or NULL to link to the encoder). Is that reasonable? I've no idea! I must confess to not having looked at the attaching sequence recently, and I'm about to head home for the weekend. I have no real knowledge of how Exynos is working, and am aware that you're having to rejuggle stuff to try and support i.MX8M and Exynos, so leave that one up to you. Cheers Dave
On 20.01.23 20:42, Dave Stevenson wrote: > Hi Jagan > > On Fri, 20 Jan 2023 at 19:10, Jagan Teki <jagan@amarulasolutions.com> wrote: >> >> Hi Dave, >> >> On Sat, Jan 21, 2023 at 12:26 AM Dave Stevenson >> <dave.stevenson@raspberrypi.com> wrote: >>> >>> Hi Jagan >>> >>> Responding due to Marek's comment on the "Add Samsung MIPI DSIM >>> bridge" series, although I know very little about the Exynos >>> specifics, and may well be missing context of what you're trying to >>> achieve. >>> >>> On Mon, 12 Dec 2022 at 18:29, Jagan Teki <jagan@amarulasolutions.com> wrote: >>>> >>>> Restore the proper bridge chain by finding the previous bridge >>>> in the chain instead of passing NULL. >>>> >>>> This establishes a proper bridge chain while attaching downstream >>>> bridges. >>>> >>>> Reviewed-by: Marek Vasut <marex@denx.de> >>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> >>>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> >>>> --- >>>> Changes for v11: >>>> - add bridge.pre_enable_prev_first >>>> Changes for v10: >>>> - collect Marek review tag >>>> >>>> drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++-- >>>> 1 file changed, 7 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c >>>> index ec673223d6b7..9d10a89d28f1 100644 >>>> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c >>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c >>>> @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, >>>> { >>>> struct exynos_dsi *dsi = bridge_to_dsi(bridge); >>>> >>>> - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); >>>> + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, >>>> + flags); >>> >>> Agreed on this change. >>> >>>> } >>>> >>>> static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { >>>> @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, >>>> >>>> drm_bridge_add(&dsi->bridge); >>>> >>>> - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); >>>> + drm_bridge_attach(encoder, &dsi->bridge, >>>> + list_first_entry_or_null(&encoder->bridge_chain, >>>> + struct drm_bridge, >>>> + chain_node), 0); >>> >>> What bridge are you expecting between the encoder and this bridge? >>> The encoder is the drm_simple_encoder_init encoder that you've created >>> in exynos_dsi_bind, so separating that from the bridge you're also >>> creating here seems weird. >>> >>>> >>>> /* >>>> * This is a temporary solution and should be made by more generic way. >>>> @@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) >>>> dsi->bridge.funcs = &exynos_dsi_bridge_funcs; >>>> dsi->bridge.of_node = dev->of_node; >>>> dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; >>>> + dsi->bridge.pre_enable_prev_first = true; >>> >>> Setting dsi->bridge.pre_enable_prev_first on what is presumably the >>> DSI host controller seems a little odd. >>> Same question again - what bridge are you expecting to be upstream of >>> the DSI host that needs to be preenabled before it? Whilst it's >>> possible that there's another bridge, I'd have expected that to be the >>> first link from your encoder as they appear to both belong to the same >>> bit of driver. >> >> Let me answer all together here. I can explain a bit about one of the >> pipelines used in Exynos. Exynos DSI DRM drivers have some strict host >> initialization which is not the same as what we used in i.MX8M even >> though it uses the same DSIM IP. >> >> Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel >> >> Here MIC is the bridge, Exynos DSI is the bridge and the requirement >> is to expect the upstream bridge to pre_enable first from DSI which >> means the MIC. > > That makes sense for the pre_enable_prev_first flag. > > The drm_bridge_attach(... list_first_entry_or_null) still seems a > little weird. I think you are making the assumption that there is only > ever going to be the zero or one bridge (the MIC) between encoder and > DSI bridge - the DSI bridge is linking itself to the first entry off > the encoder bridge_chain (or NULL to link to the encoder). Is that > reasonable? I've no idea! I think the assumption is reasonable for now, as it covers both types of chains this driver is currently used in (Exynos and i.MX). And IIUC this change is mainly needed for (backward) compatibility with the somewhat "special" chain in Exynos. > > I must confess to not having looked at the attaching sequence > recently, and I'm about to head home for the weekend. > I have no real knowledge of how Exynos is working, and am aware that > you're having to rejuggle stuff to try and support i.MX8M and Exynos, > so leave that one up to you. I strongly vote for leaving this as is for now. We already spent too much time finding a satisfying solution that covers Exynos and i.MX. There might be room for improvements in the future, but in my opinion this is good enough to get merged.
Hi Dave, On Sat, Jan 21, 2023 at 1:12 AM Dave Stevenson <dave.stevenson@raspberrypi.com> wrote: > > Hi Jagan > > On Fri, 20 Jan 2023 at 19:10, Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > Hi Dave, > > > > On Sat, Jan 21, 2023 at 12:26 AM Dave Stevenson > > <dave.stevenson@raspberrypi.com> wrote: > > > > > > Hi Jagan > > > > > > Responding due to Marek's comment on the "Add Samsung MIPI DSIM > > > bridge" series, although I know very little about the Exynos > > > specifics, and may well be missing context of what you're trying to > > > achieve. > > > > > > On Mon, 12 Dec 2022 at 18:29, Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > > > > > Restore the proper bridge chain by finding the previous bridge > > > > in the chain instead of passing NULL. > > > > > > > > This establishes a proper bridge chain while attaching downstream > > > > bridges. > > > > > > > > Reviewed-by: Marek Vasut <marex@denx.de> > > > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > --- > > > > Changes for v11: > > > > - add bridge.pre_enable_prev_first > > > > Changes for v10: > > > > - collect Marek review tag > > > > > > > > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 +++++++-- > > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > > > index ec673223d6b7..9d10a89d28f1 100644 > > > > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > > > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > > > > @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, > > > > { > > > > struct exynos_dsi *dsi = bridge_to_dsi(bridge); > > > > > > > > - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); > > > > + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, > > > > + flags); > > > > > > Agreed on this change. > > > > > > > } > > > > > > > > static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { > > > > @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, > > > > > > > > drm_bridge_add(&dsi->bridge); > > > > > > > > - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); > > > > + drm_bridge_attach(encoder, &dsi->bridge, > > > > + list_first_entry_or_null(&encoder->bridge_chain, > > > > + struct drm_bridge, > > > > + chain_node), 0); > > > > > > What bridge are you expecting between the encoder and this bridge? > > > The encoder is the drm_simple_encoder_init encoder that you've created > > > in exynos_dsi_bind, so separating that from the bridge you're also > > > creating here seems weird. > > > > > > > > > > > /* > > > > * This is a temporary solution and should be made by more generic way. > > > > @@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) > > > > dsi->bridge.funcs = &exynos_dsi_bridge_funcs; > > > > dsi->bridge.of_node = dev->of_node; > > > > dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; > > > > + dsi->bridge.pre_enable_prev_first = true; > > > > > > Setting dsi->bridge.pre_enable_prev_first on what is presumably the > > > DSI host controller seems a little odd. > > > Same question again - what bridge are you expecting to be upstream of > > > the DSI host that needs to be preenabled before it? Whilst it's > > > possible that there's another bridge, I'd have expected that to be the > > > first link from your encoder as they appear to both belong to the same > > > bit of driver. > > > > Let me answer all together here. I can explain a bit about one of the > > pipelines used in Exynos. Exynos DSI DRM drivers have some strict host > > initialization which is not the same as what we used in i.MX8M even > > though it uses the same DSIM IP. > > > > Exynos5433 Decon -> Exynos MIC -> Exynos DSI -> s6e3ha2 DSI panel > > > > Here MIC is the bridge, Exynos DSI is the bridge and the requirement > > is to expect the upstream bridge to pre_enable first from DSI which > > means the MIC. > > That makes sense for the pre_enable_prev_first flag. > > The drm_bridge_attach(... list_first_entry_or_null) still seems a > little weird. I think you are making the assumption that there is only > ever going to be the zero or one bridge (the MIC) between encoder and > DSI bridge - the DSI bridge is linking itself to the first entry off > the encoder bridge_chain (or NULL to link to the encoder). Is that > reasonable? I've no idea! That is true, the reason would be that DSI bridges still use an encoder, usually, the first bridge in the chain will use an encoder and subsequent bridges are fully bridge-driven drivers (without an encoder) in order to follow the DRM bridge chain topology. Unfortunately, the Exynos DRM drivers follow component-based binding so DSI is part of that topology any attempt to exclude the encoder from it not compatible with Exynos DRM drivers. So, in order to make the bridge chain work properly we assume that linking. I think this bridge attach from the DSI driver bind can be dropped if we make Exynos DSIM as an independent bridge driver. Jagan.
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ec673223d6b7..9d10a89d28f1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, + flags); } static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, drm_bridge_add(&dsi->bridge); - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + drm_bridge_attach(encoder, &dsi->bridge, + list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, + chain_node), 0); /* * This is a temporary solution and should be made by more generic way. @@ -1709,6 +1713,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->bridge.funcs = &exynos_dsi_bridge_funcs; dsi->bridge.of_node = dev->of_node; dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; + dsi->bridge.pre_enable_prev_first = true; ret = component_add(dev, &exynos_dsi_component_ops); if (ret)