exynos5 hwc: add blank operation
authorColin Cross <ccross@android.com>
Fri, 13 Jul 2012 00:54:17 +0000 (17:54 -0700)
committerColin Cross <ccross@android.com>
Mon, 16 Jul 2012 23:01:11 +0000 (16:01 -0700)
Add a blank operation that will trigger the framebuffer blanking ioctl
when surfaceflinger blanks or unblanks the screen.

Change-Id: I4451317d882523ffaac39d107cfb5b5cad8b1bfa

libhwc/hwc.cpp

index 691219e34e8d19ea3a50dc48161611b767c43acd..c61e42158880fa40ab940157f375c85b164e48de 100644 (file)
@@ -665,8 +665,24 @@ static void *hwc_vsync_thread(void *data)
        return NULL;
 }
 
+static int exynos5_blank(struct hwc_composer_device_1 *dev, int blank)
+{
+    struct exynos5_hwc_composer_device_1_t *pdev =
+            (struct exynos5_hwc_composer_device_1_t *)dev;
+
+    int fb_blank = blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK;
+    int err = ioctl(pdev->fd, FBIOBLANK, fb_blank);
+    if (err < 0) {
+        ALOGE("%sblank ioctl failed", blank ? "" : "un");
+        return -errno;
+    }
+
+    return 0;
+}
+
 struct hwc_methods_1 exynos5_methods = {
        eventControl: exynos5_eventControl,
+    blank: exynos5_blank,
 };
 
 static int exynos5_close(hw_device_t* device);