summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_layers.cpp
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2017-06-01 19:55:39 -0400
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-19 11:37:40 -0700
commit2f71fd04488fff7fe598d441a950a8def1929020 (patch)
tree8ac42b3e089d3b8562ef5c7afb6c1e430fd3051c /sdm/libs/hwc2/hwc_layers.cpp
parent0518de7f7f6a35d72ec86d7a3997706846e15d27 (diff)
downloaddisplay-2f71fd04488fff7fe598d441a950a8def1929020.tar.gz
hwc2: Check composition type in SetLayerBuffer
SetLayerBuffer may be null if the layer is client/sideband/color Change-Id: I09e21e97c75f4e14e684a402b7d002ba98a27a3b
Diffstat (limited to 'sdm/libs/hwc2/hwc_layers.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_layers.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index 7fcd56b2..d9857cec 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -91,8 +91,13 @@ HWCLayer::~HWCLayer() {
HWC2::Error HWCLayer::SetLayerBuffer(buffer_handle_t buffer, int32_t acquire_fence) {
if (!buffer) {
- DLOGE("Invalid buffer handle: %p on layer: %d", buffer, id_);
- return HWC2::Error::BadParameter;
+ if (client_requested_ == HWC2::Composition::Device ||
+ client_requested_ == HWC2::Composition::Cursor) {
+ DLOGE("Invalid buffer handle: %p on layer: %d", buffer, id_);
+ return HWC2::Error::BadParameter;
+ } else {
+ return HWC2::Error::None;
+ }
}
if (acquire_fence == 0) {