summaryrefslogtreecommitdiff
path: root/libhwc
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-06-10 10:19:10 -0700
committerDan Stoza <stoza@google.com>2014-06-10 10:19:10 -0700
commit4f738c9717abda68a4d93157d978cb631d494a2f (patch)
treebf8f1dc6fc30b4ed573a66b0be0a8a8be9f59f9f /libhwc
parentfcf4e7ff4cd85d69f92ee554c8140545094918cc (diff)
downloadexynos5-4f738c9717abda68a4d93157d978cb631d494a2f.tar.gz
HWComposer: Fix an fd leak on boot with HDMI
When the device is booting with an attached external display, every frame leaks a file descriptor until the display manager enables the external display, resulting in hundreds of leaked descriptors. This plugs the leak. Change-Id: Ib7e2af3638dab28c2ed04c02ddf9c485edf2bb9d
Diffstat (limited to 'libhwc')
-rw-r--r--libhwc/hwc.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libhwc/hwc.cpp b/libhwc/hwc.cpp
index 546b047..94e8c59 100644
--- a/libhwc/hwc.cpp
+++ b/libhwc/hwc.cpp
@@ -1616,6 +1616,10 @@ static int exynos5_set_hdmi(exynos5_hwc_composer_device_1_t *pdev,
contents->retireFenceFd = merged;
}
} else {
+ if (layer.acquireFenceFd >= 0) {
+ close(layer.acquireFenceFd);
+ layer.acquireFenceFd = -1;
+ }
hdmi_hide_layer(pdev, pdev->hdmi_layers[1]);
}
}