| Message ID | 20210322140152.101709-2-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBB3OG4KBAMGQEPI3E3ZI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 746E23F067 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 22 Mar 2021 15:02:23 +0100 (CET) Received: by mail-pj1-f69.google.com with SMTP id j12sf29095602pjm.5 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 22 Mar 2021 07:02:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616421741; cv=pass; d=google.com; s=arc-20160816; b=TKtfT/0HqsPF0n8moBkQz2MyhEyeVHmcdZMqUClEdrWvdUhKndtmlh+YSS7HZbLiTi 5APwtUAxsigT/33n2q7UYKynahcq322bNrRSY6Ui+xtLr5HuDzxQyM0gLbGNx0K+A9GH LfNhL9dkgK2HVWuQlISwWNn0x8lCrGrWIrPeY55e+quGlHETInyPLIebu2/4Fl8Nv2AP QLT4Efwk8ibDfvnPX1NmNJwpI9aOLQd5kGjwdgHg2FaWmtPl8X3Ii42ARnZfXGiv7dtX Sw0YM7e5+bFIvZdoFOFyh1a2JmNQ+E3NEk75b0mfAbEExF95faUchpbub6piif3BiDS3 JcPA== 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=h14QX8HddP1JDyQtjljRx88S0OGe3elNC8PoO7Lu+H4=; b=OssPBwvWC251JB7tNC+IbHIjB113E+VCJ6Rx9efnu9Hnb1ElMaOU3EkFr7hfcCkrhf Hvf66D8EQaxV/q4RCq4mT51Ul08SYMXHzFnKumNmJmAcEvfS397NvPiiOrdyrTgoy5BA GZRx1X77TiMEspd2MQbLYGWyzVBQsjJlWpBDxUY9W/fuphRJ65P1jjvqnmS8CQ7YvHtJ 0d0Q8etrDovPgRTMdz/qDO+n1VcqHONdMrB7ohYQXrJTLzOTRYZ89aI4HMCHcpZ7agfu 0rGWoYwmjH3c4Lw/GFHPl+FFVQSBMzMiaLzbOaAMxkvdjPgAzHfhTgroZSIauqxW/6mn Rxqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FQnXW17j; 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=h14QX8HddP1JDyQtjljRx88S0OGe3elNC8PoO7Lu+H4=; b=Fx0nh/fhe7pvEVQIOsTE/JwLyWn7/2t2lqYknWuoFW9VrtLhRsiBuP60XFofpdb9lG QZ7tS6H0yNwgufTucBl3mjerid3d5AtvnmQCpVEbUTf97Twomj7tw4rMk76+z9w4nSaG +m6b9JtPn86co78EmN6h1vfCz8aGQ6BlrlffQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=h14QX8HddP1JDyQtjljRx88S0OGe3elNC8PoO7Lu+H4=; b=XwoSSmMm4tCyo3NQ1/krjg4p/acG7m+SrM6FVijYdmsJy+07E+94qjXVPhODbcKwXS vMT3WDmDOH3Dg/B0Hcs48hSgYzA4BbLFsPY3BfM/mQmCXMA7tfIYk21Z4VIkUQHPT7hy s0+8ExfHKWxVQ4T5FrSaMvYuax8oAvbm4V100esXDDDaD+IO/hN7Rx5RxqoJhEFa+lTb ePbngeYIPmSAAa++KrzIOfEmDhDHs0yBD1rs8zAecoTheaSL4eeBdMYUr9OnHigc28R0 yCn8sfLHfByYxgHpSHTaG7crN7ZZ859VQBiAdZyLLjcZQu4Wwh9WbBOKm3IWdQv+/oxo hlIg== X-Gm-Message-State: AOAM530W3E1R06SfPMGmcQjDMPsQ8erbFvXEX7iP9LnMgFWE3qx0A04/ kvC1L9HzlF0IHjPswpSd2TtXzshP X-Google-Smtp-Source: ABdhPJxvw0EHmGbcXG0a5xfXw99arc+LHaawxPFKBvYUbM+0EREW7OHrqtONxQGmZsoAgunStqNaRQ== X-Received: by 2002:a17:902:d346:b029:e4:c35b:dc0a with SMTP id l6-20020a170902d346b02900e4c35bdc0amr27198717plk.75.1616421741535; Mon, 22 Mar 2021 07:02:21 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6256:: with SMTP id q22ls4470194pgv.2.gmail; Mon, 22 Mar 2021 07:02:21 -0700 (PDT) X-Received: by 2002:a62:82cb:0:b029:1f6:213b:6590 with SMTP id w194-20020a6282cb0000b02901f6213b6590mr36259pfd.17.1616421740871; Mon, 22 Mar 2021 07:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616421740; cv=none; d=google.com; s=arc-20160816; b=pnkjSqhYhAiTkUBOGHl8T97H72GUDMaHtK9TFFOyYJW9jBPyv1bkjPum/FgerV1ncD hiE2pDgysAJFKmQjpIuWKzI0dzGH07vfQZ8pmHVQJP9b+v3ZKJ+PPyotnBxV4czh2OSg Z7OMf08QaR2Rv4h36qzA22Y3Fens5x0w22OPu4dHzyg2gDaCnUZgBW++V1uDYIuMWnv1 ryUZDytlfLU3jB/TRgydn7NAqDrBFc4R+/WVDSwQpPKo/5EH6dyfrBW94MXGxcXUb+kV eWZT2Mhd0Fmqnn86DHe/QLj2YcRCYBIAFtNnvheVEpjSQM0JZ9tot1xFEoGHt4kHXrPM 3qvw== 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=yFiw4jYyVPgKKK9i77Vkg4hTSWnNarff0aeFjf5I2bg=; b=OBZvhcZPdAEGrAxBSSLUDb0gpQbVB29daUllBaDm6WrXqPHvbpv14Iz8gWXG0g6/yf Rj0yRphZy+uv8OEbWKp1uTpAcedYo4ncGeRmwvpHROaS855BTEBz8JnZd0eahz/IhHJf fQKuiEa7B339qd1t9+zOs6qW+5YfCFuRd56ChET/6M82b6FFADRwyiSA8uh6avYiI1Ha fziYOfHq1HnTghvwO01fU/acnZ7XWNeaU4sUFBVNXjwW4pMRKE/MXVpeZVdXkzNKsQGb q80POVR+hl7KpHLIDNJmmFdREvQFx6k5SxI4yogQ2OTRaYrmW5E2IXTkU8QtNSPi9em1 C2EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FQnXW17j; 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 t24sor7287695pjy.26.2021.03.22.07.02.20 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Mon, 22 Mar 2021 07:02:20 -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:90b:4a4c:: with SMTP id lb12mr13550185pjb.133.1616421740641; Mon, 22 Mar 2021 07:02:20 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:15c1:9a30:414f:d84b]) by smtp.gmail.com with ESMTPSA id gg22sm14112997pjb.20.2021.03.22.07.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 07:02:20 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@siol.net>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Samuel Holland <samuel@sholland.org> Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v4 1/4] drm: sun4i: dsi: Use drm_of_find_panel_or_bridge Date: Mon, 22 Mar 2021 19:31:49 +0530 Message-Id: <20210322140152.101709-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210322140152.101709-1-jagan@amarulasolutions.com> References: <20210322140152.101709-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=FQnXW17j; 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: <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: sun4i: dsi: Convert drm bridge
|
|
Commit Message
Jagan Teki
March 22, 2021, 2:01 p.m. UTC
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4, v3:
- none
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Comments
Hi Jagan, Thank you for the patch. On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: > Replace of_drm_find_panel with drm_of_find_panel_or_bridge > for finding panel, this indeed help to find the bridge if > bridge support added. > > Added NULL in bridge argument, same will replace with bridge > parameter once bridge supported. > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Looks good, there should be no functional change. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > Changes for v4, v3: > - none > > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > index 4f5efcace68e..2e9e7b2d4145 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -21,6 +21,7 @@ > > #include <drm/drm_atomic_helper.h> > #include <drm/drm_mipi_dsi.h> > +#include <drm/drm_of.h> > #include <drm/drm_panel.h> > #include <drm/drm_print.h> > #include <drm/drm_probe_helper.h> > @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, > struct mipi_dsi_device *device) > { > struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); > - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); > + struct drm_panel *panel; > + int ret; > + > + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, > + &panel, NULL); > + if (ret) > + return ret; > > - if (IS_ERR(panel)) > - return PTR_ERR(panel); > if (!dsi->drm || !dsi->drm->registered) > return -EPROBE_DEFER; >
On 3/23/21 5:53 PM, Laurent Pinchart wrote: > Hi Jagan, > > Thank you for the patch. > > On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: >> Replace of_drm_find_panel with drm_of_find_panel_or_bridge >> for finding panel, this indeed help to find the bridge if >> bridge support added. >> >> Added NULL in bridge argument, same will replace with bridge >> parameter once bridge supported. >> >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > Looks good, there should be no functional change. Actually this breaks all existing users of this driver, see below. > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > >> --- >> Changes for v4, v3: >> - none >> >> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- >> 1 file changed, 8 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c >> index 4f5efcace68e..2e9e7b2d4145 100644 >> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c >> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c >> @@ -21,6 +21,7 @@ >> >> #include <drm/drm_atomic_helper.h> >> #include <drm/drm_mipi_dsi.h> >> +#include <drm/drm_of.h> >> #include <drm/drm_panel.h> >> #include <drm/drm_print.h> >> #include <drm/drm_probe_helper.h> >> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, >> struct mipi_dsi_device *device) >> { >> struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); >> - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); This is using the OF node of the DSI device, which is a direct child of the DSI host's OF node. There is no OF graph involved. >> + struct drm_panel *panel; >> + int ret; >> + >> + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, >> + &panel, NULL); However, this function expects to find the panel using OF graph. This does not work with existing device trees (PinePhone, PineTab) which do not use OF graph to connect the panel. And it cannot work, because the DSI host's binding specifies a single port: the input port from the display engine. Regards, Samuel >> + if (ret) >> + return ret; >> >> - if (IS_ERR(panel)) >> - return PTR_ERR(panel); >> if (!dsi->drm || !dsi->drm->registered) >> return -EPROBE_DEFER; >> >
On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland <samuel@sholland.org> wrote: > > On 3/23/21 5:53 PM, Laurent Pinchart wrote: > > Hi Jagan, > > > > Thank you for the patch. > > > > On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: > >> Replace of_drm_find_panel with drm_of_find_panel_or_bridge > >> for finding panel, this indeed help to find the bridge if > >> bridge support added. > >> > >> Added NULL in bridge argument, same will replace with bridge > >> parameter once bridge supported. > >> > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Looks good, there should be no functional change. > > Actually this breaks all existing users of this driver, see below. > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > >> --- > >> Changes for v4, v3: > >> - none > >> > >> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- > >> 1 file changed, 8 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > >> index 4f5efcace68e..2e9e7b2d4145 100644 > >> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > >> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > >> @@ -21,6 +21,7 @@ > >> > >> #include <drm/drm_atomic_helper.h> > >> #include <drm/drm_mipi_dsi.h> > >> +#include <drm/drm_of.h> > >> #include <drm/drm_panel.h> > >> #include <drm/drm_print.h> > >> #include <drm/drm_probe_helper.h> > >> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, > >> struct mipi_dsi_device *device) > >> { > >> struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); > >> - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); > > This is using the OF node of the DSI device, which is a direct child of > the DSI host's OF node. There is no OF graph involved. > > >> + struct drm_panel *panel; > >> + int ret; > >> + > >> + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, > >> + &panel, NULL); > > However, this function expects to find the panel using OF graph. This > does not work with existing device trees (PinePhone, PineTab) which do > not use OF graph to connect the panel. And it cannot work, because the > DSI host's binding specifies a single port: the input port from the > display engine. Thanks for noticing this. I did understand your point and yes, I did mention the updated pipeline in previous versions and forgot to add it to this series. Here is the updated pipeline to make it work: https://patchwork.kernel.org/project/dri-devel/patch/20190524104252.20236-1-jagan@amarulasolutions.com/ Let me know your comments on this, so I will add a patch for the above-affected DTS files. Jagan.
Hi Jagan, On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote: > On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote: > > On 3/23/21 5:53 PM, Laurent Pinchart wrote: > > > On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: > > >> Replace of_drm_find_panel with drm_of_find_panel_or_bridge > > >> for finding panel, this indeed help to find the bridge if > > >> bridge support added. > > >> > > >> Added NULL in bridge argument, same will replace with bridge > > >> parameter once bridge supported. > > >> > > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > Looks good, there should be no functional change. > > > > Actually this breaks all existing users of this driver, see below. > > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > >> --- > > >> Changes for v4, v3: > > >> - none > > >> > > >> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- > > >> 1 file changed, 8 insertions(+), 3 deletions(-) > > >> > > >> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > >> index 4f5efcace68e..2e9e7b2d4145 100644 > > >> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > >> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > >> @@ -21,6 +21,7 @@ > > >> > > >> #include <drm/drm_atomic_helper.h> > > >> #include <drm/drm_mipi_dsi.h> > > >> +#include <drm/drm_of.h> > > >> #include <drm/drm_panel.h> > > >> #include <drm/drm_print.h> > > >> #include <drm/drm_probe_helper.h> > > >> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, > > >> struct mipi_dsi_device *device) > > >> { > > >> struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); > > >> - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); > > > > This is using the OF node of the DSI device, which is a direct child of > > the DSI host's OF node. There is no OF graph involved. > > > > >> + struct drm_panel *panel; > > >> + int ret; > > >> + > > >> + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, > > >> + &panel, NULL); > > > > However, this function expects to find the panel using OF graph. This > > does not work with existing device trees (PinePhone, PineTab) which do > > not use OF graph to connect the panel. And it cannot work, because the > > DSI host's binding specifies a single port: the input port from the > > display engine. > > Thanks for noticing this. I did understand your point and yes, I did > mention the updated pipeline in previous versions and forgot to add it > to this series. > > Here is the updated pipeline to make it work: > > https://patchwork.kernel.org/project/dri-devel/patch/20190524104252.20236-1-jagan@amarulasolutions.com/ > > Let me know your comments on this, so I will add a patch for the > above-affected DTS files. DT is an ABI, we need to ensure backward compatibility. Changes in kernel drivers can't break devices that have an old DT.
Hi Laurent, On Wed, Mar 24, 2021 at 3:09 PM Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: > > Hi Jagan, > > On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote: > > On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote: > > > On 3/23/21 5:53 PM, Laurent Pinchart wrote: > > > > On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: > > > >> Replace of_drm_find_panel with drm_of_find_panel_or_bridge > > > >> for finding panel, this indeed help to find the bridge if > > > >> bridge support added. > > > >> > > > >> Added NULL in bridge argument, same will replace with bridge > > > >> parameter once bridge supported. > > > >> > > > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > > > Looks good, there should be no functional change. > > > > > > Actually this breaks all existing users of this driver, see below. > > > > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > > > >> --- > > > >> Changes for v4, v3: > > > >> - none > > > >> > > > >> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- > > > >> 1 file changed, 8 insertions(+), 3 deletions(-) > > > >> > > > >> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > >> index 4f5efcace68e..2e9e7b2d4145 100644 > > > >> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > >> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > >> @@ -21,6 +21,7 @@ > > > >> > > > >> #include <drm/drm_atomic_helper.h> > > > >> #include <drm/drm_mipi_dsi.h> > > > >> +#include <drm/drm_of.h> > > > >> #include <drm/drm_panel.h> > > > >> #include <drm/drm_print.h> > > > >> #include <drm/drm_probe_helper.h> > > > >> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, > > > >> struct mipi_dsi_device *device) > > > >> { > > > >> struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); > > > >> - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); > > > > > > This is using the OF node of the DSI device, which is a direct child of > > > the DSI host's OF node. There is no OF graph involved. > > > > > > >> + struct drm_panel *panel; > > > >> + int ret; > > > >> + > > > >> + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, > > > >> + &panel, NULL); > > > > > > However, this function expects to find the panel using OF graph. This > > > does not work with existing device trees (PinePhone, PineTab) which do > > > not use OF graph to connect the panel. And it cannot work, because the > > > DSI host's binding specifies a single port: the input port from the > > > display engine. > > > > Thanks for noticing this. I did understand your point and yes, I did > > mention the updated pipeline in previous versions and forgot to add it > > to this series. > > > > Here is the updated pipeline to make it work: > > > > https://patchwork.kernel.org/project/dri-devel/patch/20190524104252.20236-1-jagan@amarulasolutions.com/ > > > > Let me know your comments on this, so I will add a patch for the > > above-affected DTS files. > > DT is an ABI, we need to ensure backward compatibility. Changes in > kernel drivers can't break devices that have an old DT. Thanks for your point. So, we need to choose APIs that would compatible with the old DT and new DT changes. Am I correct? Jagan.
Hi Jagan, On Wed, Mar 24, 2021 at 03:19:10PM +0530, Jagan Teki wrote: > On Wed, Mar 24, 2021 at 3:09 PM Laurent Pinchart wrote: > > On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote: > > > On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote: > > > > On 3/23/21 5:53 PM, Laurent Pinchart wrote: > > > > > On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: > > > > >> Replace of_drm_find_panel with drm_of_find_panel_or_bridge > > > > >> for finding panel, this indeed help to find the bridge if > > > > >> bridge support added. > > > > >> > > > > >> Added NULL in bridge argument, same will replace with bridge > > > > >> parameter once bridge supported. > > > > >> > > > > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > > > > > Looks good, there should be no functional change. > > > > > > > > Actually this breaks all existing users of this driver, see below. > > > > > > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > > > > > >> --- > > > > >> Changes for v4, v3: > > > > >> - none > > > > >> > > > > >> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- > > > > >> 1 file changed, 8 insertions(+), 3 deletions(-) > > > > >> > > > > >> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > >> index 4f5efcace68e..2e9e7b2d4145 100644 > > > > >> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > >> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > >> @@ -21,6 +21,7 @@ > > > > >> > > > > >> #include <drm/drm_atomic_helper.h> > > > > >> #include <drm/drm_mipi_dsi.h> > > > > >> +#include <drm/drm_of.h> > > > > >> #include <drm/drm_panel.h> > > > > >> #include <drm/drm_print.h> > > > > >> #include <drm/drm_probe_helper.h> > > > > >> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, > > > > >> struct mipi_dsi_device *device) > > > > >> { > > > > >> struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); > > > > >> - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); > > > > > > > > This is using the OF node of the DSI device, which is a direct child of > > > > the DSI host's OF node. There is no OF graph involved. > > > > > > > > >> + struct drm_panel *panel; > > > > >> + int ret; > > > > >> + > > > > >> + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, > > > > >> + &panel, NULL); > > > > > > > > However, this function expects to find the panel using OF graph. This > > > > does not work with existing device trees (PinePhone, PineTab) which do > > > > not use OF graph to connect the panel. And it cannot work, because the > > > > DSI host's binding specifies a single port: the input port from the > > > > display engine. > > > > > > Thanks for noticing this. I did understand your point and yes, I did > > > mention the updated pipeline in previous versions and forgot to add it > > > to this series. > > > > > > Here is the updated pipeline to make it work: > > > > > > https://patchwork.kernel.org/project/dri-devel/patch/20190524104252.20236-1-jagan@amarulasolutions.com/ > > > > > > Let me know your comments on this, so I will add a patch for the > > > above-affected DTS files. > > > > DT is an ABI, we need to ensure backward compatibility. Changes in > > kernel drivers can't break devices that have an old DT. > > Thanks for your point. > > So, we need to choose APIs that would compatible with the old DT and > new DT changes. Am I correct? Yes, that's correct.
On Wed, Mar 24, 2021 at 11:55:35AM +0200, Laurent Pinchart wrote: > Hi Jagan, > > On Wed, Mar 24, 2021 at 03:19:10PM +0530, Jagan Teki wrote: > > On Wed, Mar 24, 2021 at 3:09 PM Laurent Pinchart wrote: > > > On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote: > > > > On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote: > > > > > On 3/23/21 5:53 PM, Laurent Pinchart wrote: > > > > > > On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote: > > > > > >> Replace of_drm_find_panel with drm_of_find_panel_or_bridge > > > > > >> for finding panel, this indeed help to find the bridge if > > > > > >> bridge support added. > > > > > >> > > > > > >> Added NULL in bridge argument, same will replace with bridge > > > > > >> parameter once bridge supported. > > > > > >> > > > > > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > > > > > > > Looks good, there should be no functional change. > > > > > > > > > > Actually this breaks all existing users of this driver, see below. > > > > > > > > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > > > > > > > >> --- > > > > > >> Changes for v4, v3: > > > > > >> - none > > > > > >> > > > > > >> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- > > > > > >> 1 file changed, 8 insertions(+), 3 deletions(-) > > > > > >> > > > > > >> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > > >> index 4f5efcace68e..2e9e7b2d4145 100644 > > > > > >> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > > >> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > > >> @@ -21,6 +21,7 @@ > > > > > >> > > > > > >> #include <drm/drm_atomic_helper.h> > > > > > >> #include <drm/drm_mipi_dsi.h> > > > > > >> +#include <drm/drm_of.h> > > > > > >> #include <drm/drm_panel.h> > > > > > >> #include <drm/drm_print.h> > > > > > >> #include <drm/drm_probe_helper.h> > > > > > >> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, > > > > > >> struct mipi_dsi_device *device) > > > > > >> { > > > > > >> struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); > > > > > >> - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); > > > > > > > > > > This is using the OF node of the DSI device, which is a direct child of > > > > > the DSI host's OF node. There is no OF graph involved. > > > > > > > > > > >> + struct drm_panel *panel; > > > > > >> + int ret; > > > > > >> + > > > > > >> + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, > > > > > >> + &panel, NULL); > > > > > > > > > > However, this function expects to find the panel using OF graph. This > > > > > does not work with existing device trees (PinePhone, PineTab) which do > > > > > not use OF graph to connect the panel. And it cannot work, because the > > > > > DSI host's binding specifies a single port: the input port from the > > > > > display engine. > > > > > > > > Thanks for noticing this. I did understand your point and yes, I did > > > > mention the updated pipeline in previous versions and forgot to add it > > > > to this series. > > > > > > > > Here is the updated pipeline to make it work: > > > > > > > > https://patchwork.kernel.org/project/dri-devel/patch/20190524104252.20236-1-jagan@amarulasolutions.com/ > > > > > > > > Let me know your comments on this, so I will add a patch for the > > > > above-affected DTS files. > > > > > > DT is an ABI, we need to ensure backward compatibility. Changes in > > > kernel drivers can't break devices that have an old DT. > > > > Thanks for your point. > > > > So, we need to choose APIs that would compatible with the old DT and > > new DT changes. Am I correct? > > Yes, that's correct. However, I see no particular reason to change the DT binding in this case. The DSI devices are supposed to be described through a subnode of their DSI controller, that's the generic binding and except for very odd devices (and a bridge like this one is certainly not one), I see no reason to deviate from that. Maxime
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 4f5efcace68e..2e9e7b2d4145 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -21,6 +21,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_mipi_dsi.h> +#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_print.h> #include <drm/drm_probe_helper.h> @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); + struct drm_panel *panel; + int ret; + + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, + &panel, NULL); + if (ret) + return ret; - if (IS_ERR(panel)) - return PTR_ERR(panel); if (!dsi->drm || !dsi->drm->registered) return -EPROBE_DEFER;