aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2014-05-13 11:02:09 -0400
committerXianzhong <b07117@freescale.com>2014-05-21 11:26:53 -0400
commit0bcfcbdcac7baa8e759fd64889ac45c00f4c5471 (patch)
tree3757d979e685c36e1e13cd8b6eb9006476e56852
parent1693ec27912b56f77c10108fd84af3a2713a8cc6 (diff)
ENGR00312563-2 [#1183] remove duplicated mutex protection
counterMutex is not necessary after refine dabase mutex remove counterMutex to avoid duplicated mutex protection Date: May 15, 2014 Signed-off-by: Xianzhong <b07117@freescale.com> Acked-by: Jason Liu
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h1
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c6
3 files changed, 0 insertions, 9 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 0fc52e79a3df..396e8e68f127 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -533,13 +533,11 @@ gckKERNEL_Destroy(
533 { 533 {
534 databaseNext = database->next; 534 databaseNext = database->next;
535 535
536 gcmkVERIFY_OK(gckOS_DeleteMutex(Kernel->os, database->counterMutex));
537 gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Kernel->os, database)); 536 gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Kernel->os, database));
538 } 537 }
539 538
540 if (Kernel->db->lastDatabase != gcvNULL) 539 if (Kernel->db->lastDatabase != gcvNULL)
541 { 540 {
542 gcmkVERIFY_OK(gckOS_DeleteMutex(Kernel->os, Kernel->db->lastDatabase->counterMutex));
543 gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Kernel->os, Kernel->db->lastDatabase)); 541 gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Kernel->os, Kernel->db->lastDatabase));
544 } 542 }
545 543
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
index 18ed7ffbd4f8..bf35bfe11794 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
@@ -211,7 +211,6 @@ typedef struct _gcsDATABASE
211 gcsDATABASE_COUNTERS vidMemType[gcvSURF_NUM_TYPES]; 211 gcsDATABASE_COUNTERS vidMemType[gcvSURF_NUM_TYPES];
212 /* Counter for each video memory pool. */ 212 /* Counter for each video memory pool. */
213 gcsDATABASE_COUNTERS vidMemPool[gcvPOOL_NUMBER_OF_POOLS]; 213 gcsDATABASE_COUNTERS vidMemPool[gcvPOOL_NUMBER_OF_POOLS];
214 gctPOINTER counterMutex;
215 214
216 /* Idle time management. */ 215 /* Idle time management. */
217 gctUINT64 lastIdle; 216 gctUINT64 lastIdle;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
index 7a68ced4fb71..84f20c2f529e 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
@@ -101,8 +101,6 @@ gckKERNEL_NewDatabase(
101 gckOS_ZeroMemory(pointer, gcmSIZEOF(gcsDATABASE)); 101 gckOS_ZeroMemory(pointer, gcmSIZEOF(gcsDATABASE));
102 102
103 database = pointer; 103 database = pointer;
104
105 gcmkONERROR(gckOS_CreateMutex(Kernel->os, &database->counterMutex));
106 } 104 }
107 105
108 /* Insert the database into the hash. */ 106 /* Insert the database into the hash. */
@@ -1018,8 +1016,6 @@ gckKERNEL_RemoveProcessDB(
1018 gcmkONERROR( 1016 gcmkONERROR(
1019 gckKERNEL_DeleteRecord(Kernel, database, Type, Pointer, &bytes)); 1017 gckKERNEL_DeleteRecord(Kernel, database, Type, Pointer, &bytes));
1020 1018
1021 gcmkVERIFY_OK(gckOS_AcquireMutex(Kernel->os, database->counterMutex, gcvINFINITE));
1022
1023 /* Update counters. */ 1019 /* Update counters. */
1024 switch (Type) 1020 switch (Type)
1025 { 1021 {
@@ -1049,8 +1045,6 @@ gckKERNEL_RemoveProcessDB(
1049 break; 1045 break;
1050 } 1046 }
1051 1047
1052 gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, database->counterMutex));
1053
1054 /* Release the database mutex. */ 1048 /* Release the database mutex. */
1055 gcmkONERROR(gckOS_ReleaseMutex(Kernel->os, Kernel->db->dbMutex)); 1049 gcmkONERROR(gckOS_ReleaseMutex(Kernel->os, Kernel->db->dbMutex));
1056 1050