Hi Luca,

On Mon, Mar 30, 2026 at 05:47:23PM +0200, Luca Ceresoli wrote:
> Hello Liu,
> 
> On Mon Mar 30, 2026 at 5:02 AM CEST, Liu Ying wrote:

[...]

>>>>> + fixup-hdmi-connector {
>>>>> +         compatible = "hdmi-connector";
>>>>> +         label = "HDMI";
>>>>> +         type = "a";
>>>>
>>>> What if a board uses another type?
>>>
>>> For boards affected by this patch, currently the connector is created by
>>> dw_hdmi_connector_create() which hardcodes type A [0], so there would be no
>>> difference.
>>
>> Yes, that's from driver's PoV.  However, userspace may get the type
>> from /sys/firmware/devicetree/base/fixup-hdmi-connector/type and use it
>> to do something.
> 
> I'd say this is incorrect, the device tree is not an API for that. The
> connector type might be known to the driver by other means (ACPI, DP MST,
> whatever). So I think this is a non-problem.

I just feel that it's not great to report potentially wrong type to users
through the above sys node ...

> 
> If userspace needs to know the connector type, that should come from the
> ioctl (DRM_IOCTL_MODE_GETCONNECTOR perhaps).
> 
>> Maybe, that's trivial.
> 
> Not sure I got what you mean here, sorry. What are you referring to?

... with the above potentially wrong type being said, I think maybe this
drawback is not a big deal and could be ignored.  Sorry for not being
clear in my last reply.

> 
>>> OTOH how can a common module know the specific connector?
>>
>> Hmm, maybe add a module parameter or let users set the type through Kconfig
> 
> I'm afraid none of this would work for distribution kernels, where who
> configures the distribution has no idea on how many different hardware it
> will run.
> 
>> or even define an unknown type to honestly tell users that we don't know it?
> 
> This sounds like a potentially valid idea, even though I'm not fully
> convinced. Also I suspect it would be a pretty large change, and also
> adding "unknown type" in the device tree seems not compliant with the rule
> that DT describes the hardware (not the lack of info about the hardware).
> 
> But definitely it's not needed for this specific case, because:
> 
>  * with current code, every imx8mp-hdmi-tx usage adds a type-A connector [0]
>  * with this patch the correct type will be created when described in DT,
>    and type-A will be used only as a fallback when the DT is lacking
> 
> So after the patch we'd do sometimes better, never worse in this respect.

Well, kind of a bit worse since the sys node exposes a potentially wrong type.

> 
> Based on the above I'm sending v2 soon, but don't hesitate in following up
> in case I may be missing something (this topic is tricky).

Agreed, it's tricky.

> 
> [0] 
> https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L2601
> 
>>> Boards with a different connector should describe the connector in the
>>> device tree, if they need to instantiate the exact type.
> 
> I think this is the only valid solution. It's very easy to do, nothing new
> to invent.
> 
> Maybe on top of that we could add a warning when the overlay is applied,
> e.g. "imx8mp-hdmi-tx used without a connector described in device tree;
> adding a type A connector as a fallback; please add a valid description to
> your device tree".

I'd say this doesn't sound a bad idea but I hope the message is clear and
short.

> Maybe pointing to a TODO entry in the documentation.

To parameterize the HDMI connector type?  If so, I'm okay with that.

> 
> What do you think about this?
> 
> Thanks again for your careful review!

Thanks for your patches! Appreciated.

> 
> Luca
> 
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com/

-- 
Regards,
Liu Ying

Reply via email to