summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2013-08-29 01:33:39 +0800
committerXianzhong <b07117@freescale.com>2013-08-30 02:41:33 +0800
commite091161f89661a79788a589b3c455fc43ac788d5 (patch)
tree5d998e30084158d92eef570d75acf82077d6d4f4
parentf2500b850131ae372de98027580865805ad78192 (diff)
ENGR00277045-1 fix system reboot with video playback
gpu virtual memory cannot be allocated for external use this issue occurs in ARD board with 2G above memory address Signed-off-by: Xianzhong <b07117@freescale.com> Acked-by: Jason Liu
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c37
1 files changed, 37 insertions, 0 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 b7b0d282940f..299162cef050 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -738,6 +738,43 @@ _AllocateMemory_Retry:
if (gcmIS_SUCCESS(status) || forceContiguous == gcvTRUE)
{
/* Memory allocated. */
+ if(node && forceContiguous == gcvTRUE)
+ {
+ gctUINT32 physAddr=0;
+ gctUINT32 baseAddress = 0;
+
+ gckOS_LockPages(Kernel->os,
+ node->Virtual.physical,
+ node->Virtual.bytes,
+ gcvFALSE,
+ &node->Virtual.logical,
+ &node->Virtual.pageCount);
+
+ /* Convert logical address into a physical address. */
+ gckOS_GetPhysicalAddress(Kernel->os, node->Virtual.logical, &physAddr);
+
+ gckOS_UnlockPages(Kernel->os,
+ node->Virtual.physical,
+ node->Virtual.bytes,
+ node->Virtual.logical);
+
+ gckOS_GetBaseAddress(Kernel->os, &baseAddress);
+
+ gcmkASSERT(physAddr >= baseAddress);
+
+ /* Subtract baseAddress to get a GPU address used for programming. */
+ physAddr -= baseAddress;
+
+ if((physAddr & 0x80000000) || ((physAddr + Bytes) & 0x80000000))
+ {
+ gckOS_Print("gpu virtual memory 0x%x cannot be allocated for external use !\n", physAddr);
+
+ gckVIDMEM_Free(node);
+
+ node = gcvNULL;
+ }
+ }
+
break;
}
}