| Message ID | 20220428094808.782938-1-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBA6GVGJQMGQEPBUACBI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 43F0F3F0CD for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 28 Apr 2022 11:48:53 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id i19-20020aa79093000000b0050d44b83506sf2519453pfa.22 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 28 Apr 2022 02:48:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651139332; cv=pass; d=google.com; s=arc-20160816; b=WjO9lNXMyJtYsHkYywubqaCQEZQVyYPY2YURQKcN8yJb5lUN6P44pomu+pYMi22XtL p1l2LtaOFdl1drEchQ1sp7qs4jtr36FP8nGm5iXLqSZKYOL9sWdWd3bxhgdykGxOox07 1VHWynVyT5aDyCv1wt5o+vR7rSqcbkY4JBAv0enhvgR4PWBlhZA8wfCrITzdZX3vpwpK Sbdw1h/IS+ejEE//NXyjPIKShh6krqBb5+Rl3cBjhAAnHomcwhdgc13q7nNTJwsZkcah Lgj7AXs+aSutGVkNJZPIhdqxbbmA3APHC7ZjxoQDnlrJ0F1Rwn+aUs8diNLXc1zHzY5c eSZw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=Qi/AbaB8pvH8YrLGIaj4AkeIXH9cS0UsFGcEFwqGRkA=; b=MNBuJyIl2rfrUs2vw8eap6VVwJvTAYgE/l93GqRAlLkUMyJhfL1SmNDLFSGsuoiqTA ooPZ+awsuVT9jG16vEr+qW91NQcTRPbLtTVDXUjuUj7NmkY6gndqdJTTSIx5y9ZIxlgy doXUFqPNV/aBygci6eNCgmZ3VXxiCuckj6Pq8CT2VgWsgOaJb+9TOjJRI8mC3oAK3lFc YpdW+htkd1bNzedLHizLdO3EjyKbEzhzMVhpAi2c6NvpPhDmvnYO7fEkAvVMHNz44v0w ndInympjVMWG+gOzziKAoleBMxcD1KUYyNVfZFN/K8jyC2fkV3FVJTiEtH2rMbzWkFXj j24A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lnQNze7+; 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=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Qi/AbaB8pvH8YrLGIaj4AkeIXH9cS0UsFGcEFwqGRkA=; b=CWGMULwALcFdFNI22LQqJULrDzswU1zOa+FwRqugU80t2hM//vWDyxtXNdTIIffAOX uH+PVQr6SEnAik7R8PiI+cftwMkYcST3pxPlhhjMRPck5nmoz35VEbjHtAIFayN2bz2y CwcIhbZ8QR7T2H4uqaarbjcTPX5SVhaI+58kI= 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: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=Qi/AbaB8pvH8YrLGIaj4AkeIXH9cS0UsFGcEFwqGRkA=; b=hyjwEkfg9nFdnh/m/apRgvuQpQmRzrmFPreU2khGOAPlVkSZvGOpV81IBdFkKzTziR UEGZgVHQbK0pLLT97lGVdctyrc/3OlVgRItubqMJUxl3MiBVlEPCct+U9nDxwTADDR4W 3TGSncZDJpf/IND0DLg5fLSXJt+vGIVOTcegWmyQJO4Bv7wJ2crc8nxjxAnaofuVh1xz QYvFgLmkKhdUIUN4GamLMMYhmOTlf1HvFBzdj9eZnoyLqFKcn2C/WSA283uDjyr6KUo2 GxOgkPov/iCxiNwOd29nEUyAs8Zu/RacorDr5iONcfaGWVvoNbt9ZuicWof0tVchrWHQ AR5g== X-Gm-Message-State: AOAM533nilwITzVHaBuuZZ7YvcVSLwvqNGr1HenWf04kYRvDm1lLXI+t 3JW/2caOQ4iExrO6QR9it2Vyqa7k X-Google-Smtp-Source: ABdhPJxE6rwYSLgwv6x9z3cNOwgwoZqoNL9fOw5k+zgH2SNEcxedv0yK7QbV6r7HLEvp34ZWwYRJIA== X-Received: by 2002:a17:902:bd93:b0:158:fef8:b4fc with SMTP id q19-20020a170902bd9300b00158fef8b4fcmr33264040pls.48.1651139331833; Thu, 28 Apr 2022 02:48:51 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:bb8c:b0:14d:d65a:dbdb with SMTP id m12-20020a170902bb8c00b0014dd65adbdbls7537090pls.6.gmail; Thu, 28 Apr 2022 02:48:51 -0700 (PDT) X-Received: by 2002:a17:902:6bc1:b0:15d:1e15:1a75 with SMTP id m1-20020a1709026bc100b0015d1e151a75mr18713146plt.114.1651139331124; Thu, 28 Apr 2022 02:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651139331; cv=none; d=google.com; s=arc-20160816; b=qXzHXvE6zYXkIn0jQiehP7HffHtBl7HwfOk7Bb116kHqfdqJXgkbHdst5e3yxZEWio K31ZzRuYIgovlQALEImXo0UcYRhl1QBESLFVseUsRLv++syZdVsw21uaoYKjBp86EWSe BQexQevM/gWtE8Y/6ca4seEyZQt4GPEqIA3jAWpf2eUFQ48iBxPb85b8y/9hZVt8glir XxhWuVNP2gock0SQzZnxSVg6qcSJtvNbby9O/BuocRWsyvfXEtfh3E5I1hMlBcfC2z+N Kca1yAWQ/gGtOrOQA3kv86vSVQV09FlQP4qnhT9uvYUr7846GQhjRXEDvCqGYqQG2/nQ pl2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=fSO9EXYOSC33q6TMX5paIc/n59vloq374c1uB49deWM=; b=arIYk41YbUMtqMnVC48tlSS7GE2vzUgf6Spo8X1LBrUk0ieUqkxBp9j/t/D1uAcG7V NIdFyuvggOMEcSZPU0yyC+3CBWf3HytBYaHmVK6IFDPeeoBKIrR/nSz6XNQvegVz2DL2 xF7TIV/rqEgfMq1ej0IlHPZDmRBu44JYlHfsZsfdwxMjb+CmOpXqtsHGHFJr7Sqht610 oBzM8K9jIQUjnMeYQitd3TWJ1GsF7QvKy3gbZcSzCe+jI4S4n2MlMH/Yu/J5e6+VB6D8 lFI4+jtuzr//r1m2O6ti8VohSrLJC1F0M0r+hWsGaeRoCeZi8gsMcrUqTbhN6gF2miYy xRFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lnQNze7+; 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 i12-20020a170902cf0c00b0015309b5cc1fsor1920368plg.36.2022.04.28.02.48.51 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 28 Apr 2022 02:48:51 -0700 (PDT) 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:a17:902:ce01:b0:15c:eedb:f00c with SMTP id k1-20020a170902ce0100b0015ceedbf00cmr24832151plg.122.1651139330761; Thu, 28 Apr 2022 02:48:50 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a0a9:a3c7:357:7b61:223a]) by smtp.gmail.com with ESMTPSA id y9-20020a17090a1f4900b001cd498dc153sm9842845pjy.3.2022.04.28.02.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 02:48:50 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Marek Szyprowski <m.szyprowski@samsung.com>, Maxime Ripard <maxime@cerno.tech>, Inki Dae <inki.dae@samsung.com>, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH] drm: exynos: dsi: Use child panel or bridge find helpers Date: Thu, 28 Apr 2022 15:18:08 +0530 Message-Id: <20220428094808.782938-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 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=lnQNze7+; 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: Use child panel or bridge find helpers
|
|
Commit Message
Jagan Teki
April 28, 2022, 9:48 a.m. UTC
commit <711c7adc4687> ("drm: exynos: dsi: Use drm panel_bridge API")
added devm_drm_of_get_bridge for looking up if child node has panel
or bridge.
However commit <b089c0a9b14c> ("Revert "drm: of: Lookup if child node
has panel or bridge") has reverted panel or bridge child node lookup
from devm_drm_of_get_bridge which eventually failed to find the DSI
devices in exynos drm dsi driver.
So, use the conventional child panel bridge lookup helpers like it
does before.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
Comments
On 28.04.2022 11:48, Jagan Teki wrote: > commit <711c7adc4687> ("drm: exynos: dsi: Use drm panel_bridge API") > added devm_drm_of_get_bridge for looking up if child node has panel > or bridge. > > However commit <b089c0a9b14c> ("Revert "drm: of: Lookup if child node > has panel or bridge") has reverted panel or bridge child node lookup > from devm_drm_of_get_bridge which eventually failed to find the DSI > devices in exynos drm dsi driver. > > So, use the conventional child panel bridge lookup helpers like it > does before. > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> This restores Exynos DSI driver operation in linux-next after the mentioned commits went via drm-misc-fixes tree. Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> > --- > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > index f067c86b0b12..ec673223d6b7 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > @@ -25,6 +25,7 @@ > #include <drm/drm_atomic_helper.h> > #include <drm/drm_bridge.h> > #include <drm/drm_mipi_dsi.h> > +#include <drm/drm_panel.h> > #include <drm/drm_print.h> > #include <drm/drm_probe_helper.h> > #include <drm/drm_simple_kms_helper.h> > @@ -1451,9 +1452,18 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, > struct device *dev = dsi->dev; > struct drm_encoder *encoder = &dsi->encoder; > struct drm_device *drm = encoder->dev; > + struct drm_panel *panel; > int ret; > > - dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); > + panel = of_drm_find_panel(device->dev.of_node); > + if (!IS_ERR(panel)) { > + dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); > + } else { > + dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); > + if (!dsi->out_bridge) > + dsi->out_bridge = ERR_PTR(-EINVAL); > + } > + > if (IS_ERR(dsi->out_bridge)) { > ret = PTR_ERR(dsi->out_bridge); > DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); Best regards
On Thu, Apr 28, 2022 at 03:18:08PM +0530, Jagan Teki wrote: > commit <711c7adc4687> ("drm: exynos: dsi: Use drm panel_bridge API") > added devm_drm_of_get_bridge for looking up if child node has panel > or bridge. > > However commit <b089c0a9b14c> ("Revert "drm: of: Lookup if child node > has panel or bridge") has reverted panel or bridge child node lookup > from devm_drm_of_get_bridge which eventually failed to find the DSI > devices in exynos drm dsi driver. > > So, use the conventional child panel bridge lookup helpers like it > does before. > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > index f067c86b0b12..ec673223d6b7 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > @@ -25,6 +25,7 @@ > #include <drm/drm_atomic_helper.h> > #include <drm/drm_bridge.h> > #include <drm/drm_mipi_dsi.h> > +#include <drm/drm_panel.h> > #include <drm/drm_print.h> > #include <drm/drm_probe_helper.h> > #include <drm/drm_simple_kms_helper.h> > @@ -1451,9 +1452,18 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, > struct device *dev = dsi->dev; > struct drm_encoder *encoder = &dsi->encoder; > struct drm_device *drm = encoder->dev; > + struct drm_panel *panel; > int ret; > > - dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); > + panel = of_drm_find_panel(device->dev.of_node); > + if (!IS_ERR(panel)) { > + dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); > + } else { > + dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); > + if (!dsi->out_bridge) > + dsi->out_bridge = ERR_PTR(-EINVAL); > + } > + We should just revert 711c7adc4687 entirely (and make it very explicit in the commit log). The out_bridge lifetime is completely screwed-up in that patch now. If there's a panel it will be managed, but it's not if there's a bridge. Maxime
Hi Maxime, On 28.04.2022 14:14, Maxime Ripard wrote: > On Thu, Apr 28, 2022 at 03:18:08PM +0530, Jagan Teki wrote: >> commit <711c7adc4687> ("drm: exynos: dsi: Use drm panel_bridge API") >> added devm_drm_of_get_bridge for looking up if child node has panel >> or bridge. >> >> However commit <b089c0a9b14c> ("Revert "drm: of: Lookup if child node >> has panel or bridge") has reverted panel or bridge child node lookup >> from devm_drm_of_get_bridge which eventually failed to find the DSI >> devices in exynos drm dsi driver. >> >> So, use the conventional child panel bridge lookup helpers like it >> does before. >> >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> >> --- >> drivers/gpu/drm/exynos/exynos_drm_dsi.c | 12 +++++++++++- >> 1 file changed, 11 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c >> index f067c86b0b12..ec673223d6b7 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c >> @@ -25,6 +25,7 @@ >> #include <drm/drm_atomic_helper.h> >> #include <drm/drm_bridge.h> >> #include <drm/drm_mipi_dsi.h> >> +#include <drm/drm_panel.h> >> #include <drm/drm_print.h> >> #include <drm/drm_probe_helper.h> >> #include <drm/drm_simple_kms_helper.h> >> @@ -1451,9 +1452,18 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, >> struct device *dev = dsi->dev; >> struct drm_encoder *encoder = &dsi->encoder; >> struct drm_device *drm = encoder->dev; >> + struct drm_panel *panel; >> int ret; >> >> - dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); >> + panel = of_drm_find_panel(device->dev.of_node); >> + if (!IS_ERR(panel)) { >> + dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); >> + } else { >> + dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); >> + if (!dsi->out_bridge) >> + dsi->out_bridge = ERR_PTR(-EINVAL); >> + } >> + > We should just revert 711c7adc4687 entirely (and make it very explicit > in the commit log). The out_bridge lifetime is completely screwed-up in > that patch now. If there's a panel it will be managed, but it's not if > there's a bridge. Nope, this patch does exactly what is needed there. If there is a panel, it creates a managed panel_bridge() proxy. If there is a bridge, it simply gets a pointer to it. There is nothing to manage if there is a bridge attached next to DSI. See devm_drm_of_get_bridge() function, it does exactly the same things (managed panel_bridge or simple pointer to the real next bridge). I agree that this is not very obvious at the first sight, but that's how the code is now structured. Please queue this to drm-misc-next, so the Exynos DSI will be again operational after merging the drm-misc-fixes and drm-misc-next. Best regards
On Thu, 28 Apr 2022 15:18:08 +0530, Jagan Teki wrote: > commit <711c7adc4687> ("drm: exynos: dsi: Use drm panel_bridge API") > added devm_drm_of_get_bridge for looking up if child node has panel > or bridge. > > However commit <b089c0a9b14c> ("Revert "drm: of: Lookup if child node > has panel or bridge") has reverted panel or bridge child node lookup > from devm_drm_of_get_bridge which eventually failed to find the DSI > devices in exynos drm dsi driver. > > [...] Applied to drm/drm-misc (drm-misc-next). Thanks! Maxime
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index f067c86b0b12..ec673223d6b7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -25,6 +25,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_mipi_dsi.h> +#include <drm/drm_panel.h> #include <drm/drm_print.h> #include <drm/drm_probe_helper.h> #include <drm/drm_simple_kms_helper.h> @@ -1451,9 +1452,18 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct device *dev = dsi->dev; struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm = encoder->dev; + struct drm_panel *panel; int ret; - dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); + panel = of_drm_find_panel(device->dev.of_node); + if (!IS_ERR(panel)) { + dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); + } else { + dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); + if (!dsi->out_bridge) + dsi->out_bridge = ERR_PTR(-EINVAL); + } + if (IS_ERR(dsi->out_bridge)) { ret = PTR_ERR(dsi->out_bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret);