summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-08-21 12:13:34 -0700
committerJesse Hall <jessehall@google.com>2012-08-22 15:46:07 -0700
commit3a96e09f206327fb5fd64d3fdc7ba3a315421082 (patch)
treee0ee8b4332b9fa2d413e4e5491ac17c0d45b5f07
parent6ce89d3c3ec5d07a21bd1fc33f6ff61d67acbe95 (diff)
downloadhardware_ti_omap4xxx-3a96e09f206327fb5fd64d3fdc7ba3a315421082.zip
hardware_ti_omap4xxx-3a96e09f206327fb5fd64d3fdc7ba3a315421082.tar.gz
hardware_ti_omap4xxx-3a96e09f206327fb5fd64d3fdc7ba3a315421082.tar.bz2
Update for cleanups in hwc interface
Change-Id: I7851cd5ca7cd826b3b4b35e6df90ce1e2a9f4327
-rw-r--r--hwc/hwc.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 07c63a2..25085b7 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -1525,7 +1525,7 @@ static int omap4_hwc_set(struct hwc_composer_device_1 *dev,
err_out:
pthread_mutex_unlock(&hwc_dev->lock);
- if (invalidate && hwc_dev->procs && hwc_dev->procs->invalidate)
+ if (invalidate)
hwc_dev->procs->invalidate(hwc_dev->procs);
return err;
@@ -1786,8 +1786,11 @@ static void handle_hotplug(omap4_hwc_device_t *hwc_dev)
pthread_mutex_unlock(&hwc_dev->lock);
- if (hwc_dev->procs && hwc_dev->procs->invalidate)
- hwc_dev->procs->invalidate(hwc_dev->procs);
+ /* hwc_dev->procs is set right after the device is opened, but there is
+ * still a race condition where a hotplug event might occur after the open
+ * but before the procs are registered. */
+ if (hwc_dev->procs)
+ hwc_dev->procs->invalidate(hwc_dev->procs);
}
static void handle_uevents(omap4_hwc_device_t *hwc_dev, const char *buff, int len)
@@ -1823,9 +1826,8 @@ static void handle_uevents(omap4_hwc_device_t *hwc_dev, const char *buff, int le
}
if (vsync) {
- if (hwc_dev->procs && hwc_dev->procs->vsync) {
+ if (hwc_dev->procs)
hwc_dev->procs->vsync(hwc_dev->procs, 0, timestamp);
- }
} else {
if (dock)
hwc_dev->ext.force_dock = state == 1;
@@ -1862,7 +1864,7 @@ static void *omap4_hwc_hdmi_thread(void *data)
if (err == 0) {
if (hwc_dev->idle) {
- if (hwc_dev->procs && hwc_dev->procs->invalidate) {
+ if (hwc_dev->procs) {
pthread_mutex_lock(&hwc_dev->lock);
invalidate = !hwc_dev->force_sgx && hwc_dev->ovls_blending;
if (invalidate) {
@@ -1954,18 +1956,13 @@ static int omap4_hwc_event_control(struct hwc_composer_device_1* dev,
}
}
-static int omap4_blank(struct hwc_composer_device_1 *dev, int dpy, int blank)
+static int omap4_hwc_blank(struct hwc_composer_device_1 *dev, int dpy, int blank)
{
// We're using an older method of screen blanking based on
// early_suspend in the kernel. No need to do anything here.
return 0;
}
-struct hwc_methods_1 omap4_hwc_methods = {
- .eventControl = &omap4_hwc_event_control,
- .blank = &omap4_blank,
-};
-
static int omap4_hwc_device_open(const hw_module_t* module, const char* name,
hw_device_t** device)
{
@@ -2001,10 +1998,11 @@ static int omap4_hwc_device_open(const hw_module_t* module, const char* name,
hwc_dev->base.common.close = omap4_hwc_device_close;
hwc_dev->base.prepare = omap4_hwc_prepare;
hwc_dev->base.set = omap4_hwc_set;
- hwc_dev->base.dump = omap4_hwc_dump;
- hwc_dev->base.registerProcs = omap4_hwc_registerProcs;
+ hwc_dev->base.eventControl = omap4_hwc_event_control;
+ hwc_dev->base.blank = omap4_hwc_blank;
hwc_dev->base.query = omap4_hwc_query;
- hwc_dev->base.methods = &omap4_hwc_methods;
+ hwc_dev->base.registerProcs = omap4_hwc_registerProcs;
+ hwc_dev->base.dump = omap4_hwc_dump;
hwc_dev->fb_dev = hwc_mod->fb_dev;
*device = &hwc_dev->base.common;