From: Benoit Goby Date: Fri, 31 Aug 2012 00:17:34 +0000 (-0700) Subject: hwc: Disable hdmi on blank X-Git-Tag: cm-10.1-M1~191^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad4e3589e43660981c09755f0535c393e31cef35;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git hwc: Disable hdmi on blank Change-Id: Ida919c7097c8a4f1aae11e05f6cbbcaa3ffbbfd6 --- diff --git a/libhwc/hwc.cpp b/libhwc/hwc.cpp index b5f12fb..d860be8 100644 --- a/libhwc/hwc.cpp +++ b/libhwc/hwc.cpp @@ -112,6 +112,7 @@ struct exynos5_hwc_composer_device_1_t { int hdmi_layer1; bool hdmi_hpd; bool hdmi_enabled; + bool hdmi_blanked; void *hdmi_gsc; int hdmi_w; int hdmi_h; @@ -539,6 +540,9 @@ static int hdmi_enable(struct exynos5_hwc_composer_device_1_t *dev) if (dev->hdmi_enabled) return 0; + if (dev->hdmi_blanked) + return 0; + dev->hdmi_gsc = exynos_gsc_create_exclusive(3, GSC_OUTPUT_MODE, GSC_OUT_TV); if (!dev->hdmi_gsc) { ALOGE("%s: exynos_gsc_create_exclusive failed", __func__); @@ -560,8 +564,8 @@ static void hdmi_disable(struct exynos5_hwc_composer_device_1_t *dev) { if (!dev->hdmi_enabled) return; - hdmi_stop_background(dev); exynos_gsc_destroy(dev->hdmi_gsc); + hdmi_stop_background(dev); dev->hdmi_gsc = NULL; dev->hdmi_enabled = false; } @@ -1472,6 +1476,12 @@ static int exynos5_blank(struct hwc_composer_device_1 *dev, int dpy, int blank) return -errno; } + if (pdev->hdmi_hpd) { + if (blank && !pdev->hdmi_blanked) + hdmi_disable(pdev); + pdev->hdmi_blanked = !!blank; + } + return 0; }