summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c3
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h7
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c19
4 files changed, 29 insertions, 2 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
index e757caf34e26..f17ae3f6a778 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -405,7 +405,7 @@ gckKERNEL_Construct(
gcmkONERROR(gckKERNEL_SecurityOpen(kernel, kernel->core, &kernel->securityChannel));
#endif
/* Construct a video memory mutex. */
- gcmkONERROR(gckOS_CreateMutex(Os, &kernel->vidmemMutex));
+ gcmkONERROR(gckOS_GetVideoMemoryMutex(Os, &kernel->vidmemMutex));
/* Return pointer to the gckKERNEL object. */
*Kernel = kernel;
@@ -633,7 +633,6 @@ gckKERNEL_Destroy(
#if gcdSECURITY
gcmkVERIFY_OK(gckKERNEL_SecurityClose(Kernel->securityChannel));
#endif
- gcmkVERIFY_OK(gckOS_DeleteMutex(Kernel->os, Kernel->vidmemMutex));
/* Mark the gckKERNEL object as unknown. */
Kernel->object.type = gcvOBJ_UNKNOWN;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
index 02d00140f81e..b4743b3e27f5 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
@@ -1560,6 +1560,13 @@ gckOS_StopTimer(
IN gctPOINTER Timer
);
+/* Get the global video memory mutex. */
+gceSTATUS
+gckOS_GetVideoMemoryMutex(
+ IN gckOS Os,
+ OUT gctPOINTER *Mutex
+ );
+
/******************************************************************************\
********************************* gckHEAP Object ********************************
\******************************************************************************/
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
index 88fbf7da5f2c..1dc29a3f7a6d 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
@@ -222,6 +222,8 @@ struct _gckOS
/* External clock states. */
gctBOOL clockStates[gcdMAX_GPU_COUNT];
+
+ gctPOINTER vidmemMutex;
};
typedef struct _gcsSIGNAL * gcsSIGNAL_PTR;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index 9184e9bbd43a..89fe678f89c8 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -917,6 +917,9 @@ gckOS_Construct(
gckOS_ImportAllocators(os);
+ /* Construct a video memory mutex. */
+ gcmkONERROR(gckOS_CreateMutex(os, &os->vidmemMutex));
+
/* Return pointer to the gckOS object. */
*Os = os;
@@ -1029,6 +1032,9 @@ gckOS_Destroy(
/* Destroy debug lock mutex. */
gcmkVERIFY_OK(gckOS_DeleteMutex(Os, Os->debugLock));
+ /* Destroy video memory mutex. */
+ gcmkVERIFY_OK(gckOS_DeleteMutex(Os, Os->vidmemMutex));
+
/* Wait for all works done. */
flush_workqueue(Os->workqueue);
@@ -9035,3 +9041,16 @@ gckOS_GPUPhysicalToCPUPhysical(
return gcvSTATUS_OK;
}
+gceSTATUS
+gckOS_GetVideoMemoryMutex(
+ IN gckOS Os,
+ OUT gctPOINTER *Mutex
+ )
+{
+ gcmkHEADER_ARG("Mutex=x%X", Mutex);
+
+ *Mutex = Os->vidmemMutex;
+
+ gcmkFOOTER_NO();
+ return gcvSTATUS_OK;
+}