summaryrefslogtreecommitdiff
path: root/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
diff options
context:
space:
mode:
authorShawn Xiao <b49994@freescale.com>2015-06-12 13:08:42 +0800
committerShawn Xiao <b49994@freescale.com>2015-06-12 13:14:49 +0800
commit6eefa0c21fd6b2ce9058ab53d375430ba13673d7 (patch)
tree7b4684dc2ffabb6030b0a440d45e39de03463e6e /drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
parent6d5f951e94237c818576f4bcc6577d833f151804 (diff)
MGS-532 [#1630] P13 driver meet "AXI BUS ERROR" on GC2000rel_imx_3.10.17_1.0.3_patch
When run Antutu benchmark several times continuously, it will show "AXI BUS ERROR". The root cause is When unlock a surface, driver must flush its GPU cache. Otherwise, GPU may write out the cache after GPU address is freed, which will cause MMU Exception or AXI bus error. Even if GPU address isn't freed, data in cache may pollute memory after memory is used by another surface. The solution is Before an event is written to command buffer, driver checks the group of records linked to this event to find out which kinds of cache need to flush. This method doesn't care whether the record is from user side or kernel. And driver generates only one flush for a group of records. Date: Jun 11, 2015 Signed-off-by: Meng Mingming <b51843@freescale.com>
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c')
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c16
1 files changed, 11 insertions, 5 deletions
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 6a0f8e0e2856..69bbc1cf7295 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
@@ -1122,6 +1122,7 @@ gckKERNEL_DestroyProcessDB(
gcuVIDMEM_NODE_PTR node;
gckKERNEL kernel = Kernel;
gctUINT32 i;
+ gceSURF_TYPE type;
gctBOOL acquired = gcvFALSE;
gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID);
@@ -1265,6 +1266,11 @@ gckKERNEL_DestroyProcessDB(
case gcvDB_VIDEO_MEMORY_LOCKED:
node = gcmUINT64_TO_PTR(record->data);
+
+ type = (node->VidMem.memory->object.type == gcvOBJ_VIDMEM)
+ ? node->VidMem.type
+ : node->Virtual.type;
+
/* Unlock what we still locked */
status = gckVIDMEM_Unlock(record->kernel,
node,
@@ -1273,11 +1279,11 @@ gckKERNEL_DestroyProcessDB(
if (gcmIS_SUCCESS(status) && (gcvTRUE == asynchronous))
{
- /* TODO: we maybe need to schedule a event here */
- status = gckVIDMEM_Unlock(record->kernel,
- node,
- gcvSURF_TYPE_UNKNOWN,
- gcvNULL);
+
+ status = gckEVENT_Unlock(record->kernel->eventObj,
+ gcvKERNEL_PIXEL,
+ node,
+ type);
}
gcmkTRACE_ZONE(gcvLEVEL_WARNING, gcvZONE_DATABASE,