diff options
author | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2022-05-30 13:41:20 +0300 |
---|---|---|
committer | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2022-05-30 13:48:52 +0300 |
commit | 5070d51aa0b52566cb9c224a931f10274d9be16a (patch) | |
tree | 5e147b57b9ad6442c80a230661aa8fc01ac8c159 | |
parent | a32f907c9dddc4d064b0bff7c68dddb910ad3812 (diff) | |
download | drm_hwcomposer-5070d51aa0b52566cb9c224a931f10274d9be16a.tar.gz |
drm_hwcomposer: Don't try to import client layer in headless mode
Pipeline is null in the headless mode, therefore any attempt to
import the buffer causes a null-pointer dereference crash.
Fixes: 4b2cc484f9af ("drm_hwcomposer: Reorganize struct DrmHwcLayer")
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
-rw-r--r-- | hwc2_device/HwcDisplay.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp index 76e2745..9a31ac8 100644 --- a/hwc2_device/HwcDisplay.cpp +++ b/hwc2_device/HwcDisplay.cpp @@ -606,6 +606,10 @@ HWC2::Error HwcDisplay::SetClientTarget(buffer_handle_t target, return HWC2::Error::None; } + if (IsInHeadlessMode()) { + return HWC2::Error::None; + } + client_layer_.PopulateLayerData(/*test = */ true); if (!client_layer_.IsLayerUsableAsDevice()) { ALOGE("Client layer must be always usable by DRM/KMS"); |