Skip to content

[v2] Report virtual display count based on available pipelines

The current implementation of "getMaxVirtualDisplayCount" function relies on the number of writeback connectors, but doesn't consider the availability of CRTCs. Since CRTCs can only be bound to a single pipeline, even though there are available writeback connectors, we might fail to create a virtual pipeline if they are being used.

This leads to failures in the "CreateVirtualDisplay" and "SetOutputBuffer" VTS tests because the tests expect the creation of a virtual pipeline to work based on the positive value returned by "getMaxVirtualDisplayCount".

Fix that by introducing a new method, "GetAvailableVirtualPipelinesCount", that accurately counts the number of available virtual pipelines. For each drm device, it iterates over all unbound CRTCs and writeback connectors and counts them. Then, update "DrmHwc::GetMaxVirtualDisplayCount" function to use this method, ensuring that the reported virtual display count reflects the actual available virtual pipelines.

Changes from v1 (!275 (closed)):

  • Roman mentioned that the previous logic didn't guarantee that a virtual display could be created. For example, a case of 2 DRM cards, one with a free CRTC and a second with a write-back connector. I changed the logic to accommodate that.
Edited by Paz Zcharya

Merge request reports

Loading