linux/drivers/gpu/drm/exynos/regs-scaler.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* drivers/gpu/drm/exynos/regs-scaler.h
 *
 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 * Author: Andrzej Pietrasiewicz <[email protected]>
 *
 * Register definition file for Samsung scaler driver
 */

#ifndef EXYNOS_REGS_SCALER_H
#define EXYNOS_REGS_SCALER_H

/* Register part */

/* Global setting */
#define SCALER_STATUS
#define SCALER_CFG

/* Interrupt */
#define SCALER_INT_EN
#define SCALER_INT_STATUS

/* SRC */
#define SCALER_SRC_CFG
#define SCALER_SRC_Y_BASE
#define SCALER_SRC_CB_BASE
#define SCALER_SRC_CR_BASE
#define SCALER_SRC_SPAN
#define SCALER_SRC_Y_POS
#define SCALER_SRC_WH
#define SCALER_SRC_C_POS

/* DST */
#define SCALER_DST_CFG
#define SCALER_DST_Y_BASE
#define SCALER_DST_CB_BASE
#define SCALER_DST_CR_BASE
#define SCALER_DST_SPAN
#define SCALER_DST_WH
#define SCALER_DST_POS

/* Ratio */
#define SCALER_H_RATIO
#define SCALER_V_RATIO

/* Rotation */
#define SCALER_ROT_CFG

/* Coefficient */
/*
 * YHCOEF_{x}{A|B|C|D}			CHCOEF_{x}{A|B|C|D}
 *
 *	A	B	C	D	A	B	C	D
 * 0	60	64	68	6c	140	144	148	14c
 * 1	70	74	78	7c	150	154	158	15c
 * 2	80	84	88	8c	160	164	168	16c
 * 3	90	94	98	9c	170	174	178	17c
 * 4	a0	a4	a8	ac	180	184	188	18c
 * 5	b0	b4	b8	bc	190	194	198	19c
 * 6	c0	c4	c8	cc	1a0	1a4	1a8	1ac
 * 7	d0	d4	d8	dc	1b0	1b4	1b8	1bc
 * 8	e0	e4	e8	ec	1c0	1c4	1c8	1cc
 *
 *
 * YVCOEF_{x}{A|B}			CVCOEF_{x}{A|B}
 *
 *	A	B			A	B
 * 0	f0	f4			1d0	1d4
 * 1	f8	fc			1d8	1dc
 * 2	100	104			1e0	1e4
 * 3	108	10c			1e8	1ec
 * 4	110	114			1f0	1f4
 * 5	118	11c			1f8	1fc
 * 6	120	124			200	204
 * 7	128	12c			208	20c
 * 8	130	134			210	214
 */
#define _SCALER_HCOEF_DELTA(r, c)
#define _SCALER_VCOEF_DELTA(r, c)

#define SCALER_YHCOEF(r, c)
#define SCALER_YVCOEF(r, c)
#define SCALER_CHCOEF(r, c)
#define SCALER_CVCOEF(r, c)


/* Color Space Conversion */
#define SCALER_CSC_COEF(x, y)

/* Dithering */
#define SCALER_DITH_CFG

/* Version Number */
#define SCALER_VER

/* Cycle count and Timeout */
#define SCALER_CYCLE_COUNT
#define SCALER_TIMEOUT_CTRL
#define SCALER_TIMEOUT_CNT

/* Blending */
#define SCALER_SRC_BLEND_COLOR
#define SCALER_SRC_BLEND_ALPHA
#define SCALER_DST_BLEND_COLOR
#define SCALER_DST_BLEND_ALPHA

/* Color Fill */
#define SCALER_FILL_COLOR

/* Multiple Command Queue */
#define SCALER_ADDR_Q_CONFIG
#define SCALER_SRC_ADDR_Q_STATUS
#define SCALER_SRC_ADDR_Q

/* CRC */
#define SCALER_CRC_COLOR00_10
#define SCALER_CRC_COLOR20_30
#define SCALER_CRC_COLOR01_11
#define SCALER_CRC_COLOR21_31

/* Shadow Registers */
#define SCALER_SHADOW_OFFSET


/* Bit definition part */
#define SCALER_MASK(hi_b, lo_b)
#define SCALER_GET(reg, hi_b, lo_b)
#define SCALER_SET(val, hi_b, lo_b)

