How to determine the max number of NV12 overlays at the same time?
Hi,
According to this document [1], there’s a limitation of the number of NV12 hardware plane overlays at the same time on Intel GPUs (2 for recent products).
I need to determine this limitation (max NV12 overlays simultaneously) in application code via libdrm for some multi-video cases but it seems I cannot get this directly via existing APIs in libdrm.
I will appreciate it if anyone here knows the answers of:
- Is there a way using current libdrm APIs to query this information?
- Is there similar limitations on other platforms like AMD/Nvidia? And how to get it?
After checking the document and kernel code, I come up with a way but I’m not sure if it’s correct.
Based on the facts below:
- According to document [1], display pipeline will use 2 planes (Y and UV separately) to handle YUV 420 hybrid planar formats (NV12, P0xx).
- According to document [1] and kernel commit message [2], each plane supports either Y or UV.
- According to the kernel code, the planes that support NV12 read from DRM is actually the UV planes [3] and the kernel will return errors if it cannot assign a Y plane for it [4].
The actually limitation (max_nv12_planes) is actually the smaller one between number of UV planes (can be read directly via NV12 formats) and Y planes (total planes each pipe – UV planes).
Am I understanding correctly? Or any better ways to do so?
Thanks a lot!
Refs:
[1] https://cdrdv2-public.intel.com/705833/intel-gfx-prm-osrc-tgl-vol-12-display-engine.pdf, Page 282, 286
[2] https://patchwork.freedesktop.org/patch/315494/
[4] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/i915/display/intel_display.c#L4118