summaryrefslogtreecommitdiffstats
path: root/libgralloc
diff options
context:
space:
mode:
authorRaj kamal <rkamal@codeaurora.org>2014-04-01 16:52:19 +0530
committerRaj Kamal <rkamal@codeaurora.org>2014-04-15 14:15:59 +0530
commit59fea567e11f53914d32ce8b62832e5f745a42b9 (patch)
treee3851f0a624e4cb689fdf3af2f39467a6d8f91aa /libgralloc
parent4a482da220746e5c2f166e63a4d9bb8993a60d5c (diff)
downloadhardware_qcom_display-59fea567e11f53914d32ce8b62832e5f745a42b9.tar.gz
hardware_qcom_display-59fea567e11f53914d32ce8b62832e5f745a42b9.tar.bz2
hardware_qcom_display-59fea567e11f53914d32ce8b62832e5f745a42b9.zip
Display and wfd synchronization during teardown
* Provide a binder interface call for wfd module to inform display about the start/stop/pause/resume of wfd session. * This is needed for wfd-hdmi synchronization in case of v4l2 wfd solution. If hdmi is plugged in during v4l2 wfd session, display-hal waits in uevent thread for wfd teardown notification from wfd module, before going ahead with configuring external display. * For VDS WFD solution, display-hal waits in uevent thread for wfd-teardown to be signalled from the composition thread. Change-Id: I9514cb5bc7ff81de0b5dd4cdf66d8286a64ba094
Diffstat (limited to 'libgralloc')
-rw-r--r--libgralloc/gr.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libgralloc/gr.h b/libgralloc/gr.h
index d88db9d7f..fbde8c294 100644
--- a/libgralloc/gr.h
+++ b/libgralloc/gr.h
@@ -74,6 +74,7 @@ void free_buffer(private_handle_t *hnd);
class Locker {
pthread_mutex_t mutex;
+ pthread_cond_t cond;
public:
class Autolock {
Locker& locker;
@@ -81,10 +82,18 @@ class Locker {
inline Autolock(Locker& locker) : locker(locker) { locker.lock(); }
inline ~Autolock() { locker.unlock(); }
};
- inline Locker() { pthread_mutex_init(&mutex, 0); }
- inline ~Locker() { pthread_mutex_destroy(&mutex); }
+ inline Locker() {
+ pthread_mutex_init(&mutex, 0);
+ pthread_cond_init(&cond, 0);
+ }
+ inline ~Locker() {
+ pthread_mutex_destroy(&mutex);
+ pthread_cond_destroy(&cond);
+ }
inline void lock() { pthread_mutex_lock(&mutex); }
+ inline void wait() { pthread_cond_wait(&cond, &mutex); }
inline void unlock() { pthread_mutex_unlock(&mutex); }
+ inline void signal() { pthread_cond_signal(&cond); }
};