diff options
author | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2022-05-06 11:33:56 +0300 |
---|---|---|
committer | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2022-05-09 17:53:51 +0300 |
commit | f87d808e2939a8e5cd1d0d5c580ed4de4e9a6f2a (patch) | |
tree | 57985ae80928c7d9a685939f63b3dceb06a38370 /hwc2_device | |
parent | ccaf51614ffacc853fd957a7a38d2177895534fc (diff) | |
download | drm_hwcomposer-f87d808e2939a8e5cd1d0d5c580ed4de4e9a6f2a.tar.gz |
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>
Diffstat (limited to 'hwc2_device')
-rw-r--r-- | hwc2_device/HwcDisplay.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
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 @@ HWC2::Error HwcDisplay::GetDisplayIdentificationData(uint8_t *outPort, 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; + auto blob = GetPipe().connector->Get()->GetEdidBlob(); 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); |