1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _MSM_MDP_EXT_H_ 20 #define _MSM_MDP_EXT_H_ 21 #include <linux/msm_mdp.h> 22 #define MDP_IOCTL_MAGIC 'S' 23 #define MSMFB_ATOMIC_COMMIT _IOWR(MDP_IOCTL_MAGIC, 128, void *) 24 #define MSMFB_ASYNC_POSITION_UPDATE _IOWR(MDP_IOCTL_MAGIC, 129, struct mdp_position_update) 25 #define MSMFB_MDP_SET_CFG _IOW(MDP_IOCTL_MAGIC, 130, struct mdp_set_cfg) 26 #ifdef __LP64 27 #define MDP_LAYER_COMMIT_V1_PAD 1 28 #else 29 #define MDP_LAYER_COMMIT_V1_PAD 2 30 #endif 31 #define MDP_LAYER_FLIP_LR 0x1 32 #define MDP_LAYER_FLIP_UD 0x2 33 #define MDP_LAYER_ENABLE_PIXEL_EXT 0x4 34 #define MDP_LAYER_FORGROUND 0x8 35 #define MDP_LAYER_SECURE_SESSION 0x10 36 #define MDP_LAYER_SOLID_FILL 0x20 37 #define MDP_LAYER_DEINTERLACE 0x40 38 #define MDP_LAYER_BWC 0x80 39 #define MDP_LAYER_ASYNC 0x100 40 #define MDP_LAYER_PP 0x200 41 #define MDP_LAYER_SECURE_DISPLAY_SESSION 0x400 42 #define MDP_LAYER_ENABLE_QSEED3_SCALE 0x800 43 #define MDP_LAYER_MULTIRECT_ENABLE 0x1000 44 #define MDP_LAYER_MULTIRECT_PARALLEL_MODE 0x2000 45 #define MDP_DESTSCALER_ENABLE 0x1 46 #define MDP_DESTSCALER_SCALE_UPDATE 0x2 47 #define MDP_DESTSCALER_ENHANCER_UPDATE 0x4 48 #define MDP_VALIDATE_LAYER 0x01 49 #define MDP_COMMIT_WAIT_FOR_FINISH 0x02 50 #define MDP_COMMIT_SYNC_FENCE_WAIT 0x04 51 #define MDP_COMMIT_AVR_EN 0x08 52 #define MDP_COMMIT_AVR_ONE_SHOT_MODE 0x10 53 #define MDP_COMMIT_UPDATE_BRIGHTNESS 0x40 54 #define MDP_COMMIT_CWB_EN 0x800 55 #define MDP_COMMIT_CWB_DSPP 0x1000 56 #define MDP_COMMIT_VERSION_1_0 0x00010000 57 struct mdp_layer_plane { 58 int fd; 59 uint32_t offset; 60 uint32_t stride; 61 }; 62 struct mdp_layer_buffer { 63 uint32_t width; 64 uint32_t height; 65 uint32_t format; 66 struct mdp_layer_plane planes[MAX_PLANES]; 67 uint32_t plane_count; 68 struct mult_factor comp_ratio; 69 int fence; 70 uint32_t reserved; 71 }; 72 struct mdp_input_layer { 73 uint32_t flags; 74 uint32_t pipe_ndx; 75 uint8_t horz_deci; 76 uint8_t vert_deci; 77 uint8_t alpha; 78 uint16_t z_order; 79 uint32_t transp_mask; 80 uint32_t bg_color; 81 enum mdss_mdp_blend_op blend_op; 82 enum mdp_color_space color_space; 83 struct mdp_rect src_rect; 84 struct mdp_rect dst_rect; 85 void * scale; 86 struct mdp_layer_buffer buffer; 87 void * pp_info; 88 int error_code; 89 uint32_t reserved[6]; 90 }; 91 struct mdp_output_layer { 92 uint32_t flags; 93 uint32_t writeback_ndx; 94 struct mdp_layer_buffer buffer; 95 enum mdp_color_space color_space; 96 uint32_t reserved[5]; 97 }; 98 struct mdp_destination_scaler_data { 99 uint32_t flags; 100 uint32_t dest_scaler_ndx; 101 uint32_t lm_width; 102 uint32_t lm_height; 103 uint64_t scale; 104 }; 105 #define MDP_VIDEO_FRC_ENABLE (1 << 0) 106 struct mdp_frc_info { 107 uint32_t flags; 108 uint32_t frame_cnt; 109 int64_t timestamp; 110 }; 111 struct mdp_layer_commit_v1 { 112 uint32_t flags; 113 int release_fence; 114 struct mdp_rect left_roi; 115 struct mdp_rect right_roi; 116 struct mdp_input_layer * input_layers; 117 uint32_t input_layer_cnt; 118 struct mdp_output_layer * output_layer; 119 int retire_fence; 120 void * dest_scaler; 121 uint32_t dest_scaler_cnt; 122 struct mdp_frc_info * frc_info; 123 uint32_t bl_level; 124 uint32_t reserved[MDP_LAYER_COMMIT_V1_PAD]; 125 }; 126 struct mdp_layer_commit { 127 uint32_t version; 128 union { 129 struct mdp_layer_commit_v1 commit_v1; 130 }; 131 }; 132 struct mdp_point { 133 uint32_t x; 134 uint32_t y; 135 }; 136 struct mdp_async_layer { 137 uint32_t flags; 138 uint32_t pipe_ndx; 139 struct mdp_point src; 140 struct mdp_point dst; 141 int error_code; 142 uint32_t reserved[3]; 143 }; 144 struct mdp_position_update { 145 struct mdp_async_layer * input_layers; 146 uint32_t input_layer_cnt; 147 }; 148 #define MAX_DET_CURVES 3 149 struct mdp_det_enhance_data { 150 uint32_t enable; 151 int16_t sharpen_level1; 152 int16_t sharpen_level2; 153 uint16_t clip; 154 uint16_t limit; 155 uint16_t thr_quiet; 156 uint16_t thr_dieout; 157 uint16_t thr_low; 158 uint16_t thr_high; 159 uint16_t prec_shift; 160 int16_t adjust_a[MAX_DET_CURVES]; 161 int16_t adjust_b[MAX_DET_CURVES]; 162 int16_t adjust_c[MAX_DET_CURVES]; 163 }; 164 #define ENABLE_SCALE 0x1 165 #define ENABLE_DETAIL_ENHANCE 0x2 166 #define ENABLE_DIRECTION_DETECTION 0x4 167 #define SCALER_LUT_SWAP 0x1 168 #define SCALER_LUT_DIR_WR 0x2 169 #define SCALER_LUT_Y_CIR_WR 0x4 170 #define SCALER_LUT_UV_CIR_WR 0x8 171 #define SCALER_LUT_Y_SEP_WR 0x10 172 #define SCALER_LUT_UV_SEP_WR 0x20 173 #define FILTER_EDGE_DIRECTED_2D 0x0 174 #define FILTER_CIRCULAR_2D 0x1 175 #define FILTER_SEPARABLE_1D 0x2 176 #define FILTER_BILINEAR 0x3 177 #define FILTER_ALPHA_DROP_REPEAT 0x0 178 #define FILTER_ALPHA_BILINEAR 0x1 179 struct mdp_scale_data_v2 { 180 uint32_t enable; 181 int32_t init_phase_x[MAX_PLANES]; 182 int32_t phase_step_x[MAX_PLANES]; 183 int32_t init_phase_y[MAX_PLANES]; 184 int32_t phase_step_y[MAX_PLANES]; 185 uint32_t num_ext_pxls_left[MAX_PLANES]; 186 uint32_t num_ext_pxls_right[MAX_PLANES]; 187 uint32_t num_ext_pxls_top[MAX_PLANES]; 188 uint32_t num_ext_pxls_btm[MAX_PLANES]; 189 int32_t left_ftch[MAX_PLANES]; 190 int32_t left_rpt[MAX_PLANES]; 191 int32_t right_ftch[MAX_PLANES]; 192 int32_t right_rpt[MAX_PLANES]; 193 uint32_t top_rpt[MAX_PLANES]; 194 uint32_t btm_rpt[MAX_PLANES]; 195 uint32_t top_ftch[MAX_PLANES]; 196 uint32_t btm_ftch[MAX_PLANES]; 197 uint32_t roi_w[MAX_PLANES]; 198 uint32_t preload_x[MAX_PLANES]; 199 uint32_t preload_y[MAX_PLANES]; 200 uint32_t src_width[MAX_PLANES]; 201 uint32_t src_height[MAX_PLANES]; 202 uint32_t dst_width; 203 uint32_t dst_height; 204 uint32_t y_rgb_filter_cfg; 205 uint32_t uv_filter_cfg; 206 uint32_t alpha_filter_cfg; 207 uint32_t blend_cfg; 208 uint32_t lut_flag; 209 uint32_t dir_lut_idx; 210 uint32_t y_rgb_cir_lut_idx; 211 uint32_t uv_cir_lut_idx; 212 uint32_t y_rgb_sep_lut_idx; 213 uint32_t uv_sep_lut_idx; 214 struct mdp_det_enhance_data detail_enhance; 215 uint64_t reserved[8]; 216 }; 217 struct mdp_scale_luts_info { 218 uint64_t dir_lut; 219 uint64_t cir_lut; 220 uint64_t sep_lut; 221 uint32_t dir_lut_size; 222 uint32_t cir_lut_size; 223 uint32_t sep_lut_size; 224 }; 225 #define MDP_QSEED3_LUT_CFG 0x1 226 struct mdp_set_cfg { 227 uint64_t flags; 228 uint32_t len; 229 uint64_t payload; 230 }; 231 #endif 232