linux/drivers/media/platform/rockchip/rga/rga-hw.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
 * Author: Jacob Chen <[email protected]>
 */
#ifndef __RGA_HW_H__
#define __RGA_HW_H__

#define RGA_CMDBUF_SIZE

/* Hardware limits */
#define MAX_WIDTH
#define MAX_HEIGHT

#define MIN_WIDTH
#define MIN_HEIGHT

#define DEFAULT_WIDTH
#define DEFAULT_HEIGHT

#define RGA_TIMEOUT

/* Registers address */
#define RGA_SYS_CTRL
#define RGA_CMD_CTRL
#define RGA_CMD_BASE
#define RGA_INT
#define RGA_MMU_CTRL0
#define RGA_VERSION_INFO

#define RGA_MODE_BASE_REG
#define RGA_MODE_MAX_REG

#define RGA_MODE_CTRL
#define RGA_SRC_INFO
#define RGA_SRC_Y_RGB_BASE_ADDR
#define RGA_SRC_CB_BASE_ADDR
#define RGA_SRC_CR_BASE_ADDR
#define RGA_SRC1_RGB_BASE_ADDR
#define RGA_SRC_VIR_INFO
#define RGA_SRC_ACT_INFO
#define RGA_SRC_X_FACTOR
#define RGA_SRC_Y_FACTOR
#define RGA_SRC_BG_COLOR
#define RGA_SRC_FG_COLOR
#define RGA_SRC_TR_COLOR0
#define RGA_SRC_TR_COLOR1

#define RGA_DST_INFO
#define RGA_DST_Y_RGB_BASE_ADDR
#define RGA_DST_CB_BASE_ADDR
#define RGA_DST_CR_BASE_ADDR
#define RGA_DST_VIR_INFO
#define RGA_DST_ACT_INFO

#define RGA_ALPHA_CTRL0
#define RGA_ALPHA_CTRL1
#define RGA_FADING_CTRL
#define RGA_PAT_CON
#define RGA_ROP_CON0
#define RGA_ROP_CON1
#define RGA_MASK_BASE

#define RGA_MMU_CTRL1
#define RGA_MMU_SRC_BASE
#define RGA_MMU_SRC1_BASE
#define RGA_MMU_DST_BASE

/* Registers value */
#define RGA_MODE_RENDER_BITBLT
#define RGA_MODE_RENDER_COLOR_PALETTE
#define RGA_MODE_RENDER_RECTANGLE_FILL
#define RGA_MODE_RENDER_UPDATE_PALETTE_LUT_RAM

#define RGA_MODE_BITBLT_MODE_SRC_TO_DST
#define RGA_MODE_BITBLT_MODE_SRC_SRC1_TO_DST

#define RGA_MODE_CF_ROP4_SOLID
#define RGA_MODE_CF_ROP4_PATTERN

#define RGA_COLOR_FMT_ABGR8888
#define RGA_COLOR_FMT_XBGR8888
#define RGA_COLOR_FMT_RGB888
#define RGA_COLOR_FMT_BGR565
#define RGA_COLOR_FMT_ABGR1555
#define RGA_COLOR_FMT_ABGR4444
#define RGA_COLOR_FMT_YUV422SP
#define RGA_COLOR_FMT_YUV422P
#define RGA_COLOR_FMT_YUV420SP
#define RGA_COLOR_FMT_YUV420P
/* SRC_COLOR Palette */
#define RGA_COLOR_FMT_CP_1BPP
#define RGA_COLOR_FMT_CP_2BPP
#define RGA_COLOR_FMT_CP_4BPP
#define RGA_COLOR_FMT_CP_8BPP
#define RGA_COLOR_FMT_MASK

#define RGA_COLOR_FMT_IS_YUV(fmt)
#define RGA_COLOR_FMT_IS_RGB(fmt)

#define RGA_COLOR_NONE_SWAP
#define RGA_COLOR_RB_SWAP
#define RGA_COLOR_ALPHA_SWAP
#define RGA_COLOR_UV_SWAP

