2 * Copyright (C) 2011-2012 ARM Limited. All rights reserved.
4 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7 * A copy of the licence is included with the program, and can also be obtained from Free Software
8 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12 * @file mali_kernel_linux.c
13 * Implementation of the Linux device driver entrypoints
15 #include <linux/module.h> /* kernel module definitions */
16 #include <linux/fs.h> /* file system operations */
17 #include <linux/cdev.h> /* character device definitions */
18 #include <linux/mm.h> /* memory manager definitions */
19 #include <linux/mali/mali_utgard_ioctl.h>
21 #include <linux/version.h>
22 #include <linux/device.h>
23 #include "mali_kernel_license.h"
24 #include <linux/platform_device.h>
25 #if MALI_LICENSE_IS_GPL
26 #include <linux/miscdevice.h>
28 #include <linux/mali/mali_utgard.h>
29 #include "mali_kernel_common.h"
30 #include "mali_session.h"
31 #include "mali_kernel_core.h"
33 #include "mali_kernel_linux.h"
35 #include "mali_ukk_wrappers.h"
36 #include "mali_kernel_sysfs.h"
38 #include "mali_kernel_license.h"
39 #include "mali_dma_buf.h"
40 #if defined(CONFIG_MALI400_INTERNAL_PROFILING)
41 #include "mali_profiling_internal.h"
44 #include "../platform/exynos4/exynos4.h"
46 /* Streamline support for the Mali driver */
47 #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_MALI400_PROFILING)
48 /* Ask Linux to create the tracepoints */
49 #define CREATE_TRACE_POINTS
50 #include "mali_linux_trace.h"
51 #endif /* CONFIG_TRACEPOINTS */
53 /* from the __malidrv_build_info.c file that is generated during build */
54 extern const char *__malidrv_build_info(void);
56 /* Module parameter to control log level */
57 int mali_debug_level = 2;
58 module_param(mali_debug_level, int, S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP | S_IROTH); /* rw-rw-r-- */
59 MODULE_PARM_DESC(mali_debug_level, "Higher number, more dmesg output");
61 module_param(mali_max_job_runtime, int, S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP | S_IROTH);
62 MODULE_PARM_DESC(mali_max_job_runtime, "Maximum allowed job runtime in msecs.\nJobs will be killed after this no matter what");
64 extern int mali_l2_max_reads;
65 module_param(mali_l2_max_reads, int, S_IRUSR | S_IRGRP | S_IROTH);
66 MODULE_PARM_DESC(mali_l2_max_reads, "Maximum reads for Mali L2 cache");
68 extern int mali_dedicated_mem_start;
69 module_param(mali_dedicated_mem_start, int, S_IRUSR | S_IRGRP | S_IROTH);
70 MODULE_PARM_DESC(mali_dedicated_mem_start, "Physical start address of dedicated Mali GPU memory.");
72 extern int mali_dedicated_mem_size;
73 module_param(mali_dedicated_mem_size, int, S_IRUSR | S_IRGRP | S_IROTH);
74 MODULE_PARM_DESC(mali_dedicated_mem_size, "Size of dedicated Mali GPU memory.");
76 extern int mali_shared_mem_size;
77 module_param(mali_shared_mem_size, int, S_IRUSR | S_IRGRP | S_IROTH);
78 MODULE_PARM_DESC(mali_shared_mem_size, "Size of shared Mali GPU memory.");
80 #if defined(CONFIG_MALI400_PROFILING)
81 extern int mali_boot_profiling;
82 module_param(mali_boot_profiling, int, S_IRUSR | S_IRGRP | S_IROTH);
83 MODULE_PARM_DESC(mali_boot_profiling, "Start profiling as a part of Mali driver initialization");
86 extern int mali_max_pp_cores_group_1;
87 module_param(mali_max_pp_cores_group_1, int, S_IRUSR | S_IRGRP | S_IROTH);
88 MODULE_PARM_DESC(mali_max_pp_cores_group_1, "Limit the number of PP cores to use from first PP group.");
90 extern int mali_max_pp_cores_group_2;
91 module_param(mali_max_pp_cores_group_2, int, S_IRUSR | S_IRGRP | S_IROTH);
92 MODULE_PARM_DESC(mali_max_pp_cores_group_2, "Limit the number of PP cores to use from second PP group (Mali-450 only).");
94 /* Export symbols from common code: mali_user_settings.c */
95 #include "mali_user_settings_db.h"
96 EXPORT_SYMBOL(mali_set_user_setting);
97 EXPORT_SYMBOL(mali_get_user_setting);
100 extern int mali_gpu_clk;
101 module_param(mali_gpu_clk, int, S_IRUSR | S_IRGRP | S_IROTH); /* r--r--r-- */
102 MODULE_PARM_DESC(mali_gpu_clk, "Mali Current Clock");
104 extern int mali_gpu_vol;
105 module_param(mali_gpu_vol, int, S_IRUSR | S_IRGRP | S_IROTH); /* r--r--r-- */
106 MODULE_PARM_DESC(mali_gpu_vol, "Mali Current Voltage");
108 extern int gpu_power_state;
109 module_param(gpu_power_state, int, S_IRUSR | S_IRGRP | S_IROTH); /* r--r--r-- */
110 MODULE_PARM_DESC(gpu_power_state, "Mali Power State");
114 static char mali_dev_name[] = "mali"; /* should be const, but the functions we call requires non-cost */
116 /* This driver only supports one Mali device, and this variable stores this single platform device */
117 struct platform_device *mali_platform_device = NULL;
119 /* This driver only supports one Mali device, and this variable stores the exposed misc device (/dev/mali) */
120 static struct miscdevice mali_miscdevice = { 0, };
122 static int mali_miscdevice_register(struct platform_device *pdev);
123 static void mali_miscdevice_unregister(void);
125 static int mali_open(struct inode *inode, struct file *filp);
126 static int mali_release(struct inode *inode, struct file *filp);
127 #ifdef HAVE_UNLOCKED_IOCTL
128 static long mali_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
130 static int mali_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
132 static int mali_mmap(struct file * filp, struct vm_area_struct * vma);
134 static int mali_probe(struct platform_device *pdev);
135 static int mali_remove(struct platform_device *pdev);
137 static int mali_driver_suspend_scheduler(struct device *dev);
138 static int mali_driver_resume_scheduler(struct device *dev);
140 #ifdef CONFIG_PM_RUNTIME
141 static int mali_driver_runtime_suspend(struct device *dev);
142 static int mali_driver_runtime_resume(struct device *dev);
143 static int mali_driver_runtime_idle(struct device *dev);
146 #if defined(MALI_FAKE_PLATFORM_DEVICE)
147 extern int mali_platform_device_register(void);
148 extern int mali_platform_device_unregister(void);
151 /* Linux power management operations provided by the Mali device driver */
152 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
153 struct pm_ext_ops mali_dev_ext_pm_ops =
157 .suspend = mali_driver_suspend_scheduler,
158 .resume = mali_driver_resume_scheduler,
159 .freeze = mali_driver_suspend_scheduler,
160 .thaw = mali_driver_resume_scheduler,
164 static const struct dev_pm_ops mali_dev_pm_ops =
166 #ifdef CONFIG_PM_RUNTIME
167 .runtime_suspend = mali_driver_runtime_suspend,
168 .runtime_resume = mali_driver_runtime_resume,
169 .runtime_idle = mali_driver_runtime_idle,
171 .suspend = mali_driver_suspend_scheduler,
172 .resume = mali_driver_resume_scheduler,
173 .freeze = mali_driver_suspend_scheduler,
174 .thaw = mali_driver_resume_scheduler,
178 /* The Mali device driver struct */
179 static struct platform_driver mali_platform_driver =
182 .remove = mali_remove,
183 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
184 .pm = &mali_dev_ext_pm_ops,
188 .name = "mali_dev", /* MALI_SEC MALI_GPU_NAME_UTGARD, */
189 .owner = THIS_MODULE,
190 .bus = &platform_bus_type,
191 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
192 .pm = &mali_dev_pm_ops,
194 .of_match_table = of_match_ptr(mali_of_matches),
198 /* Linux misc device operations (/dev/mali) */
199 struct file_operations mali_fops =
201 .owner = THIS_MODULE,
203 .release = mali_release,
204 #ifdef HAVE_UNLOCKED_IOCTL
205 .unlocked_ioctl = mali_ioctl,
217 int mali_module_init(void)
221 MALI_DEBUG_PRINT(2, ("Inserting Mali v%d device driver. \n",_MALI_API_VERSION));
222 MALI_DEBUG_PRINT(2, ("Compiled: %s, time: %s.\n", __DATE__, __TIME__));
223 MALI_DEBUG_PRINT(2, ("Driver revision: %s\n", SVN_REV_STRING));
225 /* Initialize module wide settings */
226 mali_osk_low_level_mem_init();
228 #if defined(MALI_FAKE_PLATFORM_DEVICE)
229 MALI_DEBUG_PRINT(2, ("mali_module_init() registering device\n"));
230 err = mali_platform_device_register();
237 MALI_DEBUG_PRINT(2, ("mali_module_init() registering driver\n"));
239 err = platform_driver_register(&mali_platform_driver);
243 MALI_DEBUG_PRINT(2, ("mali_module_init() Failed to register driver (%d)\n", err));
244 #if defined(MALI_FAKE_PLATFORM_DEVICE)
245 mali_platform_device_unregister();
247 mali_platform_device = NULL;
251 #if defined(CONFIG_MALI400_INTERNAL_PROFILING)
252 err = _mali_internal_profiling_init(mali_boot_profiling ? MALI_TRUE : MALI_FALSE);
255 /* No biggie if we wheren't able to initialize the profiling */
256 MALI_PRINT_ERROR(("Failed to initialize profiling, feature will be unavailable\n"));
260 MALI_PRINT(("Mali device driver loaded\n"));
262 return 0; /* Success */
265 void mali_module_exit(void)
267 MALI_DEBUG_PRINT(2, ("Unloading Mali v%d device driver.\n",_MALI_API_VERSION));
269 MALI_DEBUG_PRINT(2, ("mali_module_exit() unregistering driver\n"));
271 #if defined(CONFIG_MALI400_INTERNAL_PROFILING)
272 _mali_internal_profiling_term();
275 platform_driver_unregister(&mali_platform_driver);
277 #if defined(MALI_FAKE_PLATFORM_DEVICE)
278 MALI_DEBUG_PRINT(2, ("mali_module_exit() unregistering device\n"));
279 mali_platform_device_unregister();
282 mali_osk_low_level_mem_term();
284 MALI_PRINT(("Mali device driver unloaded\n"));
287 static int mali_probe(struct platform_device *pdev)
291 MALI_DEBUG_PRINT(2, ("mali_probe(): Called for platform device %s\n", pdev->name));
293 if (NULL != mali_platform_device)
295 /* Already connected to a device, return error */
296 MALI_PRINT_ERROR(("mali_probe(): The Mali driver is already connected with a Mali device."));
300 mali_platform_device = pdev;
302 if (mali_platform_init() != _MALI_OSK_ERR_OK)
304 /* Platform-specific initialization failed, return error */
305 MALI_PRINT_ERROR(("mali_probe(): mali_platform_init() failed."));
309 if (_MALI_OSK_ERR_OK == _mali_osk_wq_init())
311 /* Initialize the Mali GPU HW specified by pdev */
312 if (_MALI_OSK_ERR_OK == mali_initialize_subsystems())
314 /* Register a misc device (so we are accessible from user space) */
315 err = mali_miscdevice_register(pdev);
318 /* Setup sysfs entries */
319 err = mali_sysfs_register(mali_dev_name);
322 MALI_DEBUG_PRINT(2, ("mali_probe(): Successfully initialized driver for platform device %s\n", pdev->name));
327 MALI_PRINT_ERROR(("mali_probe(): failed to register sysfs entries"));
329 mali_miscdevice_unregister();
333 MALI_PRINT_ERROR(("mali_probe(): failed to register Mali misc device."));
335 mali_terminate_subsystems();
339 MALI_PRINT_ERROR(("mali_probe(): Failed to initialize Mali device driver."));
344 mali_platform_device = NULL;
348 static int mali_remove(struct platform_device *pdev)
350 MALI_DEBUG_PRINT(2, ("mali_remove() called for platform device %s\n", pdev->name));
351 mali_sysfs_unregister();
352 mali_miscdevice_unregister();
353 mali_terminate_subsystems();
355 mali_platform_deinit();
356 mali_platform_device = NULL;
360 static int mali_miscdevice_register(struct platform_device *pdev)
364 mali_miscdevice.minor = MISC_DYNAMIC_MINOR;
365 mali_miscdevice.name = mali_dev_name;
366 mali_miscdevice.fops = &mali_fops;
367 mali_miscdevice.parent = get_device(&pdev->dev);
369 err = misc_register(&mali_miscdevice);
372 MALI_PRINT_ERROR(("Failed to register misc device, misc_register() returned %d\n", err));
378 static void mali_miscdevice_unregister(void)
380 misc_deregister(&mali_miscdevice);
383 static int mali_driver_suspend_scheduler(struct device *dev)
385 mali_pm_os_suspend();
387 mali_platform_power_mode_change(MALI_POWER_MODE_DEEP_SLEEP);
391 static int mali_driver_resume_scheduler(struct device *dev)
394 mali_platform_power_mode_change(MALI_POWER_MODE_ON);
399 #ifdef CONFIG_PM_RUNTIME
400 static int mali_driver_runtime_suspend(struct device *dev)
402 mali_pm_runtime_suspend();
404 mali_platform_power_mode_change(MALI_POWER_MODE_LIGHT_SLEEP);
408 static int mali_driver_runtime_resume(struct device *dev)
411 mali_platform_power_mode_change(MALI_POWER_MODE_ON);
412 mali_pm_runtime_resume();
416 static int mali_driver_runtime_idle(struct device *dev)
423 /** @note munmap handler is done by vma close handler */
424 static int mali_mmap(struct file * filp, struct vm_area_struct * vma)
426 struct mali_session_data * session_data;
427 _mali_uk_mem_mmap_s args = {0, };
429 session_data = (struct mali_session_data *)filp->private_data;
430 if (NULL == session_data)
432 MALI_PRINT_ERROR(("mmap called without any session data available\n"));
436 MALI_DEBUG_PRINT(4, ("MMap() handler: start=0x%08X, phys=0x%08X, size=0x%08X vma->flags 0x%08x\n", (unsigned int)vma->vm_start, (unsigned int)(vma->vm_pgoff << PAGE_SHIFT), (unsigned int)(vma->vm_end - vma->vm_start), vma->vm_flags));
438 /* Re-pack the arguments that mmap() packed for us */
439 args.ctx = session_data;
440 args.phys_addr = vma->vm_pgoff << PAGE_SHIFT;
441 args.size = vma->vm_end - vma->vm_start;
442 args.ukk_private = vma;
444 if ( VM_SHARED== (VM_SHARED & vma->vm_flags))
446 args.cache_settings = MALI_CACHE_STANDARD ;
447 MALI_DEBUG_PRINT(3,("Allocate - Standard - Size: %d kb\n", args.size/1024));
451 args.cache_settings = MALI_CACHE_GP_READ_ALLOCATE;
452 MALI_DEBUG_PRINT(3,("Allocate - GP Cached - Size: %d kb\n", args.size/1024));
454 /* Setting it equal to VM_SHARED and not Private, which would have made the later io_remap fail for MALI_CACHE_GP_READ_ALLOCATE */
455 vma->vm_flags = 0x000000fb;
457 /* Call the common mmap handler */
458 MALI_CHECK(_MALI_OSK_ERR_OK ==_mali_ukk_mem_mmap( &args ), -EFAULT);
463 static int mali_open(struct inode *inode, struct file *filp)
465 struct mali_session_data * session_data;
466 _mali_osk_errcode_t err;
468 /* input validation */
469 if (mali_miscdevice.minor != iminor(inode))
471 MALI_PRINT_ERROR(("mali_open() Minor does not match\n"));
475 /* allocated struct to track this session */
476 err = _mali_ukk_open((void **)&session_data);
477 if (_MALI_OSK_ERR_OK != err) return map_errcode(err);
479 /* initialize file pointer */
482 /* link in our session data */
483 filp->private_data = (void*)session_data;
488 static int mali_release(struct inode *inode, struct file *filp)
490 _mali_osk_errcode_t err;
492 /* input validation */
493 if (mali_miscdevice.minor != iminor(inode))
495 MALI_PRINT_ERROR(("mali_release() Minor does not match\n"));
499 err = _mali_ukk_close((void **)&filp->private_data);
500 if (_MALI_OSK_ERR_OK != err) return map_errcode(err);
505 int map_errcode( _mali_osk_errcode_t err )
509 case _MALI_OSK_ERR_OK : return 0;
510 case _MALI_OSK_ERR_FAULT: return -EFAULT;
511 case _MALI_OSK_ERR_INVALID_FUNC: return -ENOTTY;
512 case _MALI_OSK_ERR_INVALID_ARGS: return -EINVAL;
513 case _MALI_OSK_ERR_NOMEM: return -ENOMEM;
514 case _MALI_OSK_ERR_TIMEOUT: return -ETIMEDOUT;
515 case _MALI_OSK_ERR_RESTARTSYSCALL: return -ERESTARTSYS;
516 case _MALI_OSK_ERR_ITEM_NOT_FOUND: return -ENOENT;
517 default: return -EFAULT;
521 #ifdef HAVE_UNLOCKED_IOCTL
522 static long mali_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
524 static int mali_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
528 struct mali_session_data *session_data;
530 #ifndef HAVE_UNLOCKED_IOCTL
535 MALI_DEBUG_PRINT(7, ("Ioctl received 0x%08X 0x%08lX\n", cmd, arg));
537 session_data = (struct mali_session_data *)filp->private_data;
538 if (NULL == session_data)
540 MALI_DEBUG_PRINT(7, ("filp->private_data was NULL\n"));
544 if (NULL == (void *)arg)
546 MALI_DEBUG_PRINT(7, ("arg was NULL\n"));
552 case MALI_IOC_WAIT_FOR_NOTIFICATION:
553 err = wait_for_notification_wrapper(session_data, (_mali_uk_wait_for_notification_s __user *)arg);
556 case MALI_IOC_GET_API_VERSION:
557 err = get_api_version_wrapper(session_data, (_mali_uk_get_api_version_s __user *)arg);
560 case MALI_IOC_POST_NOTIFICATION:
561 err = post_notification_wrapper(session_data, (_mali_uk_post_notification_s __user *)arg);
564 case MALI_IOC_GET_USER_SETTINGS:
565 err = get_user_settings_wrapper(session_data, (_mali_uk_get_user_settings_s __user *)arg);
568 #if defined(CONFIG_MALI400_PROFILING)
569 case MALI_IOC_PROFILING_START:
570 err = profiling_start_wrapper(session_data, (_mali_uk_profiling_start_s __user *)arg);
573 case MALI_IOC_PROFILING_ADD_EVENT:
574 err = profiling_add_event_wrapper(session_data, (_mali_uk_profiling_add_event_s __user *)arg);
577 case MALI_IOC_PROFILING_STOP:
578 err = profiling_stop_wrapper(session_data, (_mali_uk_profiling_stop_s __user *)arg);
581 case MALI_IOC_PROFILING_GET_EVENT:
582 err = profiling_get_event_wrapper(session_data, (_mali_uk_profiling_get_event_s __user *)arg);
585 case MALI_IOC_PROFILING_CLEAR:
586 err = profiling_clear_wrapper(session_data, (_mali_uk_profiling_clear_s __user *)arg);
589 case MALI_IOC_PROFILING_GET_CONFIG:
590 /* Deprecated: still compatible with get_user_settings */
591 err = get_user_settings_wrapper(session_data, (_mali_uk_get_user_settings_s __user *)arg);
594 case MALI_IOC_PROFILING_REPORT_SW_COUNTERS:
595 err = profiling_report_sw_counters_wrapper(session_data, (_mali_uk_sw_counters_report_s __user *)arg);
600 case MALI_IOC_PROFILING_START: /* FALL-THROUGH */
601 case MALI_IOC_PROFILING_ADD_EVENT: /* FALL-THROUGH */
602 case MALI_IOC_PROFILING_STOP: /* FALL-THROUGH */
603 case MALI_IOC_PROFILING_GET_EVENT: /* FALL-THROUGH */
604 case MALI_IOC_PROFILING_CLEAR: /* FALL-THROUGH */
605 case MALI_IOC_PROFILING_GET_CONFIG: /* FALL-THROUGH */
606 case MALI_IOC_PROFILING_REPORT_SW_COUNTERS: /* FALL-THROUGH */
607 MALI_DEBUG_PRINT(2, ("Profiling not supported\n"));
613 case MALI_IOC_MEM_INIT:
614 err = mem_init_wrapper(session_data, (_mali_uk_init_mem_s __user *)arg);
617 case MALI_IOC_MEM_TERM:
618 err = mem_term_wrapper(session_data, (_mali_uk_term_mem_s __user *)arg);
621 case MALI_IOC_MEM_MAP_EXT:
622 err = mem_map_ext_wrapper(session_data, (_mali_uk_map_external_mem_s __user *)arg);
625 case MALI_IOC_MEM_UNMAP_EXT:
626 err = mem_unmap_ext_wrapper(session_data, (_mali_uk_unmap_external_mem_s __user *)arg);
629 case MALI_IOC_MEM_QUERY_MMU_PAGE_TABLE_DUMP_SIZE:
630 err = mem_query_mmu_page_table_dump_size_wrapper(session_data, (_mali_uk_query_mmu_page_table_dump_size_s __user *)arg);
633 case MALI_IOC_MEM_DUMP_MMU_PAGE_TABLE:
634 err = mem_dump_mmu_page_table_wrapper(session_data, (_mali_uk_dump_mmu_page_table_s __user *)arg);
637 #if defined(CONFIG_MALI400_UMP)
639 case MALI_IOC_MEM_ATTACH_UMP:
640 err = mem_attach_ump_wrapper(session_data, (_mali_uk_attach_ump_mem_s __user *)arg);
643 case MALI_IOC_MEM_RELEASE_UMP:
644 err = mem_release_ump_wrapper(session_data, (_mali_uk_release_ump_mem_s __user *)arg);
649 case MALI_IOC_MEM_ATTACH_UMP:
650 case MALI_IOC_MEM_RELEASE_UMP: /* FALL-THROUGH */
651 MALI_DEBUG_PRINT(2, ("UMP not supported\n"));
656 #ifdef CONFIG_DMA_SHARED_BUFFER
657 case MALI_IOC_MEM_ATTACH_DMA_BUF:
658 err = mali_attach_dma_buf(session_data, (_mali_uk_attach_dma_buf_s __user *)arg);
661 case MALI_IOC_MEM_RELEASE_DMA_BUF:
662 err = mali_release_dma_buf(session_data, (_mali_uk_release_dma_buf_s __user *)arg);
665 case MALI_IOC_MEM_DMA_BUF_GET_SIZE:
666 err = mali_dma_buf_get_size(session_data, (_mali_uk_dma_buf_get_size_s __user *)arg);
670 case MALI_IOC_MEM_ATTACH_DMA_BUF: /* FALL-THROUGH */
671 case MALI_IOC_MEM_RELEASE_DMA_BUF: /* FALL-THROUGH */
672 case MALI_IOC_MEM_DMA_BUF_GET_SIZE: /* FALL-THROUGH */
673 MALI_DEBUG_PRINT(2, ("DMA-BUF not supported\n"));
678 case MALI_IOC_PP_START_JOB:
679 err = pp_start_job_wrapper(session_data, (_mali_uk_pp_start_job_s __user *)arg);
682 case MALI_IOC_PP_NUMBER_OF_CORES_GET:
683 err = pp_get_number_of_cores_wrapper(session_data, (_mali_uk_get_pp_number_of_cores_s __user *)arg);
686 case MALI_IOC_PP_CORE_VERSION_GET:
687 err = pp_get_core_version_wrapper(session_data, (_mali_uk_get_pp_core_version_s __user *)arg);
690 case MALI_IOC_PP_DISABLE_WB:
691 err = pp_disable_wb_wrapper(session_data, (_mali_uk_pp_disable_wb_s __user *)arg);
694 case MALI_IOC_GP2_START_JOB:
695 err = gp_start_job_wrapper(session_data, (_mali_uk_gp_start_job_s __user *)arg);
698 case MALI_IOC_GP2_NUMBER_OF_CORES_GET:
699 err = gp_get_number_of_cores_wrapper(session_data, (_mali_uk_get_gp_number_of_cores_s __user *)arg);
702 case MALI_IOC_GP2_CORE_VERSION_GET:
703 err = gp_get_core_version_wrapper(session_data, (_mali_uk_get_gp_core_version_s __user *)arg);
706 case MALI_IOC_GP2_SUSPEND_RESPONSE:
707 err = gp_suspend_response_wrapper(session_data, (_mali_uk_gp_suspend_response_s __user *)arg);
710 case MALI_IOC_VSYNC_EVENT_REPORT:
711 err = vsync_event_report_wrapper(session_data, (_mali_uk_vsync_event_report_s __user *)arg);
714 case MALI_IOC_STREAM_CREATE:
715 #if defined(CONFIG_SYNC)
717 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
718 err = stream_create_wrapper(session_data, (_mali_uk_stream_create_s __user *)arg);
724 case MALI_IOC_FENCE_VALIDATE:
725 #if defined(CONFIG_SYNC)
727 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
728 err = sync_fence_validate_wrapper(session_data, (_mali_uk_fence_validate_s __user *)arg);
730 MALI_DEBUG_PRINT(2, ("Sync objects not supported\n"));
735 MALI_DEBUG_PRINT(2, ("Sync objects not supported\n"));
740 case MALI_IOC_MEM_GET_BIG_BLOCK: /* Fallthrough */
741 case MALI_IOC_MEM_FREE_BIG_BLOCK:
742 MALI_PRINT_ERROR(("Non-MMU mode is no longer supported.\n"));
747 MALI_DEBUG_PRINT(2, ("No handler for ioctl 0x%08X 0x%08lX\n", cmd, arg));
755 module_init(mali_module_init);
756 module_exit(mali_module_exit);
758 MODULE_LICENSE(MALI_KERNEL_LINUX_LICENSE);
759 MODULE_AUTHOR("ARM Ltd.");
760 MODULE_VERSION(SVN_REV_STRING);