1 /* 2 * Allwinner SoCs display driver. 3 * 4 * Copyright (C) 2017 Allwinner. 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 */ 10 11 #ifndef _DE_VSU_H_ 12 #define _DE_VSU_H_ 13 14 #include <linux/types.h> 15 #include "de_rtmx.h" 16 17 enum { 18 VSU_EXPAND_OUTWIDTH = 0x00000001, 19 VSU_EXPAND_OUTHEIGHT = 0x00000002, 20 VSU_EXPAND_INWIDTH = 0x00000004, 21 VSU_EXPAND_INHEIGHT = 0x00000008, 22 VSU_RSHIFT_OUTWINDOW = 0x00000010, 23 VSU_RSHIFT_INWINDOW = 0x00000020, 24 VSU_LSHIFT_OUTWINDOW = 0x00000040, 25 VSU_LSHIFT_INWINDOW = 0x00000080, 26 VSU_USHIFT_OUTWINDOW = 0x00000100, 27 VSU_USHIFT_INWINDOW = 0x00000200, 28 VSU_DSHIFT_OUTWINDOW = 0x00000400, 29 VSU_DSHIFT_INWINDOW = 0x00000800, 30 VSU_CUT_OUTWIDTH = 0x00001000, 31 VSU_CUT_OUTHEIGHT = 0x00002000, 32 VSU_CUT_INWIDTH = 0x00004000, 33 VSU_CUT_INHEIGHT = 0x00008000, 34 RTMX_CUT_INHEIGHT = 0x10000000, 35 }; 36 37 struct de_vsu_sharp_config { 38 /* peak2d */ 39 u32 level; /* detail level */ 40 41 /* size */ 42 s32 inw; /* overlay width */ 43 s32 inh; /* overlay height */ 44 s32 outw; /* overlay scale width */ 45 s32 outh; /* overlay scale height */ 46 47 }; 48 49 s32 de_vsu_calc_lay_scale_para(u32 disp, u32 chn, 50 enum de_format_space fm_space, struct de_chn_info *chn_info, 51 struct de_rect64_s *crop64, struct de_rect_s *scn_win, 52 struct de_rect_s *crop32, struct de_scale_para *ypara, 53 struct de_scale_para *cpara); 54 55 u32 de_vsu_calc_ovl_coord(u32 disp, u32 chn, 56 u32 dst_coord, u32 scale_step); 57 s32 de_vsu_calc_ovl_scale_para(u32 layer_num, 58 struct de_scale_para *ypara, struct de_scale_para *cpara, 59 struct de_scale_para *ovl_ypara, struct de_scale_para *ovl_cpara); 60 u32 de_vsu_fix_tiny_size(u32 disp, u32 chn, 61 struct de_rect_s *in_win, struct de_rect_s *out_win, 62 struct de_scale_para *ypara, enum de_format_space fmt_space, 63 struct de_rect_s *lay_win, u32 lay_num, 64 u32 scn_width, u32 scn_height); 65 u32 de_vsu_fix_big_size(u32 disp, u32 chn, 66 struct de_rect_s *in_win, struct de_rect_s *out_win, 67 enum de_format_space fmt_space, enum de_yuv_sampling yuv_sampling); 68 s32 de_vsu_calc_scale_para(u32 fix_size_result, 69 enum de_format_space fmt_space, enum de_yuv_sampling yuv_sampling, 70 struct de_rect_s *out_win, 71 struct de_rect_s *ywin, struct de_rect_s *cwin, 72 struct de_scale_para *ypara, struct de_scale_para *cpara); 73 74 s32 de_vsu_set_para(u32 disp, u32 chn, 75 struct de_chn_info *chn_info); 76 s32 de_vsu_disable(u32 disp, u32 chn); 77 78 s32 de_vsu_init_sharp_para(u32 disp, u32 chn); 79 s32 de_vsu_set_sharp_para(u32 disp, u32 chn, 80 u32 fmt, u32 dev_type, 81 struct de_vsu_sharp_config *para, u32 bypass); 82 83 s32 de_vsu_init(u32 disp, u8 __iomem *de_reg_base); 84 s32 de_vsu_exit(u32 disp); 85 s32 de_vsu_get_reg_blocks(u32 disp, 86 struct de_reg_block **blks, u32 *blk_num); 87 88 #endif /* #ifndef _DE_CDC_H_ */ 89