The meaning of this flag may not be obvious at first sight.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
include/drm/bridge/dw_hdmi.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index 336f062e1f9d..45f6ba1a8ee1 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -126,6 +126,11 @@ struct dw_hdmi_phy_ops {
struct dw_hdmi_plat_data {
struct regmap *regm;
+ /*
+ * The HDMI output port number (which must be 1) if it is described
+ * in the device tree. 0 if the device tree does not describe the
+ * next component (legacy mode).
+ */
unsigned int output_port;
unsigned long input_bus_encoding;
--
2.53.0
Hi Luca,
On Fri, Mar 20, 2026 at 11:46:15AM +0100, Luca Ceresoli wrote:
> The meaning of this flag may not be obvious at first sight.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
> include/drm/bridge/dw_hdmi.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> index 336f062e1f9d..45f6ba1a8ee1 100644
> --- a/include/drm/bridge/dw_hdmi.h
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -126,6 +126,11 @@ struct dw_hdmi_phy_ops {
> struct dw_hdmi_plat_data {
> struct regmap *regm;
>
> + /*
> + * The HDMI output port number (which must be 1) if it is described
I'd rephrase:
The HDMI output port number must be 1 ...
> + * in the device tree. 0 if the device tree does not describe the
> + * next component (legacy mode).
Maybe be a bit more specific about "legacy mode":
legacy mode without DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge
?
Reviewed-by: Liu Ying <victor.liu@nxp.com>
> + */
> unsigned int output_port;
>
> unsigned long input_bus_encoding;
>
--
Regards,
Liu Ying
On 3/26/2026 3:25 PM, Liu Ying wrote:
> Hi Luca,
>
> On Fri, Mar 20, 2026 at 11:46:15AM +0100, Luca Ceresoli wrote:
>> The meaning of this flag may not be obvious at first sight.
>>
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>> ---
>> include/drm/bridge/dw_hdmi.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
First of all, these changes related to the DW HDMI controller work well
when tested on RK3399 HDMI.
>> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
>> index 336f062e1f9d..45f6ba1a8ee1 100644
>> --- a/include/drm/bridge/dw_hdmi.h
>> +++ b/include/drm/bridge/dw_hdmi.h
>> @@ -126,6 +126,11 @@ struct dw_hdmi_phy_ops {
>> struct dw_hdmi_plat_data {
>> struct regmap *regm;
>>
>> + /*
>> + * The HDMI output port number (which must be 1) if it is described
>
> I'd rephrase:
> The HDMI output port number must be 1 ...
>
Yes, the output port number should be 1, but I found that the output
port number in the Rockchip-side dw-hdmi driver remains 0.
Therefore, it may be better to adapt the dw-hdmi drivers across all
platforms to the bridge-connector architecture simultaneously.
This would allow removing &dw_hdmi_plat_data.output_port and unify the
setting of DRM_BRIDGE_ATTACH_NO_CONNECTOR during the attach stage.
(Just as the Analogix DP driver does [0])
[0]
https://lore.kernel.org/all/20260319071452.1961274-1-damon.ding@rock-chips.com/
>> + * in the device tree. 0 if the device tree does not describe the
>> + * next component (legacy mode).
>
> Maybe be a bit more specific about "legacy mode":
> legacy mode without DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge
> ?
>
> Reviewed-by: Liu Ying <victor.liu@nxp.com>
>
>> + */
>> unsigned int output_port;
>>
>> unsigned long input_bus_encoding;
>>
>
Best regards,
Damon
Hello Damon,
On Thu Mar 26, 2026 at 10:15 AM CET, Damon Ding wrote:
> On 3/26/2026 3:25 PM, Liu Ying wrote:
>> Hi Luca,
>>
>> On Fri, Mar 20, 2026 at 11:46:15AM +0100, Luca Ceresoli wrote:
>>> The meaning of this flag may not be obvious at first sight.
>>>
>>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>>> ---
>>> include/drm/bridge/dw_hdmi.h | 5 +++++
>>> 1 file changed, 5 insertions(+)
>>>
>
> First of all, these changes related to the DW HDMI controller work well
> when tested on RK3399 HDMI.
Great!
You'd be welcome to send your Tested-by: tag if you tested the series on
hardware, that would be useful.
However at this point I suggest to wait for v2, which I'm sending soon, and
test that. I added you in Cc for it.
>>> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
>>> index 336f062e1f9d..45f6ba1a8ee1 100644
>>> --- a/include/drm/bridge/dw_hdmi.h
>>> +++ b/include/drm/bridge/dw_hdmi.h
>>> @@ -126,6 +126,11 @@ struct dw_hdmi_phy_ops {
>>> struct dw_hdmi_plat_data {
>>> struct regmap *regm;
>>>
>>> + /*
>>> + * The HDMI output port number (which must be 1) if it is described
>>
>> I'd rephrase:
>> The HDMI output port number must be 1 ...
>>
>
> Yes, the output port number should be 1, but I found that the output
> port number in the Rockchip-side dw-hdmi driver remains 0.
Really? I checked all the bindings in
Documentation/devicetree/bindings/display/rockchip/*hdmi* and all mention
port@1 as the output port number. Can you point to code using port@0 as the
output port?
Should it be true, that would be unfortunate because the output_port
variable does not handle this case. It's used as a sort of bool-or-int
variable:
* as a bool [0] to find out whether the DT is supposed to describe the
output port
* as an integer to tell the port number to parse in DT [1]
So saying "please parse port 0" is impossible.
[0] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3310
[1] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3315
> Therefore, it may be better to adapt the dw-hdmi drivers across all
> platforms to the bridge-connector architecture simultaneously.
>
> This would allow removing &dw_hdmi_plat_data.output_port and unify the
> setting of DRM_BRIDGE_ATTACH_NO_CONNECTOR during the attach stage.
> (Just as the Analogix DP driver does [0])
>
> [0]
> https://lore.kernel.org/all/20260319071452.1961274-1-damon.ding@rock-chips.com/
I agree converting all users is a good goal, but I disagree it should be
done simultaneously. There are various users of dw-hdmi, and converting one
having the hardware to test it was painful enough for me. Converting all of
them without testing on hardware would be a hell.
However I might be wrong. Having a precise list of all users, which ones
need to be converted, and whether they have any special detail to be taken
care of would be good to estimate the work to convert all users. Without
that I'd rather let users convert one by one and hopefully get rid of
legacy code eventually.
Best regards,
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
On 3/27/2026 7:10 PM, Luca Ceresoli wrote:
> Hello Damon,
>
> On Thu Mar 26, 2026 at 10:15 AM CET, Damon Ding wrote:
>> On 3/26/2026 3:25 PM, Liu Ying wrote:
>>> Hi Luca,
>>>
>>> On Fri, Mar 20, 2026 at 11:46:15AM +0100, Luca Ceresoli wrote:
>>>> The meaning of this flag may not be obvious at first sight.
>>>>
>>>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>>>> ---
>>>> include/drm/bridge/dw_hdmi.h | 5 +++++
>>>> 1 file changed, 5 insertions(+)
>>>>
>>
>> First of all, these changes related to the DW HDMI controller work well
>> when tested on RK3399 HDMI.
>
> Great!
>
> You'd be welcome to send your Tested-by: tag if you tested the series on
> hardware, that would be useful.
>
> However at this point I suggest to wait for v2, which I'm sending soon, and
> test that. I added you in Cc for it.
>
>>>> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
>>>> index 336f062e1f9d..45f6ba1a8ee1 100644
>>>> --- a/include/drm/bridge/dw_hdmi.h
>>>> +++ b/include/drm/bridge/dw_hdmi.h
>>>> @@ -126,6 +126,11 @@ struct dw_hdmi_phy_ops {
>>>> struct dw_hdmi_plat_data {
>>>> struct regmap *regm;
>>>>
>>>> + /*
>>>> + * The HDMI output port number (which must be 1) if it is described
>>>
>>> I'd rephrase:
>>> The HDMI output port number must be 1 ...
>>>
>>
>> Yes, the output port number should be 1, but I found that the output
>> port number in the Rockchip-side dw-hdmi driver remains 0.
>
> Really? I checked all the bindings in
> Documentation/devicetree/bindings/display/rockchip/*hdmi* and all mention
> port@1 as the output port number. Can you point to code using port@0 as the
> output port?
>
> Should it be true, that would be unfortunate because the output_port
> variable does not handle this case. It's used as a sort of bool-or-int
> variable:
>
> * as a bool [0] to find out whether the DT is supposed to describe the
> output port
> * as an integer to tell the port number to parse in DT [1]
>
> So saying "please parse port 0" is impossible.
>
> [0] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3310
> [1] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3315
>
Aha, my description might be a little misleading. The
&dw_hdmi_plat_data.output_port is 0 on the Rockchip side, so the next
bridge will not be parsed for it.
Then I think the &dw_hdmi_plat_data.output_port should be 1, as this
helps support the hdmi-connector and other bridge chips.
>> Therefore, it may be better to adapt the dw-hdmi drivers across all
>> platforms to the bridge-connector architecture simultaneously.
>>
>> This would allow removing &dw_hdmi_plat_data.output_port and unify the
>> setting of DRM_BRIDGE_ATTACH_NO_CONNECTOR during the attach stage.
>> (Just as the Analogix DP driver does [0])
>>
>> [0]
>> https://lore.kernel.org/all/20260319071452.1961274-1-damon.ding@rock-chips.com/
>
> I agree converting all users is a good goal, but I disagree it should be
> done simultaneously. There are various users of dw-hdmi, and converting one
> having the hardware to test it was painful enough for me. Converting all of
> them without testing on hardware would be a hell.
>
> However I might be wrong. Having a precise list of all users, which ones
> need to be converted, and whether they have any special detail to be taken
> care of would be good to estimate the work to convert all users. Without
> that I'd rather let users convert one by one and hopefully get rid of
> legacy code eventually.
>
Yes, I've noticed that there are quite a few drivers associated with the
DW HDMI controller. It would be a better idea to let users handle this
themselves.
BTW: The Rockchip side dw-hdmi patches for bridge connector support will
be updated as a follow-up to your patch series. :-)
Best regards,
Damon
Hello Damon,
On Mon Mar 30, 2026 at 3:13 AM CEST, Damon Ding wrote:
>>>>> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
>>>>> index 336f062e1f9d..45f6ba1a8ee1 100644
>>>>> --- a/include/drm/bridge/dw_hdmi.h
>>>>> +++ b/include/drm/bridge/dw_hdmi.h
>>>>> @@ -126,6 +126,11 @@ struct dw_hdmi_phy_ops {
>>>>> struct dw_hdmi_plat_data {
>>>>> struct regmap *regm;
>>>>>
>>>>> + /*
>>>>> + * The HDMI output port number (which must be 1) if it is described
>>>>
>>>> I'd rephrase:
>>>> The HDMI output port number must be 1 ...
>>>>
>>>
>>> Yes, the output port number should be 1, but I found that the output
>>> port number in the Rockchip-side dw-hdmi driver remains 0.
>>
>> Really? I checked all the bindings in
>> Documentation/devicetree/bindings/display/rockchip/*hdmi* and all mention
>> port@1 as the output port number. Can you point to code using port@0 as the
>> output port?
>>
>> Should it be true, that would be unfortunate because the output_port
>> variable does not handle this case. It's used as a sort of bool-or-int
>> variable:
>>
>> * as a bool [0] to find out whether the DT is supposed to describe the
>> output port
>> * as an integer to tell the port number to parse in DT [1]
>>
>> So saying "please parse port 0" is impossible.
>>
>> [0] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3310
>> [1] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3315
>>
>
> Aha, my description might be a little misleading. The
> &dw_hdmi_plat_data.output_port is 0 on the Rockchip side, so the next
> bridge will not be parsed for it.
>
> Then I think the &dw_hdmi_plat_data.output_port should be 1, as this
> helps support the hdmi-connector and other bridge chips.
Ah, OK, that's all clear now.
> BTW: The Rockchip side dw-hdmi patches for bridge connector support will
> be updated as a follow-up to your patch series. :-)
Great! Don't forget to Cc me.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
© 2016 - 2026 Red Hat, Inc.