xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/mali400/umplock/umplock_ioctl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (C) 2012-2013, 2016-2017 ARM Limited. All rights reserved.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5*4882a593Smuzhiyun  * 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*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * A copy of the licence is included with the program, and can also be obtained from Free Software
8*4882a593Smuzhiyun  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #ifndef __UMPLOCK_IOCTL_H__
12*4882a593Smuzhiyun #define __UMPLOCK_IOCTL_H__
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #ifdef __cplusplus
15*4882a593Smuzhiyun extern "C" {
16*4882a593Smuzhiyun #endif
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun #include <linux/types.h>
19*4882a593Smuzhiyun #include <linux/ioctl.h>
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #ifndef __user
22*4882a593Smuzhiyun #define __user
23*4882a593Smuzhiyun #endif
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun /**
27*4882a593Smuzhiyun  * @file umplock_ioctl.h
28*4882a593Smuzhiyun  * This file describes the interface needed to use the Linux device driver.
29*4882a593Smuzhiyun  * The interface is used by the userpace Mali DDK.
30*4882a593Smuzhiyun  */
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun typedef enum {
33*4882a593Smuzhiyun 	_LOCK_ACCESS_RENDERABLE = 1,
34*4882a593Smuzhiyun 	_LOCK_ACCESS_TEXTURE,
35*4882a593Smuzhiyun 	_LOCK_ACCESS_CPU_WRITE,
36*4882a593Smuzhiyun 	_LOCK_ACCESS_CPU_READ,
37*4882a593Smuzhiyun } _lock_access_usage;
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun typedef struct _lock_item_s {
40*4882a593Smuzhiyun 	unsigned int secure_id;
41*4882a593Smuzhiyun 	_lock_access_usage usage;
42*4882a593Smuzhiyun } _lock_item_s;
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun #define LOCK_IOCTL_GROUP 0x91
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun #define _LOCK_IOCTL_CREATE_CMD  0   /* create kernel lock item        */
48*4882a593Smuzhiyun #define _LOCK_IOCTL_PROCESS_CMD 1   /* process kernel lock item       */
49*4882a593Smuzhiyun #define _LOCK_IOCTL_RELEASE_CMD 2   /* release kernel lock item       */
50*4882a593Smuzhiyun #define _LOCK_IOCTL_ZAP_CMD     3   /* clean up all kernel lock items */
51*4882a593Smuzhiyun #define _LOCK_IOCTL_DUMP_CMD    4   /* dump all the items */
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun #define LOCK_IOCTL_MAX_CMDS     5
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun #define LOCK_IOCTL_CREATE  _IOW( LOCK_IOCTL_GROUP, _LOCK_IOCTL_CREATE_CMD,  _lock_item_s )
56*4882a593Smuzhiyun #define LOCK_IOCTL_PROCESS _IOW( LOCK_IOCTL_GROUP, _LOCK_IOCTL_PROCESS_CMD, _lock_item_s )
57*4882a593Smuzhiyun #define LOCK_IOCTL_RELEASE _IOW( LOCK_IOCTL_GROUP, _LOCK_IOCTL_RELEASE_CMD, _lock_item_s )
58*4882a593Smuzhiyun #define LOCK_IOCTL_ZAP     _IO ( LOCK_IOCTL_GROUP, _LOCK_IOCTL_ZAP_CMD )
59*4882a593Smuzhiyun #define LOCK_IOCTL_DUMP    _IO ( LOCK_IOCTL_GROUP, _LOCK_IOCTL_DUMP_CMD )
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun #ifdef __cplusplus
62*4882a593Smuzhiyun }
63*4882a593Smuzhiyun #endif
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun #endif /* __UMPLOCK_IOCTL_H__ */
66*4882a593Smuzhiyun 
67