I can get the following properties from drmModeObjectGetProperties for DRM_MODE_OBJECT_CRTC :
name : MODE_ID value 0x0
name : ACTIVE value 0x0
name : HDR_SUPPORTED value 0x0
name : HDR_METADATA_SMPTE_2086_ID value 0x0
name : OUTPUT_FORMAT value 0x0
name : OutputColorRange value 0x0
name : CTM value 0x0|
Can I set OUTPUT_FORMAT to "YUV422 ? If yes what value would I need to pass to drmModeObjectSetProperty( ?
drmModeSetCrtc has no parameter do that (set hdmi to yuv422), it is used to set the mode & resolution. In NvDrmRenderer.cpp the HDR_METADATA_SMPTE_2086_ID property is set using drmModeObjectSetProperty. Since these are custom properties to the driver (drm-nvdc) . I’m asking can I set OUTPUT_FORMAT and if yes what values are supported because I can’t find any doc for this.
The existing implementation is HDR video playback. So if your usecase is different, you would need to create NvBuffer in NvBufferColorFormat_NV12_10LE_2020, create the plane in DRM_FORMAT_TEGRA_P010_2020 through drmModeAddFB2(), and put data into the NvBuffers. This is the verified case in L4T releases.
Thanks for the reply DRM_FORMAT_TEGRA_P010_2020 would be for YUV422 10bit, what if we want YUV422 8bit what value for the plane? From my diagnostics I can see the HDMI output frames are RGB444 and following the code, I can see that in coreboot it is hard coded to default to RGB as the HDMI colorspace. When the kernel boots it picks up RGB from the bootloader and uses that as the default hence why the HDMI output is RGB444. So by changing the plane you think I can change the HDIM output format to YUV422?
See in tegrabl_hdmi.c (coreboot), the hdmi avi info frame is defaulted to RGB
/* TODO: Support ycc format */
avi->rgb_ycc = HDMI_AVI_RGB;
See tegra_hdmi_get_rgb_ycc in kernel/nvidia/drivers/video/tegra/dc/hdmi_2.0.c where if the bootloader initialised hdmi then we take the value from the SOR.
Thanks for the update, I understand I can output YUV422 10 bit. My source is YUV422 8 bit and I want to render it to HDIM as YUV422 8 bit not 10 bit, the reason I’m asking is because the TRM it states (see below) the HDMI interface supports this mode.
I can the set DRM_FORMAT_YUV422 or DRM_FORMAT_UYVY for NVBuffer however I see the HDMI output is still RGB instead of YUV422, My monitor supports both RGB444 and YUV422 8bit and I want the hdmi output to be YUV422 8 bit not 10 bit.
In post you mention converting to NvBufferColorFormat_NV12_10LE_2020 which works for YV422 10 bit. As per my reply . I wanted YUV422 8 bit so I tried DRM_FORMAT_YUV422 & DRM_FORMAT_UYVY and the output is still RGB not YUV422.
So another question:
If this can’t be done programmatic ally, then how I can set the output to YUV422 8 bit as the EDID from the monitor is supports both RGB-4444 and YUV422 8 bit format. If I look at the kernel code for sor.c there is support for setting the correct pixel depths based on FB_VMODE_XXX flags. Furthermore hdmi2.0.c also has code to set the AVI frameinfo based on FB_VMODE_XXX flags. I guess this wouldn’t be implemented if it can’t be used?
I would have been happy with that answer however as I stated in the kernel code there is code to support FB_VMODE_Y422 & FB_VMODE_Y24 which equates to NV_SOR_STATE1_ASY_PIXELDEPTH_BPP_16_422. So the SOR can be configured to output the correct format to feed the display interface. Can I suggest you refer this question to the kernel team as they should be able better answer the question? In fact the link you provided doesn’t indicate it doesn’t support YUV422 8 bit as there no mention of supporting RGB-444.