1
0
Fork 0

drm_hwcomposer: Query property when checking virtual displays availability

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 the CRTCs 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".

The virtual display feature in drm-hwcomposer is experimental and
currently unused. To address test failures, modify the function
"getMaxVirtualDisplayCount" to return 0 unless the property
"vendor.vendor.hwc.drm.enable_virtual_display" is explicitly set to
true.

Signed-off-by: Paz Zcharya <pazz@google.com>
This commit is contained in:
Paz Zcharya 2024-10-26 21:11:29 +00:00
parent b6eb4b8d85
commit e11f723f56

View file

@ -19,6 +19,9 @@
#include "DrmHwc.h"
#include <cinttypes>
#include <string>
#include <android-base/properties.h>
#include "backend/Backend.h"
#include "utils/log.h"
@ -196,6 +199,15 @@ void DrmHwc::Dump(uint32_t *out_size, char *out_buffer) {
}
uint32_t DrmHwc::GetMaxVirtualDisplayCount() {
/* Virtual display is an experimental feature.
* Unless explicitly set to true, return 0 for no support.
*/
if (!base::GetBoolProperty(std::string(
"vendor.hwc.drm.enable_virtual_display"),
false)) {
return 0;
}
auto writeback_count = resource_manager_.GetWritebackConnectorsCount();
writeback_count = std::min(writeback_count, 1U);
/* Currently, only 1 virtual display is supported. Other cases need testing */