diff options
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c | 15 |
1 files changed, 11 insertions, 4 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 8a442a2c4b0b..baf22044c943 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 @@ -1582,6 +1582,7 @@ _NeedVirtualMapping( gctUINT32 end; gcePOOL pool; gctUINT32 offset; + gctUINT32 baseAddress; gcmkHEADER_ARG("Node=0x%X", Node); @@ -1601,10 +1602,16 @@ _NeedVirtualMapping( else #endif { - /* For cores which can't access all physical address. */ - gcmkONERROR(gckHARDWARE_ConvertLogical(Kernel->hardware, - Node->Virtual.logical, - &phys)); + /* Convert logical address into a physical address. */ + gcmkONERROR( + gckOS_GetPhysicalAddress(Kernel->os, Node->Virtual.logical, &phys)); + + gcmkONERROR(gckOS_GetBaseAddress(Kernel->os, &baseAddress)); + + gcmkASSERT(phys >= baseAddress); + + /* Subtract baseAddress to get a GPU address used for programming. */ + phys -= baseAddress; /* If part of region is belong to gcvPOOL_VIRTUAL, ** whole region has to be mapped. */ |