diff options
Diffstat (limited to 'drivers/gpu/arm/mali400/r4p0_rel0/linux')
3 files changed, 27 insertions, 5 deletions
diff --git a/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_kernel_linux.c b/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_kernel_linux.c index 3c491a901d4..b959179d775 100644 --- a/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_kernel_linux.c +++ b/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_kernel_linux.c @@ -39,7 +39,7 @@ #include "mali_profiling_internal.h" #endif /* MALI_SEC */ -#include <exynos4_pmm.h> +#include <exynos.h> /* Streamline support for the Mali driver */ #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_MALI400_PROFILING) @@ -192,6 +192,9 @@ static struct platform_driver mali_platform_driver = { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) .pm = &mali_dev_pm_ops, #endif +#if !defined(MALI_FAKE_PLATFORM_DEVICE) + .of_match_table = of_match_ptr(mali_of_matches), +#endif }, }; @@ -409,6 +412,14 @@ static int mali_probe(struct platform_device *pdev) mali_platform_device = pdev; +#if !defined(MALI_FAKE_PLATFORM_DEVICE) + if (mali_platform_init() != _MALI_OSK_ERR_OK) + { + MALI_PRINT_ERROR(("mali_probe(): mali_platform_init() failed.")); + return -ENODEV; + } +#endif + if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) { /* Initialize the Mali GPU HW specified by pdev */ if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) { @@ -445,6 +456,9 @@ static int mali_remove(struct platform_device *pdev) mali_miscdevice_unregister(); mali_terminate_subsystems(); _mali_osk_wq_term(); +#if !defined(MALI_FAKE_PLATFORM_DEVICE) + mali_platform_deinit(); +#endif mali_platform_device = NULL; return 0; } @@ -475,14 +489,14 @@ static int mali_driver_suspend_scheduler(struct device *dev) { mali_pm_os_suspend(); /* MALI_SEC */ - mali_platform_power_mode_change(dev, MALI_POWER_MODE_DEEP_SLEEP); + mali_platform_power_mode_change(MALI_POWER_MODE_DEEP_SLEEP); return 0; } static int mali_driver_resume_scheduler(struct device *dev) { /* MALI_SEC */ - mali_platform_power_mode_change(dev, MALI_POWER_MODE_ON); + mali_platform_power_mode_change(MALI_POWER_MODE_ON); mali_pm_os_resume(); return 0; } @@ -492,14 +506,14 @@ static int mali_driver_runtime_suspend(struct device *dev) { mali_pm_runtime_suspend(); /* MALI_SEC */ - mali_platform_power_mode_change(dev, MALI_POWER_MODE_LIGHT_SLEEP); + mali_platform_power_mode_change(MALI_POWER_MODE_LIGHT_SLEEP); return 0; } static int mali_driver_runtime_resume(struct device *dev) { /* MALI_SEC */ - mali_platform_power_mode_change(dev, MALI_POWER_MODE_ON); + mali_platform_power_mode_change(MALI_POWER_MODE_ON); mali_pm_runtime_resume(); return 0; } diff --git a/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_dma_buf.c b/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_dma_buf.c index f4bcce00546..694887b3c21 100644 --- a/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_dma_buf.c +++ b/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_dma_buf.c @@ -17,7 +17,9 @@ #include <linux/wait.h> #include <linux/sched.h> #include <linux/mutex.h> +#if defined (CONFIG_ION_EXYNOS) #include <linux/exynos_ion.h> +#endif #include "mali_ukk.h" #include "mali_osk.h" @@ -105,8 +107,10 @@ static int mali_dma_buf_map(struct mali_dma_buf_attachment *mem, struct mali_ses return -EFAULT; } +#if defined (CONFIG_ION_EXYNOS) exynos_ion_sync_dmabuf_for_device(&mali_platform_device->dev, mem->buf, mem->buf->size, DMA_BIDIRECTIONAL); +#endif for_each_sg(mem->sgt->sgl, sg, mem->sgt->nents, i) { u32 size = sg_dma_len(sg); @@ -155,8 +159,10 @@ static void mali_dma_buf_unmap(struct mali_dma_buf_attachment *mem) if (0 == mem->map_ref) { dma_buf_unmap_attachment(mem->attachment, mem->sgt, DMA_BIDIRECTIONAL); +#if defined (CONFIG_ION_EXYNOS) exynos_ion_sync_dmabuf_for_cpu(&mali_platform_device->dev, mem->buf, mem->buf->size, DMA_BIDIRECTIONAL); +#endif mem->is_mapped = MALI_FALSE; } diff --git a/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_os_alloc.c b/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_os_alloc.c index b6599fca7d0..40bb858b92d 100644 --- a/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_os_alloc.c +++ b/drivers/gpu/arm/mali400/r4p0_rel0/linux/mali_memory_os_alloc.c @@ -56,7 +56,9 @@ static struct mali_mem_os_allocator { .allocated_pages = ATOMIC_INIT(0), .allocation_limit = 0, +#if 0 .shrinker.shrink = mali_mem_os_shrink, +#endif .shrinker.seeks = DEFAULT_SEEKS, #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) .timed_shrinker = __DELAYED_WORK_INITIALIZER(mali_mem_os_allocator.timed_shrinker, mali_mem_os_trim_pool, TIMER_DEFERRABLE), |