drm_hwcomposer: Fix HwcDisplay::GetDisplayIdentificationData()
Return Error::Unsupported in headless mode and if no EDID blob returned
by the kernel.
With this change GraphicsComposerHidlTest#GetDisplayIdentificationData
VTS no longer fails.
Also fix outPort assignment to avoid setting negative values
(handle_ is 0 for primary display).
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index 48e0624..3956fc9 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -799,19 +799,16 @@
uint32_t *outDataSize,
uint8_t *outData) {
if (IsInHeadlessMode()) {
- return HWC2::Error::None;
+ return HWC2::Error::Unsupported;
}
+
auto blob = GetPipe().connector->Get()->GetEdidBlob();
-
- *outPort = handle_ - 1;
-
if (!blob) {
- if (outData == nullptr) {
- *outDataSize = 0;
- }
- return HWC2::Error::None;
+ return HWC2::Error::Unsupported;
}
+ *outPort = handle_; /* TDOD(nobody): What should be here? */
+
if (outData) {
*outDataSize = std::min(*outDataSize, blob->length);
memcpy(outData, blob->data, *outDataSize);