drm_hwcomposer: Stop using HWC2 for setting layer buffer
Clean up HWC3 implementation around setting layer buffers a bit by
duping the acquire fence rather than relying on const_cast.
Set the layer buffer through LayerProperties instead of through the HWC2
SetLayerBuffer API.
Change-Id: Ifd873423d5536cdb07f4d6d868ef3a9fd641fafe
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc2_device/HwcLayer.cpp b/hwc2_device/HwcLayer.cpp
index cd2a319..cb18fdd 100644
--- a/hwc2_device/HwcLayer.cpp
+++ b/hwc2_device/HwcLayer.cpp
@@ -25,6 +25,11 @@
namespace android {
void HwcLayer::SetLayerProperties(const LayerProperties& layer_properties) {
+ if (layer_properties.buffer) {
+ layer_data_.acquire_fence = layer_properties.buffer->acquire_fence;
+ buffer_handle_ = layer_properties.buffer->buffer_handle;
+ buffer_handle_updated_ = true;
+ }
if (layer_properties.blend_mode) {
blend_mode_ = layer_properties.blend_mode.value();
}