/* SCALER_STATUS */
#define SCALER_STATUS_SCALER_RUNNING
#define SCALER_STATUS_SCALER_READY_CLK_DOWN

/* SCALER_CFG */
#define SCALER_CFG_FILL_EN
#define SCALER_CFG_BLEND_COLOR_DIVIDE_ALPHA_EN
#define SCALER_CFG_BLEND_EN
#define SCALER_CFG_CSC_Y_OFFSET_SRC_EN
#define SCALER_CFG_CSC_Y_OFFSET_DST_EN
#define SCALER_CFG_16_BURST_MODE
#define SCALER_CFG_SOFT_RESET
#define SCALER_CFG_START_CMD

/* SCALER_INT_EN */
#define SCALER_INT_EN_TIMEOUT
#define SCALER_INT_EN_ILLEGAL_BLEND
#define SCALER_INT_EN_ILLEGAL_RATIO
#define SCALER_INT_EN_ILLEGAL_DST_HEIGHT
#define SCALER_INT_EN_ILLEGAL_DST_WIDTH
#define SCALER_INT_EN_ILLEGAL_DST_V_POS
#define SCALER_INT_EN_ILLEGAL_DST_H_POS
#define SCALER_INT_EN_ILLEGAL_DST_C_SPAN
#define SCALER_INT_EN_ILLEGAL_DST_Y_SPAN
#define SCALER_INT_EN_ILLEGAL_DST_CR_BASE
#define SCALER_INT_EN_ILLEGAL_DST_CB_BASE
#define SCALER_INT_EN_ILLEGAL_DST_Y_BASE
#define SCALER_INT_EN_ILLEGAL_DST_COLOR
#define SCALER_INT_EN_ILLEGAL_SRC_HEIGHT
#define SCALER_INT_EN_ILLEGAL_SRC_WIDTH
#define SCALER_INT_EN_ILLEGAL_SRC_CV_POS
#define SCALER_INT_EN_ILLEGAL_SRC_CH_POS
#define SCALER_INT_EN_ILLEGAL_SRC_YV_POS
#define SCALER_INT_EN_ILLEGAL_SRC_YH_POS
#define SCALER_INT_EN_ILLEGAL_DST_SPAN
#define SCALER_INT_EN_ILLEGAL_SRC_Y_SPAN
#define SCALER_INT_EN_ILLEGAL_SRC_CR_BASE
#define SCALER_INT_EN_ILLEGAL_SRC_CB_BASE
#define SCALER_INT_EN_ILLEGAL_SRC_Y_BASE
#define SCALER_INT_EN_ILLEGAL_SRC_COLOR
#define SCALER_INT_EN_FRAME_END

/* SCALER_INT_STATUS */
#define SCALER_INT_STATUS_TIMEOUT
#define SCALER_INT_STATUS_ILLEGAL_BLEND
#define SCALER_INT_STATUS_ILLEGAL_RATIO
#define SCALER_INT_STATUS_ILLEGAL_DST_HEIGHT
#define SCALER_INT_STATUS_ILLEGAL_DST_WIDTH
#define SCALER_INT_STATUS_ILLEGAL_DST_V_POS
#define SCALER_INT_STATUS_ILLEGAL_DST_H_POS
#define SCALER_INT_STATUS_ILLEGAL_DST_C_SPAN
#define SCALER_INT_STATUS_ILLEGAL_DST_Y_SPAN
#define SCALER_INT_STATUS_ILLEGAL_DST_CR_BASE
#define SCALER_INT_STATUS_ILLEGAL_DST_CB_BASE
#define SCALER_INT_STATUS_ILLEGAL_DST_Y_BASE
#define SCALER_INT_STATUS_ILLEGAL_DST_COLOR
#define SCALER_INT_STATUS_ILLEGAL_SRC_HEIGHT
#define SCALER_INT_STATUS_ILLEGAL_SRC_WIDTH
#define SCALER_INT_STATUS_ILLEGAL_SRC_CV_POS
#define SCALER_INT_STATUS_ILLEGAL_SRC_CH_POS
#define SCALER_INT_STATUS_ILLEGAL_SRC_YV_POS
#define SCALER_INT_STATUS_ILLEGAL_SRC_YH_POS
#define SCALER_INT_STATUS_ILLEGAL_DST_SPAN
#define SCALER_INT_STATUS_ILLEGAL_SRC_Y_SPAN
#define SCALER_INT_STATUS_ILLEGAL_SRC_CR_BASE
#define SCALER_INT_STATUS_ILLEGAL_SRC_CB_BASE
#define SCALER_INT_STATUS_ILLEGAL_SRC_Y_BASE
#define SCALER_INT_STATUS_ILLEGAL_SRC_COLOR
#define SCALER_INT_STATUS_FRAME_END

