From 431dc083a9569625413fc7cea13d299772fd29e5 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Tue, 2 Oct 2012 05:16:27 -0700 Subject: [PATCH] Revert "hwc: Support VSYNC notification via sysfs" This reverts commit 0d47bc4df5de25b8232a3c297a96d8def5e206af. I suppose we'll use CAF's version. --- libhwcomposer/hwc_uevents.cpp | 38 ----------------------------------- 1 file changed, 38 deletions(-) diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp index 931b8d6..dc94eac 100644 --- a/libhwcomposer/hwc_uevents.cpp +++ b/libhwcomposer/hwc_uevents.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include "hwc_utils.h" #include "hwc_external.h" @@ -103,48 +102,11 @@ static void *uevent_loop(void *param) return NULL; } -static void *vsync_loop(void *param) -{ - static char buf[4096]; - int fb0_vsync_fd; - fd_set exceptfds; - int res; - int64_t timestamp = 0; - hwc_context_t * ctx = reinterpret_cast(param); - hwc_procs* proc = (hwc_procs*)ctx->device.reserved_proc[0]; - - fb0_vsync_fd = open("/sys/devices/virtual/graphics/fb0/vsync_time", O_RDONLY); - if (!fb0_vsync_fd) - return NULL; - - char thread_name[64] = "hwcVsyncThread"; - prctl(PR_SET_NAME, (unsigned long) &thread_name, 0, 0, 0); - setpriority(PRIO_PROCESS, 0, -20); - memset(buf, 0, sizeof(buf)); - - ALOGI("Using sysfs mechanism for VSYNC notification"); - - FD_ZERO(&exceptfds); - FD_SET(fb0_vsync_fd, &exceptfds); - - do { - ssize_t len = read(fb0_vsync_fd, buf, sizeof(buf)); - timestamp = strtoull(buf, NULL, 0); - proc->vsync(proc, 0, timestamp); - select(fb0_vsync_fd + 1, NULL, NULL, &exceptfds, NULL); - lseek(fb0_vsync_fd, 0, SEEK_SET); - } while (1); - - return NULL; -} - void init_uevent_thread(hwc_context_t* ctx) { pthread_t uevent_thread; - pthread_t vsync_thread; ALOGI("Initializing UEvent Listener Thread"); pthread_create(&uevent_thread, NULL, uevent_loop, (void*) ctx); - pthread_create(&vsync_thread, NULL, vsync_loop, (void*) ctx); } }; //namespace