summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGowtham Tammana <g-tammana@ti.com>2016-01-08 16:50:40 -0600
committerGowtham Tammana <g-tammana@ti.com>2016-03-08 13:58:48 -0600
commit3d2c0b063bd06f79dd4d2416e429df9fa4b2cc6c (patch)
treedf61df667b580ac2d6197c01820b4656641acd72
parent8c4a1832fd3211bee5c27398f24d9793e0393bfa (diff)
downloaddra7xx-3d2c0b063bd06f79dd4d2416e429df9fa4b2cc6c.tar.gz
hwc: check for poll revents in hwc_vsync_thread
On returning from poll call, drmHandleEvent should be called if there is data to be read on drm fd. Change-Id: Icb5e7dc31ae2c40e6a137206180c838ccbe62721 Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rw-r--r--hwcomposer/hwc.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/hwcomposer/hwc.c b/hwcomposer/hwc.c
index b84ebcb..a5df41e 100644
--- a/hwcomposer/hwc.c
+++ b/hwcomposer/hwc.c
@@ -691,25 +691,21 @@ static void *hwc_hdmi_thread(void *data)
}
/*
- * Vsync polling thread
+ * DRM event polling thread
* We poll for drm events in this thread. drm events can be vblank and/or
* page-flip events both occuring on Vsync.
+ *
+ * vsync_thread is a misnomer here, but we will keep it for legacy reasons.
*/
static void *hwc_vsync_thread(void *data)
{
omap_hwc_device_t *hwc_dev = data;
- static char uevent_desc[4096];
- struct pollfd fds[2];
- int invalidate = 0;
- int timeout;
- int err, i;
setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY);
struct pollfd pfds[1] = {{
.fd = hwc_dev->drm_fd,
- .events = POLLIN,
- .revents = POLLERR
+ .events = POLLIN
}};
while (1) {
@@ -721,17 +717,12 @@ static void *hwc_vsync_thread(void *data)
ALOGI ("Event handler timeout");
continue;
}
- for (i = 0; i < ret; i++) {
- if (pfds[i].fd == hwc_dev->drm_fd) {
- // ALOGE("Received event on DRMFD!!!!");
- drmHandleEvent (hwc_dev->drm_fd,
- &(hwc_dev->displays[HWC_DISPLAY_PRIMARY]->disp_link.evctx));
- }
+ if (pfds[0].revents & POLLIN) {
+ drmHandleEvent (hwc_dev->drm_fd,
+ &(hwc_dev->displays[HWC_DISPLAY_PRIMARY]->disp_link.evctx));
}
}
-
return NULL;
-
}
static void hwc_registerProcs(struct hwc_composer_device_1* dev,