/* SCALER_SRC_CFG */
#define SCALER_SRC_CFG_TILE_EN
#define SCALER_SRC_CFG_GET_BYTE_SWAP(r)
#define SCALER_SRC_CFG_SET_BYTE_SWAP(v)
#define SCALER_SRC_CFG_GET_COLOR_FORMAT(r)
#define SCALER_SRC_CFG_SET_COLOR_FORMAT(v)
#define SCALER_YUV420_2P_UV
#define SCALER_YUV422_2P_UV
#define SCALER_YUV444_2P_UV
#define SCALER_RGB_565
#define SCALER_ARGB1555
#define SCALER_ARGB8888
#define SCALER_ARGB8888_PRE
#define SCALER_YUV422_1P_YVYU
#define SCALER_YUV422_1P_YUYV
#define SCALER_YUV422_1P_UYVY
#define SCALER_ARGB4444
#define SCALER_L8A8
#define SCALER_RGBA8888
#define SCALER_L8
#define SCALER_YUV420_2P_VU
#define SCALER_YUV422_2P_VU
#define SCALER_YUV444_2P_VU
#define SCALER_YUV420_3P
#define SCALER_YUV422_3P
#define SCALER_YUV444_3P

/* SCALER_SRC_SPAN */
#define SCALER_SRC_SPAN_GET_C_SPAN(r)
#define SCALER_SRC_SPAN_SET_C_SPAN(v)
#define SCALER_SRC_SPAN_GET_Y_SPAN(r)
#define SCALER_SRC_SPAN_SET_Y_SPAN(v)

/* SCALER_SRC_Y_POS */
#define SCALER_SRC_Y_POS_GET_YH_POS(r)
#define SCALER_SRC_Y_POS_SET_YH_POS(v)
#define SCALER_SRC_Y_POS_GET_YV_POS(r)
#define SCALER_SRC_Y_POS_SET_YV_POS(v)

/* SCALER_SRC_WH */
#define SCALER_SRC_WH_GET_WIDTH(r)
#define SCALER_SRC_WH_SET_WIDTH(v)
#define SCALER_SRC_WH_GET_HEIGHT(r)
#define SCALER_SRC_WH_SET_HEIGHT(v)

/* SCALER_SRC_C_POS */
#define SCALER_SRC_C_POS_GET_CH_POS(r)
#define SCALER_SRC_C_POS_SET_CH_POS(v)
#define SCALER_SRC_C_POS_GET_CV_POS(r)
#define SCALER_SRC_C_POS_SET_CV_POS(v)

/* SCALER_DST_CFG */
#define SCALER_DST_CFG_GET_BYTE_SWAP(r)
#define SCALER_DST_CFG_SET_BYTE_SWAP(v)
#define SCALER_DST_CFG_GET_COLOR_FORMAT(r)
#define SCALER_DST_CFG_SET_COLOR_FORMAT(v)

/* SCALER_DST_SPAN */
#define SCALER_DST_SPAN_GET_C_SPAN(r)
#define SCALER_DST_SPAN_SET_C_SPAN(v)
#define SCALER_DST_SPAN_GET_Y_SPAN(r)
#define SCALER_DST_SPAN_SET_Y_SPAN(v)

/* SCALER_DST_WH */
#define SCALER_DST_WH_GET_WIDTH(r)
#define SCALER_DST_WH_SET_WIDTH(v)
#define SCALER_DST_WH_GET_HEIGHT(r)
#define SCALER_DST_WH_SET_HEIGHT(v)

/* SCALER_DST_POS */
#define SCALER_DST_POS_GET_H_POS(r)
#define SCALER_DST_POS_SET_H_POS(v)
#define SCALER_DST_POS_GET_V_POS(r)
#define SCALER_DST_POS_SET_V_POS(v)

/* SCALER_H_RATIO */
#define SCALER_H_RATIO_GET(r)
#define SCALER_H_RATIO_SET(v)

