OSDN Git Service

Do not dup the acquire fence from surfaceflinger
authorZhongmin Wu <zhongmin.wu@intel.com>
Wed, 5 Jul 2017 08:50:54 +0000 (16:50 +0800)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Mon, 25 Sep 2017 03:59:23 +0000 (20:59 -0700)
such fence is already dupped by SurfaceFlinger.
We can use it directly, otherwise it will cause
"fd leak" of SurfaceFlinger.

Jira: None.
Test: No fd leaks with latest Mesa upstream.
Signed-off-by: Zhongmin Wu <zhongmin.wu@intel.com>
os/android/iahwc2.cpp

index bfc4137..f83d6e0 100644 (file)
@@ -794,7 +794,7 @@ HWC2::Error IAHWC2::Hwc2Layer::SetLayerBuffer(buffer_handle_t buffer,
   native_handle_.handle_ = buffer;
   hwc_layer_.SetNativeHandle(&native_handle_);
   if (acquire_fence > 0)
-    hwc_layer_.SetAcquireFence(dup(acquire_fence));
+    hwc_layer_.SetAcquireFence(acquire_fence);
   return HWC2::Error::None;
 }