libhwcomposer: Handle HDMI disconnect event

- Inform the gralloc of the HDMI status.
- If the HDMI is disconnected, close the overlay and also inform the
gralloc that video mirroring has stopped.

Change-Id: Ie89ffe860c0f9c9142d6c7f5d7a6c555884561ce
CRs-fixed: 286954
This commit is contained in:
Naomi Luis 2011-05-19 13:53:49 -07:00 committed by Govind Surti
parent d71c65326e
commit 7c3d92ed0b

View File

@ -124,9 +124,25 @@ static void dump_layer(hwc_layer_t const* l) {
static void hwc_enableHDMIOutput(hwc_composer_device_t *dev, bool enable) {
hwc_context_t* ctx = (hwc_context_t*)(dev);
private_hwc_module_t* hwcModule = reinterpret_cast<private_hwc_module_t*>(
dev->common.module);
framebuffer_device_t *fbDev = hwcModule->fbDevice;
if (fbDev) {
fbDev->enableHDMIOutput(fbDev, enable);
}
if(ctx && ctx->mOverlayLibObject) {
overlay::Overlay *ovLibObject = ctx->mOverlayLibObject;
ovLibObject->setHDMIStatus(enable);
if (!enable) {
// Close the overlay channels if HDMI is disconnected
ovLibObject->closeChannel();
// Inform the gralloc that video mirroring is stopped
framebuffer_device_t *fbDev = hwcModule->fbDevice;
if (fbDev)
fbDev->videoOverlayStarted(fbDev, false);
}
}
}