Repository navigation
User selection of HDMI RGB/YCbCr444/YCbCr422 mode - #5249
Conversation
|
@mripard You may want to look at the first of these two patches - the swap in |
|
Patch updated to have a (default) auto mode that behaves as before, and overrides for the other modes. It also drops the requirement for 4:2:2 to be driven in 12bpc mode. The HDMI spec appears to allow 24, 30, and 36 bpc modes for 4:2:2, even though the packing on the wire is always 36bit. It certainly works (presumably stuffing the data into the MSBs), but I wonder if others agree with handling this. |
|
Is there a way to set that at runtime from userspace in a way that could avoid color format conversion in a gstreamer pipeline? The use case I have in mind would be to send input from uvc camera YUYV/YUY2 and send that to hdmi 0 output in 4:2:2 Thanks! |
This is changing the output format of the HDMI block. |
|
I can't really comment for the last one, I don't know the spec well enough. @HiassofT maybe? The two first patches look fine to me though, so I'm fine with merging this if there's no further comment on the third |
|
@mripard - thanks for the response. As per the commit text, the HDMI 2.0 spec refers to 24, 30, or 36 bit support in 4:2:2, even though on the wire 4:2:2 is always packed as 36 bits. |
|
Would there be a way to just do some kind of "pass through" without having any composition? Basically just send the data over hdmi. My use case does not need composition. |
Please don't hikack a pull request (or unrelated issue) with random requests. |
|
IMO we should leave the YCC 4:2:2 12-bit check in place. The max_bpc connector property controls output on the wire, which will always be 12 bits for Y and 12 bits for both C comonents in case of YCC 4:2:2 and we added the check to have an easy method of disabling 4:2:2 in auto mode - eg you wouldn't ever want your desktop to run in 4:2:2 or you may also want to disable YCC 4:2:2 because a TV/monitor can't really cope with it. So we chose to make 4:2:2 opt-in by requring to set max_bpc to 12 Transmitting 8 or 10bit content in 12bit 4:2:2 and padding LSBs is a different thing |
|
Auto mode will still try RGB first, so there is no way that you'll get 4:2:2 by accident, and that behaviour hasn't changed. This new DRM property is intended as an override for the odd cases where displays or capture devices only accept YCbCr 444 or 422, same as we originally had There are several places in HDMI2.0 such as:
Table 7-6 for BT 2020
So it is in the spec that bit depths other than 12 are valid in YCbCr 422, although it's fairly scant on details of how it is intended to be implemented. It was the annoyance that in order to force 422 you potentially have to also force max_bpc to 12 in the same atomic commit, otherwise the commit fails. You can't necessarily set max_bpc to 12 first in a separate commit as it wouldn't be valid for 4k60 RGB.
Things should be technically correct, not an easy way around a problem. |
|
The spec is quite clear how less than 12 bits per component have to be transmitted, LSB zero padding up to 12 bits It's a 12-bit per component mode and unless you want to change the meaning of max_bpc to mean average bits per component (resembling TMDS character rate) instead of real bits per component then allowing the 12bit 4:2:2 mode with max_bpc != 12 is wrong |
|
Ah, and setting max_bpc to 12 is fine and will work with 4kp60, too - it's only max and the max TMDS rate checks take care that 12 or 10 bit 4:4:4 modes will be rejected |
|
So is this PR good to merge or not? |
The CSC requires the coefficients to be swapped around for 4:4:4 mode, but the swap was incorrectly defined. Correct the swap. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Add a custom property "Output format" that allows the overriding of the default colourspace choice in the way that the old firmware hdmi_pixel_encoding property did. If the chosen format is not supported, then it will still drop back to the older behaviour. This won't be acceptable to upstream, but it adds back the missing functionality of hdmi_pixel_encoding. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
@HiassofT Thanks for the reference - I'd looked at that section several times and totally missed it. Let me see if I can sensibly drop the non-12bpc YUV422 patch. It's getting to the mode in 4k60 that is the niggle. I can't test that path here at home as I have no 4k monitor, so I'll drop it for now. I may come back to it later. I've also just noted that explicitly setting "Output format" still checks the EDID for whether that mode is reported as supported. That (correctly) stops me forcing 444 or 422 on the DVI monitor that I happen to have hooked up. We may want to revisit that but too. |
|
Branch updated to drop that patch. |
kernel: User selection of HDMI RGB/YCbCr444/YCbCr422 mode See: raspberrypi/linux#5249
kernel: User selection of HDMI RGB/YCbCr444/YCbCr422 mode See: raspberrypi/linux#5249
Replicates the old hdmi_pixel_encoding config.txt option.