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.
10 #include <linux/fs.h> /* file system operations */
11 #include <asm/uaccess.h> /* user space access */
15 #include "mali_kernel_common.h"
16 #include "mali_session.h"
17 #include "mali_ukk_wrappers.h"
19 int pp_start_job_wrapper(struct mali_session_data *session_data, _mali_uk_pp_start_job_s __user *uargs)
21 _mali_osk_errcode_t err;
24 MALI_CHECK_NON_NULL(uargs, -EINVAL);
25 MALI_CHECK_NON_NULL(session_data, -EINVAL);
27 err = _mali_ukk_pp_start_job(session_data, uargs, &fence);
28 if (_MALI_OSK_ERR_OK != err) return map_errcode(err);
32 if (0 != put_user(fence, &uargs->fence)) return -EFAULT;
38 int pp_get_number_of_cores_wrapper(struct mali_session_data *session_data, _mali_uk_get_pp_number_of_cores_s __user *uargs)
40 _mali_uk_get_pp_number_of_cores_s kargs;
41 _mali_osk_errcode_t err;
43 MALI_CHECK_NON_NULL(uargs, -EINVAL);
44 MALI_CHECK_NON_NULL(session_data, -EINVAL);
46 kargs.ctx = session_data;
47 err = _mali_ukk_get_pp_number_of_cores(&kargs);
48 if (_MALI_OSK_ERR_OK != err) return map_errcode(err);
50 if (0 != put_user(kargs.number_of_cores, &uargs->number_of_cores)) return -EFAULT;
55 int pp_get_core_version_wrapper(struct mali_session_data *session_data, _mali_uk_get_pp_core_version_s __user *uargs)
57 _mali_uk_get_pp_core_version_s kargs;
58 _mali_osk_errcode_t err;
60 MALI_CHECK_NON_NULL(uargs, -EINVAL);
61 MALI_CHECK_NON_NULL(session_data, -EINVAL);
63 kargs.ctx = session_data;
64 err = _mali_ukk_get_pp_core_version(&kargs);
65 if (_MALI_OSK_ERR_OK != err) return map_errcode(err);
67 if (0 != put_user(kargs.version, &uargs->version)) return -EFAULT;
72 int pp_disable_wb_wrapper(struct mali_session_data *session_data, _mali_uk_pp_disable_wb_s __user *uargs)
74 _mali_uk_pp_disable_wb_s kargs;
76 MALI_CHECK_NON_NULL(uargs, -EINVAL);
77 MALI_CHECK_NON_NULL(session_data, -EINVAL);
79 if (0 != copy_from_user(&kargs, uargs, sizeof(_mali_uk_pp_disable_wb_s))) return -EFAULT;
81 kargs.ctx = session_data;
82 _mali_ukk_pp_job_disable_wb(&kargs);