hwc: add system property to force gpu composition
authorGreg Hackmann <ghackmann@google.com>
Tue, 18 Sep 2012 00:47:09 +0000 (17:47 -0700)
committerGreg Hackmann <ghackmann@google.com>
Tue, 18 Sep 2012 21:57:49 +0000 (14:57 -0700)
Change-Id: I7cbe01109675d373ec6e55439020f0f926a9e5a9
Signed-off-by: Greg Hackmann <ghackmann@google.com>
libhwc/hwc.cpp

index 8c7cdc52969c91ac30ea4b38a17f19bf6c572d7c..b0c0171a01de9c323692a76f0e1e25090380f40f 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <cutils/compiler.h>
 #include <cutils/log.h>
+#include <cutils/properties.h>
 #include <hardware/gralloc.h>
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer.h>
@@ -95,6 +96,7 @@ struct exynos5_hwc_composer_device_1_t {
     alloc_device_t          *alloc_device;
     const hwc_procs_t       *procs;
     pthread_t               vsync_thread;
+    int                     force_gpu;
 
     int32_t                 xres;
     int32_t                 yres;
@@ -742,6 +744,7 @@ static int exynos5_prepare_fimd(exynos5_hwc_composer_device_1_t *pdev,
 
     memset(pdev->bufs.gsc_map, 0, sizeof(pdev->bufs.gsc_map));
 
+    force_fb = force_fb || pdev->force_gpu;
     for (size_t i = 0; i < NUM_HW_WINDOWS; i++)
         pdev->bufs.overlay_map[i] = -1;
 
@@ -1781,6 +1784,10 @@ static int exynos5_open(const struct hw_module_t *module, const char *name,
         goto err_vsync;
     }
 
+    char value[PROPERTY_VALUE_MAX];
+    property_get("debug.hwc.force_gpu", value, "0");
+    dev->force_gpu = atoi(value);
+
     return 0;
 
 err_vsync: