summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2012-04-01 16:49:30 +0800
committerRichard Liu <r66033@freescale.com>2012-04-06 14:24:32 +0800
commitbee5f57f1e3e5174aa5390a330052e772afdc453 (patch)
tree3f15b891efeb31ea9592ea328d210f3b62dafa50
parentb87d56be86dedc507163d9f9a49f1e9fa2e65228 (diff)
ENGR00178642-1 gpu-viv: fix suspend/resume issue for #304
Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Acked-by: Lily Zhang
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c84
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c2
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. */