summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2015-08-09 17:36:27 +0800
committerXianzhong <b07117@freescale.com>2015-08-10 11:09:17 +0800
commit75a01115a7f53d728e6abeb7b205676cc2a50bc0 (patch)
tree4a3807f95f547a966d8d30254b9bb2a475209c59
parentd67bdc94188c5a05580f6d35306860cfbb121961 (diff)
MGS-925 [#1818] fix GPU kernel crash with 2D OpenVGrel_imx_3.14.38_6qp_ga
OpenVG cannot go to the GPU MMU virtual mapping code, This is regression from MGS-896 fix with the coding flaw, The fix is to keep OpenVG check path as original code. Date: Aug 09, 2015 Signed-off-by: Xianzhong <b07117@freescale.com> (cherry picked from commit 112eb89c301d35fdfecb245e86f07b3fa6fec8fa)
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
index e0920e594893..16fd872b312b 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
@@ -1289,43 +1289,45 @@ _NeedVirtualMapping(
}
else
#endif
- /* Convert logical address into a physical address. */
- gcmkONERROR(gckOS_UserLogicalToPhysical(
- Kernel->os, Node->Virtual.logical, &phys
- ));
+ {
+ /* Convert logical address into a physical address. */
+ gcmkONERROR(gckOS_UserLogicalToPhysical(
+ Kernel->os, Node->Virtual.logical, &phys
+ ));
- gcmkSAFECASTPHYSADDRT(address, phys);
+ gcmkSAFECASTPHYSADDRT(address, phys);
- gcmkONERROR(gckOS_GetBaseAddress(Kernel->os, &baseAddress));
+ gcmkONERROR(gckOS_GetBaseAddress(Kernel->os, &baseAddress));
- gcmkASSERT(phys >= baseAddress);
+ gcmkASSERT(phys >= baseAddress);
- /* Subtract baseAddress to get a GPU address used for programming. */
- address -= baseAddress;
+ /* Subtract baseAddress to get a GPU address used for programming. */
+ address -= baseAddress;
- /* If part of region is belong to gcvPOOL_VIRTUAL,
- ** whole region has to be mapped. */
+ /* If part of region is belong to gcvPOOL_VIRTUAL,
+ ** whole region has to be mapped. */
- gcmkSAFECASTSIZET(bytes, Node->Virtual.bytes);
+ gcmkSAFECASTSIZET(bytes, Node->Virtual.bytes);
- end = address + bytes - 1;
+ end = address + bytes - 1;
- if (!gckHARDWARE_IsFeatureAvailable(Kernel->hardware, gcvFEATURE_MMU))
- {
- gcmkONERROR(gckHARDWARE_SplitMemory(
- Kernel->hardware, end, &pool, &offset
- ));
+ if (!gckHARDWARE_IsFeatureAvailable(Kernel->hardware, gcvFEATURE_MMU))
+ {
+ gcmkONERROR(gckHARDWARE_SplitMemory(
+ Kernel->hardware, end, &pool, &offset
+ ));
- *NeedMapping = (pool == gcvPOOL_VIRTUAL);
- }
- else
- {
- /* TODO: Check whether physical address in flat mapping. */
- gctUINT32 dynamicMappingStart = Kernel->mmu->dynamicMappingStart;
- if( end < (dynamicMappingStart << gcdMMU_MTLB_SHIFT))
- *NeedMapping = gcvFALSE;
+ *NeedMapping = (pool == gcvPOOL_VIRTUAL);
+ }
else
- *NeedMapping = gcvTRUE;
+ {
+ /* TODO: Check whether physical address in flat mapping. */
+ gctUINT32 dynamicMappingStart = Kernel->mmu->dynamicMappingStart;
+ if( end < (dynamicMappingStart << gcdMMU_MTLB_SHIFT))
+ *NeedMapping = gcvFALSE;
+ else
+ *NeedMapping = gcvTRUE;
+ }
}
}
else