diff options
author | Roman Stratiienko <r.stratiienko@gmail.com> | 2023-02-01 16:29:45 +0200 |
---|---|---|
committer | Roman Stratiienko <r.stratiienko@gmail.com> | 2023-02-01 16:34:10 +0200 |
commit | 5de61b5e4fbf43b78b605dab68465aa6722930c4 (patch) | |
tree | 11309343510324477485caa7cf5ecabbb2dca697 | |
parent | 152bc62dc8ec4c38ec18ff917062f29d38f25744 (diff) | |
download | drm_hwcomposer-5de61b5e4fbf43b78b605dab68465aa6722930c4.tar.gz |
drm_hwcomposer: Fix crash in headless mode
SetColorTransform() should be skipped when HwcDisplay is in
headless mode.
Fixes: 0da91bf5bb72 ("drm_hwcomposer: Add support for color transform matrix")
Reported-by: Michał Gapiński <mike@gapinski.eu>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
-rw-r--r-- | hwc2_device/HwcDisplay.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp index d335d72..efd8c14 100644 --- a/hwc2_device/HwcDisplay.cpp +++ b/hwc2_device/HwcDisplay.cpp @@ -680,6 +680,9 @@ HWC2::Error HwcDisplay::SetColorTransform(const float *matrix, int32_t hint) { color_transform_hint_ = static_cast<android_color_transform_t>(hint); + if (IsInHeadlessMode()) + return HWC2::Error::None; + if (!GetPipe().crtc->Get()->GetCtmProperty()) return HWC2::Error::None; |