diff options
Diffstat (limited to 'drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h')
-rw-r--r-- | drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h index 305b2ee9066d..65eadb1e79cf 100644 --- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h +++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h @@ -40,9 +40,14 @@ OSINLINE void kgsl_hwaccess_memread(void *dst, unsigned int gpubase, unsigned int gpuoffset, unsigned int sizebytes, unsigned int touserspace) { - if (gsl_driver.enable_mmu && (gpubase >= GSL_LINUX_MAP_RANGE_START) && (gpubase < GSL_LINUX_MAP_RANGE_END)) { +#ifdef GSL_MMU_TRANSLATION_ENABLED + if(gpubase >= GSL_LINUX_MAP_RANGE_START && gpubase < GSL_LINUX_MAP_RANGE_END) + { gsl_linux_map_read(dst, gpubase+gpuoffset, sizebytes, touserspace); - } else { + } + else +#endif + { mb(); dsb(); if (touserspace) @@ -66,9 +71,14 @@ kgsl_hwaccess_memread(void *dst, unsigned int gpubase, unsigned int gpuoffset, u OSINLINE void kgsl_hwaccess_memwrite(unsigned int gpubase, unsigned int gpuoffset, void *src, unsigned int sizebytes, unsigned int fromuserspace) { - if (gsl_driver.enable_mmu && (gpubase >= GSL_LINUX_MAP_RANGE_START) && (gpubase < GSL_LINUX_MAP_RANGE_END)) { +#ifdef GSL_MMU_TRANSLATION_ENABLED + if(gpubase >= GSL_LINUX_MAP_RANGE_START && gpubase < GSL_LINUX_MAP_RANGE_END) + { gsl_linux_map_write(src, gpubase+gpuoffset, sizebytes, fromuserspace); - } else { + } + else +#endif + { mb(); dsb(); if (fromuserspace) @@ -92,9 +102,12 @@ kgsl_hwaccess_memwrite(unsigned int gpubase, unsigned int gpuoffset, void *src, OSINLINE void kgsl_hwaccess_memset(unsigned int gpubase, unsigned int gpuoffset, unsigned int value, unsigned int sizebytes) { - if (gsl_driver.enable_mmu && (gpubase >= GSL_LINUX_MAP_RANGE_START) && (gpubase < GSL_LINUX_MAP_RANGE_END)) { - gsl_linux_map_set(gpuoffset+gpubase, value, sizebytes); - } else { +#ifdef GSL_MMU_TRANSLATION_ENABLED + if(gpubase >= GSL_LINUX_MAP_RANGE_START && gpubase < GSL_LINUX_MAP_RANGE_END) + gsl_linux_map_set(gpuoffset+gpubase, value, sizebytes); + else +#endif + { mb(); dsb(); kos_memset((void *)(gpubase + gpuoffset), value, sizebytes); |