/* SCALER_V_RATIO */
#define SCALER_V_RATIO_GET(r)
#define SCALER_V_RATIO_SET(v)

/* SCALER_ROT_CFG */
#define SCALER_ROT_CFG_FLIP_X_EN
#define SCALER_ROT_CFG_FLIP_Y_EN
#define SCALER_ROT_CFG_GET_ROTMODE(r)
#define SCALER_ROT_CFG_SET_ROTMODE(v)
#define SCALER_ROT_MODE_90
#define SCALER_ROT_MODE_180
#define SCALER_ROT_MODE_270

/* SCALER_HCOEF, SCALER_VCOEF */
#define SCALER_COEF_SHIFT(i)
#define SCALER_COEF_GET(r, i)
#define SCALER_COEF_SET(v, i)

/* SCALER_CSC_COEFxy */
#define SCALER_CSC_COEF_GET(r)
#define SCALER_CSC_COEF_SET(v)

/* SCALER_DITH_CFG */
#define SCALER_DITH_CFG_GET_R_TYPE(r)
#define SCALER_DITH_CFG_SET_R_TYPE(v)
#define SCALER_DITH_CFG_GET_G_TYPE(r)
#define SCALER_DITH_CFG_SET_G_TYPE(v)
#define SCALER_DITH_CFG_GET_B_TYPE(r)
#define SCALER_DITH_CFG_SET_B_TYPE(v)

/* SCALER_TIMEOUT_CTRL */
#define SCALER_TIMEOUT_CTRL_GET_TIMER_VALUE(r)
#define SCALER_TIMEOUT_CTRL_SET_TIMER_VALUE(v)
#define SCALER_TIMEOUT_CTRL_GET_TIMER_DIV(r)
#define SCALER_TIMEOUT_CTRL_SET_TIMER_DIV(v)
#define SCALER_TIMEOUT_CTRL_TIMER_ENABLE

/* SCALER_TIMEOUT_CNT */
#define SCALER_TIMEOUT_CTRL_GET_TIMER_COUNT(r)

/* SCALER_SRC_BLEND_COLOR */
#define SCALER_SRC_BLEND_COLOR_SEL_INV
#define SCALER_SRC_BLEND_COLOR_GET_SEL(r)
#define SCALER_SRC_BLEND_COLOR_SET_SEL(v)
#define SCALER_SRC_BLEND_COLOR_OP_SEL_INV
#define SCALER_SRC_BLEND_COLOR_GET_OP_SEL(r)
#define SCALER_SRC_BLEND_COLOR_SET_OP_SEL(v)
#define SCALER_SRC_BLEND_COLOR_GET_COLOR0(r)
#define SCALER_SRC_BLEND_COLOR_SET_COLOR0(v)
#define SCALER_SRC_BLEND_COLOR_GET_COLOR1(r)
#define SCALER_SRC_BLEND_COLOR_SET_COLOR1(v)
#define SCALER_SRC_BLEND_COLOR_GET_COLOR2(r)
#define SCALER_SRC_BLEND_COLOR_SET_COLOR2(v)

/* SCALER_SRC_BLEND_ALPHA */
#define SCALER_SRC_BLEND_ALPHA_SEL_INV
#define SCALER_SRC_BLEND_ALPHA_GET_SEL(r)
#define SCALER_SRC_BLEND_ALPHA_SET_SEL(v)
#define SCALER_SRC_BLEND_ALPHA_OP_SEL_INV
#define SCALER_SRC_BLEND_ALPHA_GET_OP_SEL(r)
#define SCALER_SRC_BLEND_ALPHA_SET_OP_SEL(v)
#define SCALER_SRC_BLEND_ALPHA_GET_ALPHA(r)
#define SCALER_SRC_BLEND_ALPHA_SET_ALPHA(v)

/* SCALER_DST_BLEND_COLOR */
#define SCALER_DST_BLEND_COLOR_SEL_INV
#define SCALER_DST_BLEND_COLOR_GET_SEL(r)
#define SCALER_DST_BLEND_COLOR_SET_SEL(v)
#define SCALER_DST_BLEND_COLOR_OP_SEL_INV
#define SCALER_DST_BLEND_COLOR_GET_OP_SEL(r)
#define SCALER_DST_BLEND_COLOR_SET_OP_SEL(v)
#define SCALER_DST_BLEND_COLOR_GET_COLOR0(r)
#define SCALER_DST_BLEND_COLOR_SET_COLOR0(v)
#define SCALER_DST_BLEND_COLOR_GET_COLOR1(r)
#define SCALER_DST_BLEND_COLOR_SET_COLOR1(v)
#define SCALER_DST_BLEND_COLOR_GET_COLOR2(r)
#define SCALER_DST_BLEND_COLOR_SET_COLOR2(v)

