From: Marek Vasut <marex@denx.de>
To: Jagan Teki <jagan@amarulasolutions.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
Inki Dae <inki.dae@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Frieder Schrempf <frieder.schrempf@kontron.de>,
Tim Harvey <tharvey@gateworks.com>,
Adam Ford <aford173@gmail.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Maxime Ripard <maxime@cerno.tech>,
Matteo Lisi <matteo.lisi@engicam.com>,
dri-devel@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
NXP Linux Team <linux-imx@nxp.com>,
linux-amarula <linux-amarula@amarulasolutions.com>
Subject: Re: [PATCH v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper
Date: Mon, 27 Feb 2023 20:41:22 +0100 [thread overview]
Message-ID: <47b8ad7d-cfc1-112c-2117-cb3612c1bba5@denx.de> (raw)
In-Reply-To: <CAMty3ZDjwD+3SKJiOgZLbYYTtq=udWkXbqnsyYaM73rsYxDumQ@mail.gmail.com>
On 2/27/23 20:34, Jagan Teki wrote:
> On Tue, Feb 28, 2023 at 12:54 AM Marek Vasut <marex@denx.de> wrote:
>>
>> On 2/27/23 20:15, Jagan Teki wrote:
>>> On Tue, Feb 28, 2023 at 12:38 AM Marek Vasut <marex@denx.de> wrote:
>>>>
>>>> On 2/27/23 20:01, Jagan Teki wrote:
>>>>> On Tue, Feb 28, 2023 at 12:25 AM Marek Vasut <marex@denx.de> wrote:
>>>>>>
>>>>>> On 2/27/23 12:39, Jagan Teki wrote:
>>>>>>> drm_of_dsi_find_panel_or_bridge is capable of looking up the
>>>>>>> downstream DSI bridge and panel and trying to add a panel bridge
>>>>>>> if the panel is found.
>>>>>>>
>>>>>>> Replace explicit finding calls with drm_of_dsi_find_panel_or_bridge
>>>>>>> followed with drmm_panel_bridge_add.
>>>>>>>
>>>>>>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>>>>>>> ---
>>>>>>> Changes for v13, v12, v11:
>>>>>>> - none
>>>>>>> Changes for v10:
>>>>>>> - new patch
>>>>>>>
>>>>>>> drivers/gpu/drm/exynos/exynos_drm_dsi.c | 25 +++++++++++++------------
>>>>>>> 1 file changed, 13 insertions(+), 12 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>>>>>> index df15501b1075..12a6dd987e8f 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_of.h>
>>>>>>> #include <drm/drm_panel.h>
>>>>>>> #include <drm/drm_print.h>
>>>>>>> #include <drm/drm_probe_helper.h>
>>>>>>> @@ -1470,24 +1471,26 @@ 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_bridge *bridge;
>>>>>>> struct drm_panel *panel;
>>>>>>> int ret;
>>>>>>>
>>>>>>> - 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);
>>>>>>> - }
>>>>>>
>>>>>> As far as I understand this from my conversation with Maxime (please put
>>>>>> him on CC of V15), the change here should instead perform the panel look
>>>>>> up NOT in exynos_dsi_host_attach() , but in exynos_dsi_bind() , i.e. in
>>>>>> the component_ops .bind callback . Here is an example of correct
>>>>>> implementation:
>>>>>>
>>>>>> https://cgit.freedesktop.org/drm-misc/tree/drivers/gpu/drm/vc4/vc4_dsi.c#n1805
>>>>>
>>>>> But, we don't have component_ops.bind for imx8m case, so where do we
>>>>> want to place the panel hook?
>>>>>
>>>>> Exynos drm drivers are component-based but, imx8mm is not.
>>>>
>>>> In 14/18 patch, the same should be added to generic_dsim_register_host()
>>>> , which is called from the driver .probe() callback, but that is OK.
>>>>
>>>> That's ^ is the iMX part.
>>>
>>> Ohh. You mean, we need to find the panel hook separately in two places like
>>> - bind for exynos
>>> - probe for imx8mm
>>
>> Yes
>>
>>> If so? how can I find the drm_device pointer in the probe?
>>
>> What for ? The panel lookup uses OF graph . Where do you need the
>> drm_device in it ?
>
> May I can summarize the whole setback here so that everybody is on the
> same page and find the proper solution?
>
> The key blocker is accessing the DRM pointer in order to use the
> DRM-managed action helper.
>
> 1. If we find the panel hook in Exynos component_ops.bind then we can
> use the DRM pointer directly as VC4 does.
> 2. if we find the panel hook in Samsung drm_bridge_funcs.attach (for
> imx8mm) then we can use the DRM pointer directly via bridge->dev.
>
> If we make 2) has common across like finding the panel hook in
> drm_bridge_funcs.attach the Exynos drm pipeline cannot find the
> panels.
>
> The common solution for both exynos and imx8m is host.attach but if we
> do so we cannot get find the DRM pointer.
There isn't going to be common solution, you would really have to do the
look up in component_ops .bind callback for exynos , and
generic_dsim_register_host() for i.MX .
> If we go ahead with no need for DRM-managed helper at the moment, then
> find the panel hook in host.attach and then drop 2/18.
The panel lookup must happen in .bind/.probe for exynos/imx respectively
, that's really all that is required here. Then you can drop 1,2,3/18
and get this series applied (I hope) .
Can you implement just this one change ?
There is no need to use drmm_* helper for now, that can be improved
later if possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-02-27 19:42 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 11:39 [PATCH v13 00/18] drm: Add Samsung MIPI DSIM bridge Jagan Teki
2023-02-27 11:39 ` [PATCH v13 01/18] drm: of: Lookup if child node has DSI panel or bridge Jagan Teki
2023-02-27 11:39 ` [PATCH v13 02/18] drm: bridge: panel: Support nodrm case for drmm_panel_bridge_add Jagan Teki
2023-02-27 12:11 ` Maxime Ripard
2023-02-27 12:28 ` Jagan Teki
2023-02-27 17:14 ` Maxime Ripard
2023-02-27 13:39 ` Jagan Teki
2023-02-27 11:39 ` [PATCH v13 03/18] drm: exynos: dsi: Drop explicit call to bridge detach Jagan Teki
2023-02-27 11:39 ` [PATCH v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper Jagan Teki
2023-02-27 18:55 ` Marek Vasut
2023-02-27 19:01 ` Jagan Teki
2023-02-27 19:08 ` Marek Vasut
2023-02-27 19:15 ` Jagan Teki
2023-02-27 19:24 ` Marek Vasut
2023-02-27 19:34 ` Jagan Teki
2023-02-27 19:41 ` Marek Vasut [this message]
2023-02-27 19:49 ` Jagan Teki
2023-02-27 19:52 ` Jagan Teki
2023-02-27 20:10 ` Marek Vasut
2023-02-27 20:38 ` Jagan Teki
2023-02-28 12:04 ` Maxime Ripard
2023-02-28 14:39 ` Jagan Teki
2023-02-28 14:56 ` Maxime Ripard
2023-02-28 15:09 ` Jagan Teki
2023-02-28 12:10 ` Maxime Ripard
2023-02-28 12:34 ` Jagan Teki
2023-02-28 14:35 ` Maxime Ripard
2023-02-28 14:50 ` Jagan Teki
2023-02-27 11:39 ` [PATCH v13 05/18] drm: exynos: dsi: Mark PHY as optional Jagan Teki
2023-02-27 11:39 ` [PATCH v13 06/18] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Jagan Teki
2023-02-27 11:39 ` [PATCH v13 07/18] drm: exynos: dsi: Introduce hw_type platform data Jagan Teki
2023-02-27 11:39 ` [PATCH v13 08/18] drm: exynos: dsi: Handle proper host initialization Jagan Teki
2023-02-27 11:39 ` [PATCH v13 09/18] drm: exynos: dsi: Add atomic check Jagan Teki
2023-02-27 11:39 ` [PATCH v13 10/18] drm: exynos: dsi: Add input_bus_flags Jagan Teki
2023-02-27 11:39 ` [PATCH v13 11/18] drm: exynos: dsi: Add atomic_get_input_bus_fmts Jagan Teki
2023-02-27 14:12 ` Marek Vasut
2023-02-27 11:39 ` [PATCH v13 12/18] drm: exynos: dsi: Consolidate component and bridge Jagan Teki
2023-02-27 14:08 ` Marek Vasut
2023-02-27 11:39 ` [PATCH v13 13/18] drm: exynos: dsi: Add host helper for te_irq_handler Jagan Teki
2023-02-27 14:10 ` Marek Vasut
2023-02-27 11:39 ` [PATCH v13 15/18] dt-bindings: display: exynos: dsim: Add NXP i.MX8M Mini/Nano support Jagan Teki
2023-02-27 11:39 ` [PATCH v13 16/18] drm: bridge: samsung-dsim: Add " Jagan Teki
2023-02-27 11:39 ` [PATCH v13 17/18] dt-bindings: display: exynos: dsim: Add NXP i.MX8M Plus support Jagan Teki
2023-02-27 11:39 ` [PATCH v13 18/18] drm: bridge: samsung-dsim: Add " Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47b8ad7d-cfc1-112c-2117-cb3612c1bba5@denx.de \
--to=marex@denx.de \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=aford173@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=frieder.schrempf@kontron.de \
--cc=inki.dae@samsung.com \
--cc=jagan@amarulasolutions.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=matteo.lisi@engicam.com \
--cc=maxime@cerno.tech \
--cc=sw0312.kim@samsung.com \
--cc=tharvey@gateworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).