Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Damon Ding <damon.ding@rock-chips.com>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>,
	andrzej.hajda@intel.com, neil.armstrong@linaro.org,
	rfoss@kernel.org
Cc: Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se,
	jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, inki.dae@samsung.com,
	sw0312.kim@samsung.com, kyungmin.park@samsung.com,
	krzk@kernel.org, alim.akhtar@samsung.com, jingoohan1@gmail.com,
	p.zabel@pengutronix.de, hjc@rock-chips.com, heiko@sntech.de,
	andy.yan@rock-chips.com, dmitry.baryshkov@oss.qualcomm.com,
	dianders@chromium.org, m.szyprowski@samsung.com,
	jani.nikula@intel.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v9 10/15] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe()
Date: Mon, 9 Mar 2026 21:42:31 +0800	[thread overview]
Message-ID: <f755bdc8-7324-4dcc-8fc7-8d6224bc89d6@rock-chips.com> (raw)
In-Reply-To: <01983e92-dabb-47f7-ba01-988ea41641db@rock-chips.com>

Hi Luca,

On 3/9/2026 7:51 PM, Damon Ding wrote:
> Hi Luca,
> 
> On 3/3/2026 5:54 PM, Luca Ceresoli wrote:
>> Hello Damon,
>>
>> On Tue Feb 10, 2026 at 8:12 AM CET, Damon Ding wrote:
>>> Since the panel/bridge should logically be positioned behind the
>>> Analogix bridge in the display pipeline, it makes sense to handle
>>> the panel/bridge parsing on the Analogix side. Therefore, we add
>>> a new API analogix_dp_finish_probe(), which combines the panel/bridge
>>> parsing with component addition, to do it.
>>>
>>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>> Tested-by: Heiko Stuebner <heiko@sntech.de> (on rk3588)
>>
>> ...
>>
>>> @@ -1581,6 +1583,52 @@ struct drm_dp_aux *analogix_dp_get_aux(struct 
>>> analogix_dp_device *dp)
>>>   }
>>>   EXPORT_SYMBOL_GPL(analogix_dp_get_aux);
>>>
>>> +static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
>>> +{
>>> +    struct analogix_dp_device *dp = to_dp(aux);
>>> +    struct analogix_dp_plat_data *plat_data = dp->plat_data;
>>> +    int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
>>> +    int ret;
>>> +
>>> +    /*
>>> +     * If drm_of_find_panel_or_bridge() returns -ENODEV, there may 
>>> be no valid panel
>>> +     * or bridge nodes. The driver should go on for the driver-free 
>>> bridge or the DP
>>> +     * mode applications.
>>> +     */
>>> +    ret = drm_of_find_panel_or_bridge(dp->dev->of_node, port, 0,
>>> +                      &plat_data->panel, &plat_data->next_bridge);
>>> +    if (ret && ret != -ENODEV)
>>> +        return ret;
>>> +
>>> +    return component_add(dp->dev, plat_data->ops);
>>> +}
>>> +
>>> +int analogix_dp_finish_probe(struct analogix_dp_device *dp)
>>> +{
>>> +    int ret;
>>> +
>>> +    ret = devm_of_dp_aux_populate_bus(&dp->aux, 
>>> analogix_dp_aux_done_probing);
>>> +    if (ret) {
>>> +        /*
>>> +         * If devm_of_dp_aux_populate_bus() returns -ENODEV, the 
>>> done_probing() will
>>> +         * not be called because there are no EP devices. Then the 
>>> callback function
>>> +         * analogix_dp_aux_done_probing() will be called directly in 
>>> order to support
>>> +         * the other valid DT configurations.
>>> +         *
>>> +         * NOTE: The devm_of_dp_aux_populate_bus() is allowed to 
>>> return -EPROBE_DEFER.
>>
>> Uhm, if it is allowed to return -EPROBE_DEFER...
>>
>>> +         */
>>> +        if (ret != -ENODEV) {
>>> +            dev_err(dp->dev, "failed to populate aux bus\n");
>>> +            return ret;
>>> +        }
>>
>> ...then you shouldn't dev_err() when -EPROBE_DEFER is returned.
>>
>> Either use dev_err_probe() (which would also simplify your code) or check
>> for if (ret != -ENODEV && ret != -EPROBE_DEFER).
> 
> Will fix in v10.
> 
>>
>>> +
>>> +        return analogix_dp_aux_done_probing(&dp->aux);
>>> +    }
>>> +
>>> +    return 0;
>>> +}
>>> +EXPORT_SYMBOL_GPL(analogix_dp_finish_probe);
>>> +
>>>   MODULE_AUTHOR("Jingoo Han <jg1.han@samsung.com>");
>>>   MODULE_DESCRIPTION("Analogix DP Core Driver");
>>>   MODULE_LICENSE("GPL v2");
>>> diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/ 
>>> analogix_dp.h
>>> index 3428ffff24c5..bae969dec63a 100644
>>> --- a/include/drm/bridge/analogix_dp.h
>>> +++ b/include/drm/bridge/analogix_dp.h
>>> @@ -30,6 +30,7 @@ struct analogix_dp_plat_data {
>>>       struct drm_bridge *next_bridge;
>>>       struct drm_encoder *encoder;
>>>       struct drm_connector *connector;
>>> +    const struct component_ops *ops;
>>
>> Is adding a new stored field a good idea? Can it be instead passed as an
>> argument to analogix_dp_finish_probe()?
>>
>> Note I don't have a strong opinion here, just the added struct field 
>> seems
>> overkill for being used just once.
>>
> 
> I agree this is a better approach, since the &component_ops is only used 
> during probing.

Sorry for another shamefully incorrect reply!

The &dp_aux_ep_device_with_data.done_probing only supports passing the 
&drm_dp_aux parameter, meaning we can't directly pass &component_ops.

I'll also add extra context to the commit msg – similar to what I did 
for v9 patch 9/15 – so everyone understands why this change was made and 
avoids confusion.

> 
>>> @@ -49,5 +50,6 @@ int analogix_dp_stop_crc(struct drm_connector 
>>> *connector);
>>>
>>>   struct analogix_dp_plat_data *analogix_dp_aux_to_plat_data(struct 
>>> drm_dp_aux *aux);
>>>   struct drm_dp_aux *analogix_dp_get_aux(struct analogix_dp_device *dp);
>>> +int analogix_dp_finish_probe(struct analogix_dp_device *dp);
>>>
>>>   #endif /* _ANALOGIX_DP_H_ */
>>
> 

Best regards,
Damon


  reply	other threads:[~2026-03-09 13:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  7:12 [PATCH v9 00/15] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding
2026-02-10  7:12 ` [PATCH v9 01/15] drm/bridge: analogix_dp: Add &analogix_dp_plat_data.next_bridge Damon Ding
2026-02-10  7:12 ` [PATCH v9 02/15] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use Damon Ding
2026-03-03  9:42   ` Luca Ceresoli
2026-02-10  7:12 ` [PATCH v9 03/15] drm/exynos: exynos_dp: Remove &exynos_dp_device.ptn_bridge Damon Ding
2026-02-10  7:12 ` [PATCH v9 04/15] drm/exynos: exynos_dp: Remove unused &exynos_dp_device.connector Damon Ding
2026-02-10  7:12 ` [PATCH v9 05/15] drm/exynos: exynos_dp: Apply of-display-mode-bridge to parse the display-timings node Damon Ding
2026-03-03  9:42   ` Luca Ceresoli
2026-02-10  7:12 ` [PATCH v9 06/15] drm/bridge: analogix_dp: Remove redundant &analogix_dp_plat_data.skip_connector Damon Ding
2026-03-03  9:42   ` Luca Ceresoli
2026-02-10  7:12 ` [PATCH v9 07/15] drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms Damon Ding
2026-02-10  7:12 ` [PATCH v9 08/15] drm/bridge: analogix_dp: Remove unused &analogix_dp_plat_data.get_modes() Damon Ding
2026-03-03  9:42   ` Luca Ceresoli
2026-02-10  7:12 ` [PATCH v9 09/15] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Damon Ding
2026-03-03  9:42   ` Luca Ceresoli
2026-03-09 11:25     ` Damon Ding
2026-03-09 13:34       ` Damon Ding
2026-02-10  7:12 ` [PATCH v9 10/15] drm/bridge: analogix_dp: Add new API analogix_dp_finish_probe() Damon Ding
2026-03-03  9:54   ` Luca Ceresoli
2026-03-09 11:51     ` Damon Ding
2026-03-09 13:42       ` Damon Ding [this message]
2026-02-10  7:12 ` [PATCH v9 11/15] drm/rockchip: analogix_dp: Apply analogix_dp_finish_probe() Damon Ding
2026-02-10  7:12 ` [PATCH v9 12/15] drm/exynos: exynos_dp: " Damon Ding
2026-02-10  7:12 ` [PATCH v9 13/15] drm/bridge: analogix_dp: Attach the next bridge in analogix_dp_bridge_attach() Damon Ding
2026-02-10  9:10 ` [PATCH v9 14/15] drm/bridge: analogix_dp: Remove bridge disabing and panel unpreparing in analogix_dp_unbind() Damon Ding
2026-02-10  9:10   ` [PATCH v9 15/15] drm/bridge: analogix_dp: Apply panel_bridge helper Damon Ding
2026-02-26  6:54 ` [PATCH v9 00/15] Apply drm_bridge_connector and panel_bridge helper for the Analogix DP driver Damon Ding

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=f755bdc8-7324-4dcc-8fc7-8d6224bc89d6@rock-chips.com \
    --to=damon.ding@rock-chips.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=imx@lists.linux.dev \
    --cc=inki.dae@samsung.com \
    --cc=jani.nikula@intel.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jingoohan1@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=m.szyprowski@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rfoss@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=sw0312.kim@samsung.com \
    --cc=tzimmermann@suse.de \
    /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