diff options
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 80 |
1 files changed, 78 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 e8563b771ff1..88535488b916 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -1181,10 +1181,37 @@ gckKERNEL_Dispatch( if (node->VidMem.memory->object.type == gcvOBJ_VIDMEM) { bytes = node->VidMem.bytes; + + gcmkONERROR( + gckKERNEL_AddProcessDB(Kernel, + processID, gcvDB_VIDEO_MEMORY_RESERVED, + node, + gcvNULL, + bytes)); } else { bytes = node->Virtual.bytes; + + if(node->Virtual.contiguous) + { + gcmkONERROR( + gckKERNEL_AddProcessDB(Kernel, + processID, gcvDB_VIDEO_MEMORY_CONTIGUOUS, + node, + gcvNULL, + bytes)); + } + else + { + gcmkONERROR( + gckKERNEL_AddProcessDB(Kernel, + processID, gcvDB_VIDEO_MEMORY_VIRTUAL, + node, + gcvNULL, + bytes)); + } + } gcmkONERROR( @@ -1221,6 +1248,28 @@ gckKERNEL_Dispatch( processID, gcvDB_VIDEO_MEMORY, node)); + if (node->VidMem.memory->object.type == gcvOBJ_VIDMEM) + { + gcmkONERROR( + gckKERNEL_RemoveProcessDB(Kernel, + processID, gcvDB_VIDEO_MEMORY_RESERVED, + node)); + } + else if(node->Virtual.contiguous) + { + gcmkONERROR( + gckKERNEL_RemoveProcessDB(Kernel, + processID, gcvDB_VIDEO_MEMORY_CONTIGUOUS, + node)); + } + else + { + gcmkONERROR( + gckKERNEL_RemoveProcessDB(Kernel, + processID, gcvDB_VIDEO_MEMORY_VIRTUAL, + node)); + } + break; case gcvHAL_LOCK_VIDEO_MEMORY: @@ -1467,12 +1516,12 @@ gckKERNEL_Dispatch( if (hardware) { /* This signal is bound to a hardware, - ** so the timeout is limited by gcdGPU_TIMEOUT. + ** so the timeout is limited by Kernel->timeOut. */ timer += gcdGPU_ADVANCETIMER; } - if (timer >= gcdGPU_TIMEOUT) + if (timer >= Kernel->timeOut) { gcmkONERROR( gckOS_Broadcast(Kernel->os, @@ -1898,6 +1947,33 @@ gckKERNEL_Dispatch( &Interface->u.Database.gpuIdle)); break; + case gcvHAL_VIDMEM_DATABASE: + /* Query reserved video memory. */ + gcmkONERROR( + gckKERNEL_QueryProcessDB(Kernel, + Interface->u.VidMemDatabase.processID, + !Interface->u.VidMemDatabase.validProcessID, + gcvDB_VIDEO_MEMORY_RESERVED, + &Interface->u.VidMemDatabase.vidMemResv)); + + /* Query contiguous video memory. */ + gcmkONERROR( + gckKERNEL_QueryProcessDB(Kernel, + Interface->u.VidMemDatabase.processID, + !Interface->u.VidMemDatabase.validProcessID, + gcvDB_VIDEO_MEMORY_CONTIGUOUS, + &Interface->u.VidMemDatabase.vidMemCont)); + + /* Query virtual video memory. */ + gcmkONERROR( + gckKERNEL_QueryProcessDB(Kernel, + Interface->u.VidMemDatabase.processID, + !Interface->u.VidMemDatabase.validProcessID, + gcvDB_VIDEO_MEMORY_VIRTUAL, + &Interface->u.VidMemDatabase.vidMemVirt)); + + break; + case gcvHAL_VERSION: Interface->u.Version.major = gcvVERSION_MAJOR; Interface->u.Version.minor = gcvVERSION_MINOR; |