summaryrefslogtreecommitdiff
path: root/include/video/sprd_rotation.h
blob: efbdcfb6586a1b5ac122d104e3912295b7f69c36 (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
/*
 * Copyright (C) 2012 Spreadtrum Communications Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
#ifndef _SPRD_ROTATION_H_
#define _SPRD_ROTATION_H_

typedef enum {
	ROTATION_YUV422 = 0,
	ROTATION_YUV420,
	ROTATION_YUV400,
	ROTATION_RGB888,
	ROTATION_RGB666,
	ROTATION_RGB565,
	ROTATION_RGB555,
	ROTATION_MAX
} ROTATION_DATA_FORMAT_E;

typedef enum {
	ROTATION_90 = 0,
	ROTATION_270,
	ROTATION_180,
	ROTATION_MIRROR,
	ROTATION_DIR_MAX
} ROTATION_DIR_E;

typedef struct _rotation_size_tag {
	uint16_t w;
	uint16_t h;
} ROTATION_SIZE_T;

typedef struct _ROTATION_data_addr_tag {
	uint32_t y_addr;
	uint32_t uv_addr;
	uint32_t v_addr;
} ROTATION_DATA_ADDR_T;
typedef struct _rotation_tag {
	ROTATION_SIZE_T         img_size;
	ROTATION_DATA_FORMAT_E   data_format;
	ROTATION_DIR_E         rotation_dir; 
	ROTATION_DATA_ADDR_T    src_addr;
	ROTATION_DATA_ADDR_T    dst_addr;     
}ROTATION_PARAM_T, *ROTATION_PARAM_T_PTR;

int rotation_start(ROTATION_PARAM_T* param_ptr);
int rotation_IOinit(void);
int rotation_IOdeinit(void);

#define SPRD_ROTATION_IOCTL_MAGIC 'm'
#define SPRD_ROTATION_DONE _IOW(SPRD_ROTATION_IOCTL_MAGIC, 1, unsigned int)
#define SPRD_ROTATION_DATA_COPY _IOW(SPRD_ROTATION_IOCTL_MAGIC, 2, unsigned int)
#define SPRD_ROTATION_DATA_COPY_VIRTUAL _IOW(SPRD_ROTATION_IOCTL_MAGIC, 3, unsigned int)
#define SPRD_ROTATION_DATA_COPY_FROM_V_TO_P _IOW(SPRD_ROTATION_IOCTL_MAGIC, 4, unsigned int)
#endif