summaryrefslogtreecommitdiff
path: root/original-kernel-headers/linux/mdss_rotator.h
blob: cc30aaa61b2f59f7f8d83f8fe40b4d783ff96d06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef _UAPI_MDSS_ROTATOR_H_
#define _UAPI_MDSS_ROTATOR_H_

#include <linux/msm_mdp_ext.h>

#define MDSS_ROTATOR_IOCTL_MAGIC 'w'

/* open a rotation session */
#define MDSS_ROTATION_OPEN \
	_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 1, struct mdp_rotation_config *)

/* change the rotation session configuration */
#define MDSS_ROTATION_CONFIG \
	_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 2, struct mdp_rotation_config *)

/* queue the rotation request */
#define MDSS_ROTATION_REQUEST \
	_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 3, struct mdp_rotation_request *)

/* close a rotation session with the specified rotation session ID */
#define MDSS_ROTATION_CLOSE	_IOW(MDSS_ROTATOR_IOCTL_MAGIC, 4, unsigned int)

/**********************************************************************
Rotation request flag
**********************************************************************/
/* no rotation flag, i.e. color space conversion */
#define MDP_ROTATION_NOP	0x01

/* left/right flip */
#define MDP_ROTATION_FLIP_LR	0x02

/* up/down flip */
#define MDP_ROTATION_FLIP_UD	0x04

/* rotate 90 degree */
#define MDP_ROTATION_90		0x08

/* rotate 180 degre */
#define MDP_ROTATION_180	(MDP_ROTATION_FLIP_LR | MDP_ROTATION_FLIP_UD)

/* rotate 270 degree */
#define MDP_ROTATION_270	(MDP_ROTATION_90 | MDP_ROTATION_180)

/* format is interlaced */
#define MDP_ROTATION_DEINTERLACE 0x10

/* enable bwc */
#define MDP_ROTATION_BWC_EN	0x40

/* secure data */
#define MDP_ROTATION_SECURE	0x80

/**********************************************************************
Rotation commit flag
**********************************************************************/
/* Flag indicates to validate the rotation request */
#define MDSS_ROTATION_REQUEST_VALIDATE	0x01

#define MDP_ROTATION_REQUEST_VERSION_1_0	0x00010000

/*
 * Client can let driver to allocate the hardware resources with
 * this particular hw resource id.
 */
#define MDSS_ROTATION_HW_ANY	0xFFFFFFFF

/**********************************************************************
configuration structures
**********************************************************************/
struct mdp_rotation_buf_info {
	uint32_t width;
	uint32_t height;
	uint32_t format;
	struct mult_factor comp_ratio;
};

struct mdp_rotation_config {
	uint32_t	version;
	uint32_t	session_id;
	struct mdp_rotation_buf_info	input;
	struct mdp_rotation_buf_info	output;
	uint32_t	frame_rate;
	uint32_t	flags;
	uint32_t	reserved[6];
};

struct mdp_rotation_item {
	/* rotation request flag */
	uint32_t	flags;

	/* Source crop rectangle */
	struct mdp_rect	src_rect;

	/* Destination rectangle */
	struct mdp_rect	dst_rect;

	/* Input buffer for the request */
	struct mdp_layer_buffer	input;

	/* The output buffer for the request */
	struct mdp_layer_buffer	output;

	/*
	  * DMA pipe selection for this request by client:
	  * 0: DMA pipe 0
	  * 1: DMA pipe 1
	  * or MDSS_ROTATION_HW_ANY if client wants
	  * driver to allocate any that is available
	  */
	uint32_t	pipe_idx;

	/*
	  * Write-back block selection for this request by client:
	  * 0: Write-back block 0
	  * 1: Write-back block 1
	  * or MDSS_ROTATION_HW_ANY if client wants
	  * driver to allocate any that is available
	  */
	uint32_t	wb_idx;

	/* Which session ID is this request scheduled on */
	uint32_t	session_id;

	/* 32bits reserved value for future usage */
	uint32_t	reserved[6];
};

struct mdp_rotation_request {
	/* 32bit version indicates the request structure */
	uint32_t	version;

	uint32_t	flags;

	/* Number of rotation request items in the list */
	uint32_t	count;

	/* Pointer to a list of rotation request items */
	struct mdp_rotation_item __user	*list;

	/* 32bits reserved value for future usage*/
	uint32_t	reserved[6];
};

#endif /*_UAPI_MDSS_ROTATOR_H_*/