/* SCALER_DST_BLEND_ALPHA */
#define SCALER_DST_BLEND_ALPHA_SEL_INV
#define SCALER_DST_BLEND_ALPHA_GET_SEL(r)
#define SCALER_DST_BLEND_ALPHA_SET_SEL(v)
#define SCALER_DST_BLEND_ALPHA_OP_SEL_INV
#define SCALER_DST_BLEND_ALPHA_GET_OP_SEL(r)
#define SCALER_DST_BLEND_ALPHA_SET_OP_SEL(v)
#define SCALER_DST_BLEND_ALPHA_GET_ALPHA(r)
#define SCALER_DST_BLEND_ALPHA_SET_ALPHA(v)

/* SCALER_FILL_COLOR */
#define SCALER_FILL_COLOR_GET_ALPHA(r)
#define SCALER_FILL_COLOR_SET_ALPHA(v)
#define SCALER_FILL_COLOR_GET_FILL_COLOR0(r)
#define SCALER_FILL_COLOR_SET_FILL_COLOR0(v)
#define SCALER_FILL_COLOR_GET_FILL_COLOR1(r)
#define SCALER_FILL_COLOR_SET_FILL_COLOR1(v)
#define SCALER_FILL_COLOR_GET_FILL_COLOR2(r)
#define SCALER_FILL_COLOR_SET_FILL_COLOR2(v)

/* SCALER_ADDR_Q_CONFIG */
#define SCALER_ADDR_Q_CONFIG_RST

/* SCALER_SRC_ADDR_Q_STATUS */
#define SCALER_SRC_ADDR_Q_STATUS_Y_FULL
#define SCALER_SRC_ADDR_Q_STATUS_Y_EMPTY
#define SCALER_SRC_ADDR_Q_STATUS_GET_Y_WR_IDX(r)
#define SCALER_SRC_ADDR_Q_STATUS_CB_FULL
#define SCALER_SRC_ADDR_Q_STATUS_CB_EMPTY
#define SCALER_SRC_ADDR_Q_STATUS_GET_CB_WR_IDX(r)
#define SCALER_SRC_ADDR_Q_STATUS_CR_FULL
#define SCALER_SRC_ADDR_Q_STATUS_CR_EMPTY
#define SCALER_SRC_ADDR_Q_STATUS_GET_CR_WR_IDX(r)

/* SCALER_DST_ADDR_Q_STATUS */
#define SCALER_DST_ADDR_Q_STATUS_Y_FULL
#define SCALER_DST_ADDR_Q_STATUS_Y_EMPTY
#define SCALER_DST_ADDR_Q_STATUS_GET_Y_WR_IDX(r)
#define SCALER_DST_ADDR_Q_STATUS_CB_FULL
#define SCALER_DST_ADDR_Q_STATUS_CB_EMPTY
#define SCALER_DST_ADDR_Q_STATUS_GET_CB_WR_IDX(r)
#define SCALER_DST_ADDR_Q_STATUS_CR_FULL
#define SCALER_DST_ADDR_Q_STATUS_CR_EMPTY
#define SCALER_DST_ADDR_Q_STATUS_GET_CR_WR_IDX(r)

/* SCALER_CRC_COLOR00_10 */
#define SCALER_CRC_COLOR00_10_GET_00(r)
#define SCALER_CRC_COLOR00_10_GET_10(r)

/* SCALER_CRC_COLOR20_30 */
#define SCALER_CRC_COLOR20_30_GET_20(r)
#define SCALER_CRC_COLOR20_30_GET_30(r)

/* SCALER_CRC_COLOR01_11 */
#define SCALER_CRC_COLOR01_11_GET_01(r)
#define SCALER_CRC_COLOR01_11_GET_11(r)

/* SCALER_CRC_COLOR21_31 */
#define SCALER_CRC_COLOR21_31_GET_21(r)
#define SCALER_CRC_COLOR21_31_GET_31(r)

#endif /* EXYNOS_REGS_SCALER_H */