#define RGA_SRC_CSC_MODE_BYPASS
#define RGA_SRC_CSC_MODE_BT601_R0
#define RGA_SRC_CSC_MODE_BT601_R1
#define RGA_SRC_CSC_MODE_BT709_R0
#define RGA_SRC_CSC_MODE_BT709_R1

#define RGA_SRC_ROT_MODE_0_DEGREE
#define RGA_SRC_ROT_MODE_90_DEGREE
#define RGA_SRC_ROT_MODE_180_DEGREE
#define RGA_SRC_ROT_MODE_270_DEGREE

#define RGA_SRC_MIRR_MODE_NO
#define RGA_SRC_MIRR_MODE_X
#define RGA_SRC_MIRR_MODE_Y
#define RGA_SRC_MIRR_MODE_X_Y

#define RGA_SRC_HSCL_MODE_NO
#define RGA_SRC_HSCL_MODE_DOWN
#define RGA_SRC_HSCL_MODE_UP

#define RGA_SRC_VSCL_MODE_NO
#define RGA_SRC_VSCL_MODE_DOWN
#define RGA_SRC_VSCL_MODE_UP

#define RGA_SRC_TRANS_ENABLE_R
#define RGA_SRC_TRANS_ENABLE_G
#define RGA_SRC_TRANS_ENABLE_B
#define RGA_SRC_TRANS_ENABLE_A

#define RGA_SRC_BIC_COE_SELEC_CATROM
#define RGA_SRC_BIC_COE_SELEC_MITCHELL
#define RGA_SRC_BIC_COE_SELEC_HERMITE
#define RGA_SRC_BIC_COE_SELEC_BSPLINE

#define RGA_DST_DITHER_MODE_888_TO_666
#define RGA_DST_DITHER_MODE_888_TO_565
#define RGA_DST_DITHER_MODE_888_TO_555
#define RGA_DST_DITHER_MODE_888_TO_444

#define RGA_DST_CSC_MODE_BYPASS
#define RGA_DST_CSC_MODE_BT601_R0
#define RGA_DST_CSC_MODE_BT601_R1
#define RGA_DST_CSC_MODE_BT709_R0

#define RGA_ALPHA_ROP_MODE_2
#define RGA_ALPHA_ROP_MODE_3
#define RGA_ALPHA_ROP_MODE_4

#define RGA_ALPHA_SELECT_ALPHA
#define RGA_ALPHA_SELECT_ROP

#define RGA_ALPHA_MASK_BIG_ENDIAN
#define RGA_ALPHA_MASK_LITTLE_ENDIAN

#define RGA_ALPHA_NORMAL
#define RGA_ALPHA_REVERSE

#define RGA_ALPHA_BLEND_GLOBAL
#define RGA_ALPHA_BLEND_NORMAL
#define RGA_ALPHA_BLEND_MULTIPLY

#define RGA_ALPHA_CAL_CUT
#define RGA_ALPHA_CAL_NORMAL

#define RGA_ALPHA_FACTOR_ZERO
#define RGA_ALPHA_FACTOR_ONE
#define RGA_ALPHA_FACTOR_OTHER
#define RGA_ALPHA_FACTOR_OTHER_REVERSE
#define RGA_ALPHA_FACTOR_SELF

#define RGA_ALPHA_COLOR_NORMAL
#define RGA_ALPHA_COLOR_MULTIPLY_CAL

/* Registers union */
rga_mode_ctrl;

rga_src_info;

rga_src_vir_info;

rga_src_act_info;

rga_src_x_factor;

rga_src_y_factor;

/* Alpha / Red / Green / Blue */
rga_src_cp_gr_color;

rga_src_transparency_color0;

rga_src_transparency_color1;

rga_dst_info;

rga_dst_vir_info;

rga_dst_act_info;

rga_alpha_ctrl0;

rga_alpha_ctrl1;

rga_fading_ctrl;

rga_pat_con;

#endif