Initial commit
[kernel/linux-3.0.git] / drivers / media / video / samsung / mali_r2p3 / linux / mali_ukk_vsync.c
1 /*
2  * Copyright (C) 2010 ARM Limited. All rights reserved.
3  * 
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.
6  * 
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.
9  */
10 #include <linux/fs.h>       /* file system operations */
11 #include <asm/uaccess.h>    /* user space access */
12
13 #include "mali_ukk.h"
14 #include "mali_osk.h"
15 #include "mali_kernel_common.h"
16 #include "mali_kernel_session_manager.h"
17 #include "mali_ukk_wrappers.h"
18
19
20 int vsync_event_report_wrapper(struct mali_session_data *session_data, _mali_uk_vsync_event_report_s __user *uargs)
21 {
22         _mali_uk_vsync_event_report_s kargs;
23         _mali_osk_errcode_t err;
24
25         MALI_CHECK_NON_NULL(uargs, -EINVAL);
26
27         if (0 != copy_from_user(&kargs, uargs, sizeof(_mali_uk_vsync_event_report_s)))
28         {
29                 return -EFAULT;
30         }
31
32         kargs.ctx = session_data;
33         err = _mali_ukk_vsync_event_report(&kargs);
34         if (_MALI_OSK_ERR_OK != err)
35         {
36                 return map_errcode(err);
37         }
38
39         return 0;
40 }
41