summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunita Nadampalli2015-01-30 10:17:17 -0600
committerSunita Nadampalli2015-01-30 10:17:17 -0600
commit74ce64ad788921b1db9d9ebee0562db57caa95e7 (patch)
tree90bf1d24cce31b071e7d3c6e8e19302dd0d1617c /memplugin_android.c
parente7cf246bec2118890021e1aeb66757f5ad894923 (diff)
downloadhardware-ti-libdce-74ce64ad788921b1db9d9ebee0562db57caa95e7.tar.gz
hardware-ti-libdce-74ce64ad788921b1db9d9ebee0562db57caa95e7.tar.xz
hardware-ti-libdce-74ce64ad788921b1db9d9ebee0562db57caa95e7.zip
libdce: Add mutex protection for dce_buf_lock/dce_buf_unlock
The dce_buf_lock and dce_buf_unlock are meant for any video buffer locking and unlocking with the GEM allocator. Currently, these methods are being called from libdce apis with ipc mutex held. In order to enable other media components to make use of these buffer lock/unlock apis, explicit ipc mutex protection is added. Change-Id: I6d63a4cdcffec62a346341ff515a7ebb03dea8c0 Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Diffstat (limited to 'memplugin_android.c')
-rw-r--r--memplugin_android.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/memplugin_android.c b/memplugin_android.c
index d2f5b35..307dc9e 100644
--- a/memplugin_android.c
+++ b/memplugin_android.c
@@ -34,7 +34,7 @@
34#include <sys/ioctl.h> 34#include <sys/ioctl.h>
35#include <sys/mman.h> 35#include <sys/mman.h>
36#include <sys/eventfd.h> 36#include <sys/eventfd.h>
37#include <fcntl.h> 37#include <pthread.h>
38 38
39#include "memplugin.h" 39#include "memplugin.h"
40#include "libdce.h" 40#include "libdce.h"
@@ -50,6 +50,7 @@
50 50
51int OmapDrm_FD = INVALID_DRM_FD; 51int OmapDrm_FD = INVALID_DRM_FD;
52struct omap_device *OmapDev = NULL; 52struct omap_device *OmapDev = NULL;
53extern pthread_mutex_t ipc_mutex;
53 54
54int memplugin_open() 55int memplugin_open()
55{ 56{
@@ -70,6 +71,10 @@ int memplugin_open()
70 return MEM_EOPEN_FAILURE; 71 return MEM_EOPEN_FAILURE;
71 } 72 }
72 73
74 pthread_mutexattr_t attr;
75 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
76 pthread_mutex_init(&ipc_mutex, &attr);
77
73 if (dce_ipc_init(IPU) != MEM_EOK) { 78 if (dce_ipc_init(IPU) != MEM_EOK) {
74 omap_device_del(OmapDev); 79 omap_device_del(OmapDev);
75 OmapDev = NULL; 80 OmapDev = NULL;