• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * drivers/video/fbdev/sunxi/disp2/disp/fb_g2d_rot/fb_g2d_rot.h
3  *
4  * Copyright (c) 2007-2019 Allwinnertech Co., Ltd.
5  * Author: zhengxiaobin <zhengxiaobin@allwinnertech.com>
6  *
7  * This software is licensed under the terms of the GNU General Public
8  * License version 2, as published by the Free Software Foundation, and
9  * may be copied, distributed, and modified under those terms.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17 #ifndef _FB_G2D_ROT_H
18 #define _FB_G2D_ROT_H
19 
20 #include "disp_sys_intf.h"
21 #include <sunxi-g2d.h>
22 #include "de/disp_features.h"
23 #include <linux/fb.h>
24 #include <video/sunxi_display2.h>
25 #include "dev_disp.h"
26 
27 
28 enum {
29 	FB_ROTATION_HW_0 = 0,
30 	FB_ROTATION_HW_90 = 1,
31 	FB_ROTATION_HW_180 = 2,
32 	FB_ROTATION_HW_270 = 3,
33 };
34 
35 struct fb_g2d_rot_t {
36 	g2d_blt_h info;
37 	void *dst_vir_addr;
38 	dma_addr_t dst_phy_addr;
39 	unsigned int dst_mem_len;
40 	struct fb_info *fb;
41 	int switch_buffer_flag;
42 	int (*apply)(struct fb_g2d_rot_t *inst,
43 		     struct disp_layer_config *config);
44 	int (*free)(struct fb_g2d_rot_t *inst);
45 	int (*set_degree)(struct fb_g2d_rot_t *inst,
46 		      struct disp_layer_config *config, unsigned int degree);
47 };
48 
49 struct fb_g2d_rot_t *fb_g2d_rot_create(struct fb_info *p_info,
50 				       unsigned int fb_id,
51 				       struct disp_layer_config *config);
52 
53 #endif /*End of file*/
54