diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2012-04-01 16:49:30 +0800 |
---|---|---|
committer | Richard Zhao <richard.zhao@freescale.com> | 2012-04-01 16:53:05 +0800 |
commit | a28b353858a810b4c1689a88dc2d5f3b439608ed (patch) | |
tree | 922e2fbe2172cb209f36724649704b48a6dbfdfa /drivers | |
parent | 55bfb40d3209f0d871fc8681d0c0677b9f9ca458 (diff) |
ENGR00178642-1 gpu-viv: fix suspend/resume issue for #304
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Lily Zhang
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c | 84 | ||||
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 2 |
2 files changed, 50 insertions, 36 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c index 572c72819974..e341b6e25ae3 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c @@ -1156,6 +1156,40 @@ gckCOMMAND_Commit( + Command->reservedTail - commandBufferObject->startOffset; + /* Get the current offset. */ + offset = Command->offset; + + /* Compute number of bytes left in current kernel command queue. */ + bytes = Command->pageSize - offset; + + /* Query the size of WAIT/LINK command sequence. */ + gcmkONERROR(gckHARDWARE_WaitLink( + hardware, + gcvNULL, + offset, + &waitLinkBytes, + gcvNULL, + gcvNULL + )); + + /* Is there enough space in the current command queue? */ + if (bytes < waitLinkBytes) + { + /* No, create a new one. */ + gcmkONERROR(_NewQueue(Command)); + + /* Get the new current offset. */ + offset = Command->offset; + + /* Recompute the number of bytes in the new kernel command queue. */ + bytes = Command->pageSize - offset; + gcmkASSERT(bytes >= waitLinkBytes); + } + + /* Compute the location if WAIT/LINK command sequence. */ + waitLinkPhysical = (gctUINT8_PTR) Command->physical + offset; + waitLinkLogical = (gctUINT8_PTR) Command->logical + offset; + /* Context switch required? */ if (Context == gcvNULL) { @@ -1729,40 +1763,6 @@ gckCOMMAND_Commit( gcmkONERROR(_ProcessHints(Command, ProcessID, commandBufferObject)); #endif - /* Get the current offset. */ - offset = Command->offset; - - /* Compute number of bytes left in current kernel command queue. */ - bytes = Command->pageSize - offset; - - /* Query the size of WAIT/LINK command sequence. */ - gcmkONERROR(gckHARDWARE_WaitLink( - hardware, - gcvNULL, - offset, - &waitLinkBytes, - gcvNULL, - gcvNULL - )); - - /* Is there enough space in the current command queue? */ - if (bytes < waitLinkBytes) - { - /* No, create a new one. */ - gcmkONERROR(_NewQueue(Command)); - - /* Get the new current offset. */ - offset = Command->offset; - - /* Recompute the number of bytes in the new kernel command queue. */ - bytes = Command->pageSize - offset; - gcmkASSERT(bytes >= waitLinkBytes); - } - - /* Compute the location if WAIT/LINK command sequence. */ - waitLinkPhysical = (gctUINT8_PTR) Command->physical + offset; - waitLinkLogical = (gctUINT8_PTR) Command->logical + offset; - /* Determine the location to jump to for the command buffer being ** scheduled. */ if (Command->newQueue) @@ -1980,7 +1980,21 @@ gckCOMMAND_Commit( } /* Submit events. */ - gcmkONERROR(gckEVENT_Submit(Command->kernel->eventObj, gcvTRUE, gcvFALSE)); + status = (gckEVENT_Submit(Command->kernel->eventObj, gcvTRUE, gcvFALSE)); + + if (status == gcvSTATUS_INTERRUPTED || status == gcvSTATUS_TIMEOUT) + { + gcmkTRACE( + gcvLEVEL_INFO, + "%s(%d): Intterupted in gckEVENT_Submit", + __FUNCTION__, __LINE__ + ); + status = gcvSTATUS_OK; + } + else + { + gcmkONERROR(status); + } /* Unmap the command buffer pointer. */ if (commandBufferMapped) 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 467f4f3b2820..825c88d78dc8 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 @@ -6633,7 +6633,7 @@ gckOS_AcquireSemaphore( /* Acquire the semaphore. */ if (down_interruptible((struct semaphore *) Semaphore)) { - gcmkONERROR(gcvSTATUS_TIMEOUT); + gcmkONERROR(gcvSTATUS_INTERRUPTED); } /* Success. */ |