display: Dynamic debug logging via binder

Provides a way to enable/disable logs at runtime via binder.
The logs need to be enabled from a priviliged shell.

For example,
$ adb shell service call display.qservice 15 i32 0 i32 1

Here 15 is the integer code for DYNAMIC_DEBUG in IQService.h
The first parameter 0 is for DEBUG_ALL
The second parameter 1 is to enable.

Hence, this command enables all debug logs.

Another example - this command enables vsync logging
$ adb shell service call display.qservice 15 i32 2 i32 1

Change-Id: I13d5f397d9d03f0ac6a14d3a3c9098ed59fc62fd
diff --git a/libhwcomposer/hwc_vsync.cpp b/libhwcomposer/hwc_vsync.cpp
index ca93ad2..47f2229 100644
--- a/libhwcomposer/hwc_vsync.cpp
+++ b/libhwcomposer/hwc_vsync.cpp
@@ -40,7 +40,6 @@
 #define PANEL_ON_STR "panel_power_on ="
 #define ARRAY_LENGTH(array) (sizeof((array))/sizeof((array)[0]))
 const int MAX_DATA = 64;
-bool logvsync = false;
 
 int hwc_vsync_control(hwc_context_t* ctx, int dpy, int enable)
 {
@@ -63,7 +62,7 @@
         timestamp = strtoull(data + strlen("VSYNC="), NULL, 0);
     }
     // send timestamp to SurfaceFlinger
-    ALOGD_IF (logvsync, "%s: timestamp %"PRIu64" sent to SF for dpy=%d",
+    ALOGD_IF (ctx->vstate.debug, "%s: timestamp %"PRIu64" sent to SF for dpy=%d",
             __FUNCTION__, timestamp, dpy);
     ctx->proc->vsync(ctx->proc, dpy, timestamp);
 }
@@ -110,11 +109,6 @@
             ctx->vstate.fakevsync = true;
     }
 
-    if(property_get("debug.hwc.logvsync", property, 0) > 0) {
-        if(atoi(property) == 1)
-            logvsync = true;
-    }
-
     char node_path[MAX_SYSFS_FILE_PATH];
 
     for (int dpy = HWC_DISPLAY_PRIMARY; dpy < num_displays; dpy++) {