meson: Enabling full-range HDMI output

neil.armstrong at linaro.org neil.armstrong at linaro.org
Wed Oct 23 05:55:39 PDT 2024


On 23/10/2024 14:12, Francisco Ayala Le Brun wrote:
> Thank you for your response. I can confirm reverting the commit solves
> the issue. However, it only leaves me more confused as to the root
> cause.
> 
> If dw-hdmi is set to output RGB, and you set the CSC matrix to zeroes,
> then it will show a correctly completely black output. However, if you
> set the first column of the YUV-to-RGB matrix to ones, and show a
> black image via DRM, then the tone is in the limited range. This
> seemed to indicate dw-hdmi can output full range RGB, and the problem
> was farther upstream.
> 
> Perhaps the problem is the CSC matrices? I was under the assumption
> 0x2000 corresponded to 1, even though i.MX6 manual chapter 33 seems to
> suggest with a csc_scale of 1, then 0x800 would correspond to 1.
> Still, I would expect at least fully black to be correct as that would
> give a multiplication by zero.
> 
> Or the state of dw_hdmi is affecting the VIU in some way? Perhaps the
> VIU hardware is made to clamp luminance when dw_hdmi is outputting
> RGB? I noticed for the CSC there is only a special matrix for
> RGB-to-limited-RGB, but no special matrix for YUV-to-limited-RGB. That
> seems to suggest the clamping may be done upstream in those cases.


No the dw-hdmi setup doesn't affect VIU, the VIU output is configured
in meson_encoder_hdmi in the VPU_HDMI_FMT_CTRL register, it's only
affected if the YUV420 HDMNI output is selected.

I think it's a problem in the CSC configuration.

The dwc_hdmi_tx databoook has somehow leaked on internet, and you
can have a look at the Color Space Converter registers section to
understand how the matrix works.

Neil

> 
> Francisco
> 
> 
> On Wed, Oct 23, 2024 at 8:30 AM <neil.armstrong at linaro.org> wrote:
>>
>> Hi,
>>
>> On 23/10/2024 10:00, Francisco Ayala Le Brun wrote:
>>> Hello,
>>>
>>> I am seeking some guidance regarding enabling full-range HDMI output.
>>> Specifically, I am wondering which component in the video pipeline
>>> could be clamping HDMI output values to 16-235? Further details
>>> follow:
>>>
>>> I have been trying to get full-range HDMI output from a Le Potato
>>> s905x SBC. At the moment, HDMI output seems to be hard-coded to color
>>> quantization limited range (16-235). This greatly diminishes the
>>> contrast in full range displays.
>>>
>>> So far setting the VIU_OSD1/2_FULL_RANGE bit in the
>>> VIU_OSD1/2_CTRL_STAT2 register does not seem to work. I have also
>>> looked at the color space conversion matrix in dw_hdmi in case that is
>>> the culprit, but the values seem fine and setting that to zero does
>>> produce a signal in the full range (0). The buffer from the VIU is
>>> using a YUV format so dw_hdmi is not using the full to limited range
>>> conversion matrix.
>>
>> Indeed the internal VPU pipeline is in 10bit YUV444, so it requires enabling
>> the dw-hdmi CSC, so perhaps those are not designed to output full-range RGB ?
>>
>> Could you revert:
>> d3d6b1bf85ae drm: bridge: dw_hdmi: fix preference of RGB modes over YUV420
>>
>> This would give you direct YUV444 HDMI output without CSC involved, reverting
>> is not an options because of low-cost HDMI panels lying in their EDID
>> and not really supporting YUV HDMI...
>>
>> So if the original YUV is in full range, the culprit is in the DW-HDMI CSC
>> table.
>>
>> Neil
>>
>>>
>>> Thank you in advance,
>>> Francisco
>>>
>>> _______________________________________________
>>> linux-amlogic mailing list
>>> linux-amlogic at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-amlogic
>>
>>
>> _______________________________________________
>> linux-amlogic mailing list
>> linux-amlogic at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-amlogic




More information about the linux-amlogic mailing list