162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd 462306a36Sopenharmony_ci * Author: Jacob Chen <jacob-chen@iotwrt.com> 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci#ifndef __RGA_HW_H__ 762306a36Sopenharmony_ci#define __RGA_HW_H__ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#define RGA_CMDBUF_SIZE 0x20 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci/* Hardware limits */ 1262306a36Sopenharmony_ci#define MAX_WIDTH 8192 1362306a36Sopenharmony_ci#define MAX_HEIGHT 8192 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#define MIN_WIDTH 34 1662306a36Sopenharmony_ci#define MIN_HEIGHT 34 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#define DEFAULT_WIDTH 100 1962306a36Sopenharmony_ci#define DEFAULT_HEIGHT 100 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#define RGA_TIMEOUT 500 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* Registers address */ 2462306a36Sopenharmony_ci#define RGA_SYS_CTRL 0x0000 2562306a36Sopenharmony_ci#define RGA_CMD_CTRL 0x0004 2662306a36Sopenharmony_ci#define RGA_CMD_BASE 0x0008 2762306a36Sopenharmony_ci#define RGA_INT 0x0010 2862306a36Sopenharmony_ci#define RGA_MMU_CTRL0 0x0014 2962306a36Sopenharmony_ci#define RGA_VERSION_INFO 0x0028 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci#define RGA_MODE_BASE_REG 0x0100 3262306a36Sopenharmony_ci#define RGA_MODE_MAX_REG 0x017C 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define RGA_MODE_CTRL 0x0100 3562306a36Sopenharmony_ci#define RGA_SRC_INFO 0x0104 3662306a36Sopenharmony_ci#define RGA_SRC_Y_RGB_BASE_ADDR 0x0108 3762306a36Sopenharmony_ci#define RGA_SRC_CB_BASE_ADDR 0x010c 3862306a36Sopenharmony_ci#define RGA_SRC_CR_BASE_ADDR 0x0110 3962306a36Sopenharmony_ci#define RGA_SRC1_RGB_BASE_ADDR 0x0114 4062306a36Sopenharmony_ci#define RGA_SRC_VIR_INFO 0x0118 4162306a36Sopenharmony_ci#define RGA_SRC_ACT_INFO 0x011c 4262306a36Sopenharmony_ci#define RGA_SRC_X_FACTOR 0x0120 4362306a36Sopenharmony_ci#define RGA_SRC_Y_FACTOR 0x0124 4462306a36Sopenharmony_ci#define RGA_SRC_BG_COLOR 0x0128 4562306a36Sopenharmony_ci#define RGA_SRC_FG_COLOR 0x012c 4662306a36Sopenharmony_ci#define RGA_SRC_TR_COLOR0 0x0130 4762306a36Sopenharmony_ci#define RGA_SRC_TR_COLOR1 0x0134 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci#define RGA_DST_INFO 0x0138 5062306a36Sopenharmony_ci#define RGA_DST_Y_RGB_BASE_ADDR 0x013c 5162306a36Sopenharmony_ci#define RGA_DST_CB_BASE_ADDR 0x0140 5262306a36Sopenharmony_ci#define RGA_DST_CR_BASE_ADDR 0x0144 5362306a36Sopenharmony_ci#define RGA_DST_VIR_INFO 0x0148 5462306a36Sopenharmony_ci#define RGA_DST_ACT_INFO 0x014c 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci#define RGA_ALPHA_CTRL0 0x0150 5762306a36Sopenharmony_ci#define RGA_ALPHA_CTRL1 0x0154 5862306a36Sopenharmony_ci#define RGA_FADING_CTRL 0x0158 5962306a36Sopenharmony_ci#define RGA_PAT_CON 0x015c 6062306a36Sopenharmony_ci#define RGA_ROP_CON0 0x0160 6162306a36Sopenharmony_ci#define RGA_ROP_CON1 0x0164 6262306a36Sopenharmony_ci#define RGA_MASK_BASE 0x0168 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define RGA_MMU_CTRL1 0x016C 6562306a36Sopenharmony_ci#define RGA_MMU_SRC_BASE 0x0170 6662306a36Sopenharmony_ci#define RGA_MMU_SRC1_BASE 0x0174 6762306a36Sopenharmony_ci#define RGA_MMU_DST_BASE 0x0178 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* Registers value */ 7062306a36Sopenharmony_ci#define RGA_MODE_RENDER_BITBLT 0 7162306a36Sopenharmony_ci#define RGA_MODE_RENDER_COLOR_PALETTE 1 7262306a36Sopenharmony_ci#define RGA_MODE_RENDER_RECTANGLE_FILL 2 7362306a36Sopenharmony_ci#define RGA_MODE_RENDER_UPDATE_PALETTE_LUT_RAM 3 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci#define RGA_MODE_BITBLT_MODE_SRC_TO_DST 0 7662306a36Sopenharmony_ci#define RGA_MODE_BITBLT_MODE_SRC_SRC1_TO_DST 1 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci#define RGA_MODE_CF_ROP4_SOLID 0 7962306a36Sopenharmony_ci#define RGA_MODE_CF_ROP4_PATTERN 1 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci#define RGA_COLOR_FMT_ABGR8888 0 8262306a36Sopenharmony_ci#define RGA_COLOR_FMT_XBGR8888 1 8362306a36Sopenharmony_ci#define RGA_COLOR_FMT_RGB888 2 8462306a36Sopenharmony_ci#define RGA_COLOR_FMT_BGR565 4 8562306a36Sopenharmony_ci#define RGA_COLOR_FMT_ABGR1555 5 8662306a36Sopenharmony_ci#define RGA_COLOR_FMT_ABGR4444 6 8762306a36Sopenharmony_ci#define RGA_COLOR_FMT_YUV422SP 8 8862306a36Sopenharmony_ci#define RGA_COLOR_FMT_YUV422P 9 8962306a36Sopenharmony_ci#define RGA_COLOR_FMT_YUV420SP 10 9062306a36Sopenharmony_ci#define RGA_COLOR_FMT_YUV420P 11 9162306a36Sopenharmony_ci/* SRC_COLOR Palette */ 9262306a36Sopenharmony_ci#define RGA_COLOR_FMT_CP_1BPP 12 9362306a36Sopenharmony_ci#define RGA_COLOR_FMT_CP_2BPP 13 9462306a36Sopenharmony_ci#define RGA_COLOR_FMT_CP_4BPP 14 9562306a36Sopenharmony_ci#define RGA_COLOR_FMT_CP_8BPP 15 9662306a36Sopenharmony_ci#define RGA_COLOR_FMT_MASK 15 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci#define RGA_COLOR_FMT_IS_YUV(fmt) \ 9962306a36Sopenharmony_ci (((fmt) >= RGA_COLOR_FMT_YUV422SP) && ((fmt) < RGA_COLOR_FMT_CP_1BPP)) 10062306a36Sopenharmony_ci#define RGA_COLOR_FMT_IS_RGB(fmt) \ 10162306a36Sopenharmony_ci ((fmt) < RGA_COLOR_FMT_YUV422SP) 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci#define RGA_COLOR_NONE_SWAP 0 10462306a36Sopenharmony_ci#define RGA_COLOR_RB_SWAP 1 10562306a36Sopenharmony_ci#define RGA_COLOR_ALPHA_SWAP 2 10662306a36Sopenharmony_ci#define RGA_COLOR_UV_SWAP 4 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci#define RGA_SRC_CSC_MODE_BYPASS 0 10962306a36Sopenharmony_ci#define RGA_SRC_CSC_MODE_BT601_R0 1 11062306a36Sopenharmony_ci#define RGA_SRC_CSC_MODE_BT601_R1 2 11162306a36Sopenharmony_ci#define RGA_SRC_CSC_MODE_BT709_R0 3 11262306a36Sopenharmony_ci#define RGA_SRC_CSC_MODE_BT709_R1 4 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci#define RGA_SRC_ROT_MODE_0_DEGREE 0 11562306a36Sopenharmony_ci#define RGA_SRC_ROT_MODE_90_DEGREE 1 11662306a36Sopenharmony_ci#define RGA_SRC_ROT_MODE_180_DEGREE 2 11762306a36Sopenharmony_ci#define RGA_SRC_ROT_MODE_270_DEGREE 3 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci#define RGA_SRC_MIRR_MODE_NO 0 12062306a36Sopenharmony_ci#define RGA_SRC_MIRR_MODE_X 1 12162306a36Sopenharmony_ci#define RGA_SRC_MIRR_MODE_Y 2 12262306a36Sopenharmony_ci#define RGA_SRC_MIRR_MODE_X_Y 3 12362306a36Sopenharmony_ci 12462306a36Sopenharmony_ci#define RGA_SRC_HSCL_MODE_NO 0 12562306a36Sopenharmony_ci#define RGA_SRC_HSCL_MODE_DOWN 1 12662306a36Sopenharmony_ci#define RGA_SRC_HSCL_MODE_UP 2 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci#define RGA_SRC_VSCL_MODE_NO 0 12962306a36Sopenharmony_ci#define RGA_SRC_VSCL_MODE_DOWN 1 13062306a36Sopenharmony_ci#define RGA_SRC_VSCL_MODE_UP 2 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci#define RGA_SRC_TRANS_ENABLE_R 1 13362306a36Sopenharmony_ci#define RGA_SRC_TRANS_ENABLE_G 2 13462306a36Sopenharmony_ci#define RGA_SRC_TRANS_ENABLE_B 4 13562306a36Sopenharmony_ci#define RGA_SRC_TRANS_ENABLE_A 8 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_ci#define RGA_SRC_BIC_COE_SELEC_CATROM 0 13862306a36Sopenharmony_ci#define RGA_SRC_BIC_COE_SELEC_MITCHELL 1 13962306a36Sopenharmony_ci#define RGA_SRC_BIC_COE_SELEC_HERMITE 2 14062306a36Sopenharmony_ci#define RGA_SRC_BIC_COE_SELEC_BSPLINE 3 14162306a36Sopenharmony_ci 14262306a36Sopenharmony_ci#define RGA_DST_DITHER_MODE_888_TO_666 0 14362306a36Sopenharmony_ci#define RGA_DST_DITHER_MODE_888_TO_565 1 14462306a36Sopenharmony_ci#define RGA_DST_DITHER_MODE_888_TO_555 2 14562306a36Sopenharmony_ci#define RGA_DST_DITHER_MODE_888_TO_444 3 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ci#define RGA_DST_CSC_MODE_BYPASS 0 14862306a36Sopenharmony_ci#define RGA_DST_CSC_MODE_BT601_R0 1 14962306a36Sopenharmony_ci#define RGA_DST_CSC_MODE_BT601_R1 2 15062306a36Sopenharmony_ci#define RGA_DST_CSC_MODE_BT709_R0 3 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_ci#define RGA_ALPHA_ROP_MODE_2 0 15362306a36Sopenharmony_ci#define RGA_ALPHA_ROP_MODE_3 1 15462306a36Sopenharmony_ci#define RGA_ALPHA_ROP_MODE_4 2 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci#define RGA_ALPHA_SELECT_ALPHA 0 15762306a36Sopenharmony_ci#define RGA_ALPHA_SELECT_ROP 1 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci#define RGA_ALPHA_MASK_BIG_ENDIAN 0 16062306a36Sopenharmony_ci#define RGA_ALPHA_MASK_LITTLE_ENDIAN 1 16162306a36Sopenharmony_ci 16262306a36Sopenharmony_ci#define RGA_ALPHA_NORMAL 0 16362306a36Sopenharmony_ci#define RGA_ALPHA_REVERSE 1 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci#define RGA_ALPHA_BLEND_GLOBAL 0 16662306a36Sopenharmony_ci#define RGA_ALPHA_BLEND_NORMAL 1 16762306a36Sopenharmony_ci#define RGA_ALPHA_BLEND_MULTIPLY 2 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci#define RGA_ALPHA_CAL_CUT 0 17062306a36Sopenharmony_ci#define RGA_ALPHA_CAL_NORMAL 1 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci#define RGA_ALPHA_FACTOR_ZERO 0 17362306a36Sopenharmony_ci#define RGA_ALPHA_FACTOR_ONE 1 17462306a36Sopenharmony_ci#define RGA_ALPHA_FACTOR_OTHER 2 17562306a36Sopenharmony_ci#define RGA_ALPHA_FACTOR_OTHER_REVERSE 3 17662306a36Sopenharmony_ci#define RGA_ALPHA_FACTOR_SELF 4 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_ci#define RGA_ALPHA_COLOR_NORMAL 0 17962306a36Sopenharmony_ci#define RGA_ALPHA_COLOR_MULTIPLY_CAL 1 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci/* Registers union */ 18262306a36Sopenharmony_ciunion rga_mode_ctrl { 18362306a36Sopenharmony_ci unsigned int val; 18462306a36Sopenharmony_ci struct { 18562306a36Sopenharmony_ci /* [0:2] */ 18662306a36Sopenharmony_ci unsigned int render:3; 18762306a36Sopenharmony_ci /* [3:6] */ 18862306a36Sopenharmony_ci unsigned int bitblt:1; 18962306a36Sopenharmony_ci unsigned int cf_rop4_pat:1; 19062306a36Sopenharmony_ci unsigned int alpha_zero_key:1; 19162306a36Sopenharmony_ci unsigned int gradient_sat:1; 19262306a36Sopenharmony_ci /* [7:31] */ 19362306a36Sopenharmony_ci unsigned int reserved:25; 19462306a36Sopenharmony_ci } data; 19562306a36Sopenharmony_ci}; 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ciunion rga_src_info { 19862306a36Sopenharmony_ci unsigned int val; 19962306a36Sopenharmony_ci struct { 20062306a36Sopenharmony_ci /* [0:3] */ 20162306a36Sopenharmony_ci unsigned int format:4; 20262306a36Sopenharmony_ci /* [4:7] */ 20362306a36Sopenharmony_ci unsigned int swap:3; 20462306a36Sopenharmony_ci unsigned int cp_endian:1; 20562306a36Sopenharmony_ci /* [8:17] */ 20662306a36Sopenharmony_ci unsigned int csc_mode:2; 20762306a36Sopenharmony_ci unsigned int rot_mode:2; 20862306a36Sopenharmony_ci unsigned int mir_mode:2; 20962306a36Sopenharmony_ci unsigned int hscl_mode:2; 21062306a36Sopenharmony_ci unsigned int vscl_mode:2; 21162306a36Sopenharmony_ci /* [18:22] */ 21262306a36Sopenharmony_ci unsigned int trans_mode:1; 21362306a36Sopenharmony_ci unsigned int trans_enable:4; 21462306a36Sopenharmony_ci /* [23:25] */ 21562306a36Sopenharmony_ci unsigned int dither_up_en:1; 21662306a36Sopenharmony_ci unsigned int bic_coe_sel:2; 21762306a36Sopenharmony_ci /* [26:31] */ 21862306a36Sopenharmony_ci unsigned int reserved:6; 21962306a36Sopenharmony_ci } data; 22062306a36Sopenharmony_ci}; 22162306a36Sopenharmony_ci 22262306a36Sopenharmony_ciunion rga_src_vir_info { 22362306a36Sopenharmony_ci unsigned int val; 22462306a36Sopenharmony_ci struct { 22562306a36Sopenharmony_ci /* [0:15] */ 22662306a36Sopenharmony_ci unsigned int vir_width:15; 22762306a36Sopenharmony_ci unsigned int reserved:1; 22862306a36Sopenharmony_ci /* [16:25] */ 22962306a36Sopenharmony_ci unsigned int vir_stride:10; 23062306a36Sopenharmony_ci /* [26:31] */ 23162306a36Sopenharmony_ci unsigned int reserved1:6; 23262306a36Sopenharmony_ci } data; 23362306a36Sopenharmony_ci}; 23462306a36Sopenharmony_ci 23562306a36Sopenharmony_ciunion rga_src_act_info { 23662306a36Sopenharmony_ci unsigned int val; 23762306a36Sopenharmony_ci struct { 23862306a36Sopenharmony_ci /* [0:15] */ 23962306a36Sopenharmony_ci unsigned int act_width:13; 24062306a36Sopenharmony_ci unsigned int reserved:3; 24162306a36Sopenharmony_ci /* [16:31] */ 24262306a36Sopenharmony_ci unsigned int act_height:13; 24362306a36Sopenharmony_ci unsigned int reserved1:3; 24462306a36Sopenharmony_ci } data; 24562306a36Sopenharmony_ci}; 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ciunion rga_src_x_factor { 24862306a36Sopenharmony_ci unsigned int val; 24962306a36Sopenharmony_ci struct { 25062306a36Sopenharmony_ci /* [0:15] */ 25162306a36Sopenharmony_ci unsigned int down_scale_factor:16; 25262306a36Sopenharmony_ci /* [16:31] */ 25362306a36Sopenharmony_ci unsigned int up_scale_factor:16; 25462306a36Sopenharmony_ci } data; 25562306a36Sopenharmony_ci}; 25662306a36Sopenharmony_ci 25762306a36Sopenharmony_ciunion rga_src_y_factor { 25862306a36Sopenharmony_ci unsigned int val; 25962306a36Sopenharmony_ci struct { 26062306a36Sopenharmony_ci /* [0:15] */ 26162306a36Sopenharmony_ci unsigned int down_scale_factor:16; 26262306a36Sopenharmony_ci /* [16:31] */ 26362306a36Sopenharmony_ci unsigned int up_scale_factor:16; 26462306a36Sopenharmony_ci } data; 26562306a36Sopenharmony_ci}; 26662306a36Sopenharmony_ci 26762306a36Sopenharmony_ci/* Alpha / Red / Green / Blue */ 26862306a36Sopenharmony_ciunion rga_src_cp_gr_color { 26962306a36Sopenharmony_ci unsigned int val; 27062306a36Sopenharmony_ci struct { 27162306a36Sopenharmony_ci /* [0:15] */ 27262306a36Sopenharmony_ci unsigned int gradient_x:16; 27362306a36Sopenharmony_ci /* [16:31] */ 27462306a36Sopenharmony_ci unsigned int gradient_y:16; 27562306a36Sopenharmony_ci } data; 27662306a36Sopenharmony_ci}; 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ciunion rga_src_transparency_color0 { 27962306a36Sopenharmony_ci unsigned int val; 28062306a36Sopenharmony_ci struct { 28162306a36Sopenharmony_ci /* [0:7] */ 28262306a36Sopenharmony_ci unsigned int trans_rmin:8; 28362306a36Sopenharmony_ci /* [8:15] */ 28462306a36Sopenharmony_ci unsigned int trans_gmin:8; 28562306a36Sopenharmony_ci /* [16:23] */ 28662306a36Sopenharmony_ci unsigned int trans_bmin:8; 28762306a36Sopenharmony_ci /* [24:31] */ 28862306a36Sopenharmony_ci unsigned int trans_amin:8; 28962306a36Sopenharmony_ci } data; 29062306a36Sopenharmony_ci}; 29162306a36Sopenharmony_ci 29262306a36Sopenharmony_ciunion rga_src_transparency_color1 { 29362306a36Sopenharmony_ci unsigned int val; 29462306a36Sopenharmony_ci struct { 29562306a36Sopenharmony_ci /* [0:7] */ 29662306a36Sopenharmony_ci unsigned int trans_rmax:8; 29762306a36Sopenharmony_ci /* [8:15] */ 29862306a36Sopenharmony_ci unsigned int trans_gmax:8; 29962306a36Sopenharmony_ci /* [16:23] */ 30062306a36Sopenharmony_ci unsigned int trans_bmax:8; 30162306a36Sopenharmony_ci /* [24:31] */ 30262306a36Sopenharmony_ci unsigned int trans_amax:8; 30362306a36Sopenharmony_ci } data; 30462306a36Sopenharmony_ci}; 30562306a36Sopenharmony_ci 30662306a36Sopenharmony_ciunion rga_dst_info { 30762306a36Sopenharmony_ci unsigned int val; 30862306a36Sopenharmony_ci struct { 30962306a36Sopenharmony_ci /* [0:3] */ 31062306a36Sopenharmony_ci unsigned int format:4; 31162306a36Sopenharmony_ci /* [4:6] */ 31262306a36Sopenharmony_ci unsigned int swap:3; 31362306a36Sopenharmony_ci /* [7:9] */ 31462306a36Sopenharmony_ci unsigned int src1_format:3; 31562306a36Sopenharmony_ci /* [10:11] */ 31662306a36Sopenharmony_ci unsigned int src1_swap:2; 31762306a36Sopenharmony_ci /* [12:15] */ 31862306a36Sopenharmony_ci unsigned int dither_up_en:1; 31962306a36Sopenharmony_ci unsigned int dither_down_en:1; 32062306a36Sopenharmony_ci unsigned int dither_down_mode:2; 32162306a36Sopenharmony_ci /* [16:18] */ 32262306a36Sopenharmony_ci unsigned int csc_mode:2; 32362306a36Sopenharmony_ci unsigned int csc_clip:1; 32462306a36Sopenharmony_ci /* [19:31] */ 32562306a36Sopenharmony_ci unsigned int reserved:13; 32662306a36Sopenharmony_ci } data; 32762306a36Sopenharmony_ci}; 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ciunion rga_dst_vir_info { 33062306a36Sopenharmony_ci unsigned int val; 33162306a36Sopenharmony_ci struct { 33262306a36Sopenharmony_ci /* [0:15] */ 33362306a36Sopenharmony_ci unsigned int vir_stride:15; 33462306a36Sopenharmony_ci unsigned int reserved:1; 33562306a36Sopenharmony_ci /* [16:31] */ 33662306a36Sopenharmony_ci unsigned int src1_vir_stride:15; 33762306a36Sopenharmony_ci unsigned int reserved1:1; 33862306a36Sopenharmony_ci } data; 33962306a36Sopenharmony_ci}; 34062306a36Sopenharmony_ci 34162306a36Sopenharmony_ciunion rga_dst_act_info { 34262306a36Sopenharmony_ci unsigned int val; 34362306a36Sopenharmony_ci struct { 34462306a36Sopenharmony_ci /* [0:15] */ 34562306a36Sopenharmony_ci unsigned int act_width:12; 34662306a36Sopenharmony_ci unsigned int reserved:4; 34762306a36Sopenharmony_ci /* [16:31] */ 34862306a36Sopenharmony_ci unsigned int act_height:12; 34962306a36Sopenharmony_ci unsigned int reserved1:4; 35062306a36Sopenharmony_ci } data; 35162306a36Sopenharmony_ci}; 35262306a36Sopenharmony_ci 35362306a36Sopenharmony_ciunion rga_alpha_ctrl0 { 35462306a36Sopenharmony_ci unsigned int val; 35562306a36Sopenharmony_ci struct { 35662306a36Sopenharmony_ci /* [0:3] */ 35762306a36Sopenharmony_ci unsigned int rop_en:1; 35862306a36Sopenharmony_ci unsigned int rop_select:1; 35962306a36Sopenharmony_ci unsigned int rop_mode:2; 36062306a36Sopenharmony_ci /* [4:11] */ 36162306a36Sopenharmony_ci unsigned int src_fading_val:8; 36262306a36Sopenharmony_ci /* [12:20] */ 36362306a36Sopenharmony_ci unsigned int dst_fading_val:8; 36462306a36Sopenharmony_ci unsigned int mask_endian:1; 36562306a36Sopenharmony_ci /* [21:31] */ 36662306a36Sopenharmony_ci unsigned int reserved:11; 36762306a36Sopenharmony_ci } data; 36862306a36Sopenharmony_ci}; 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_ciunion rga_alpha_ctrl1 { 37162306a36Sopenharmony_ci unsigned int val; 37262306a36Sopenharmony_ci struct { 37362306a36Sopenharmony_ci /* [0:1] */ 37462306a36Sopenharmony_ci unsigned int dst_color_m0:1; 37562306a36Sopenharmony_ci unsigned int src_color_m0:1; 37662306a36Sopenharmony_ci /* [2:7] */ 37762306a36Sopenharmony_ci unsigned int dst_factor_m0:3; 37862306a36Sopenharmony_ci unsigned int src_factor_m0:3; 37962306a36Sopenharmony_ci /* [8:9] */ 38062306a36Sopenharmony_ci unsigned int dst_alpha_cal_m0:1; 38162306a36Sopenharmony_ci unsigned int src_alpha_cal_m0:1; 38262306a36Sopenharmony_ci /* [10:13] */ 38362306a36Sopenharmony_ci unsigned int dst_blend_m0:2; 38462306a36Sopenharmony_ci unsigned int src_blend_m0:2; 38562306a36Sopenharmony_ci /* [14:15] */ 38662306a36Sopenharmony_ci unsigned int dst_alpha_m0:1; 38762306a36Sopenharmony_ci unsigned int src_alpha_m0:1; 38862306a36Sopenharmony_ci /* [16:21] */ 38962306a36Sopenharmony_ci unsigned int dst_factor_m1:3; 39062306a36Sopenharmony_ci unsigned int src_factor_m1:3; 39162306a36Sopenharmony_ci /* [22:23] */ 39262306a36Sopenharmony_ci unsigned int dst_alpha_cal_m1:1; 39362306a36Sopenharmony_ci unsigned int src_alpha_cal_m1:1; 39462306a36Sopenharmony_ci /* [24:27] */ 39562306a36Sopenharmony_ci unsigned int dst_blend_m1:2; 39662306a36Sopenharmony_ci unsigned int src_blend_m1:2; 39762306a36Sopenharmony_ci /* [28:29] */ 39862306a36Sopenharmony_ci unsigned int dst_alpha_m1:1; 39962306a36Sopenharmony_ci unsigned int src_alpha_m1:1; 40062306a36Sopenharmony_ci /* [30:31] */ 40162306a36Sopenharmony_ci unsigned int reserved:2; 40262306a36Sopenharmony_ci } data; 40362306a36Sopenharmony_ci}; 40462306a36Sopenharmony_ci 40562306a36Sopenharmony_ciunion rga_fading_ctrl { 40662306a36Sopenharmony_ci unsigned int val; 40762306a36Sopenharmony_ci struct { 40862306a36Sopenharmony_ci /* [0:7] */ 40962306a36Sopenharmony_ci unsigned int fading_offset_r:8; 41062306a36Sopenharmony_ci /* [8:15] */ 41162306a36Sopenharmony_ci unsigned int fading_offset_g:8; 41262306a36Sopenharmony_ci /* [16:23] */ 41362306a36Sopenharmony_ci unsigned int fading_offset_b:8; 41462306a36Sopenharmony_ci /* [24:31] */ 41562306a36Sopenharmony_ci unsigned int fading_en:1; 41662306a36Sopenharmony_ci unsigned int reserved:7; 41762306a36Sopenharmony_ci } data; 41862306a36Sopenharmony_ci}; 41962306a36Sopenharmony_ci 42062306a36Sopenharmony_ciunion rga_pat_con { 42162306a36Sopenharmony_ci unsigned int val; 42262306a36Sopenharmony_ci struct { 42362306a36Sopenharmony_ci /* [0:7] */ 42462306a36Sopenharmony_ci unsigned int width:8; 42562306a36Sopenharmony_ci /* [8:15] */ 42662306a36Sopenharmony_ci unsigned int height:8; 42762306a36Sopenharmony_ci /* [16:23] */ 42862306a36Sopenharmony_ci unsigned int offset_x:8; 42962306a36Sopenharmony_ci /* [24:31] */ 43062306a36Sopenharmony_ci unsigned int offset_y:8; 43162306a36Sopenharmony_ci } data; 43262306a36Sopenharmony_ci}; 43362306a36Sopenharmony_ci 43462306a36Sopenharmony_ci#endif 435