mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
IEP: Coding Style revision according to K-R style.
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
This commit is contained in:
223
drivers/video/rockchip/iep/hw_iep_config_addr.h
Executable file → Normal file
223
drivers/video/rockchip/iep/hw_iep_config_addr.h
Executable file → Normal file
@@ -1,111 +1,112 @@
|
||||
#ifndef HW_IEP_CONFIG_ADDR_H_
|
||||
#define HW_IEP_CONFIG_ADDR_H_
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#define IEP_BASE 0x0 //ignore the IEP_BASE when program running in linux kernel //0x10108000
|
||||
|
||||
#define IEP_CONFIG0 0x0000
|
||||
#define IEP_CONFIG1 0x0004
|
||||
|
||||
#define IEP_STATUS 0x0008
|
||||
#define IEP_INT 0x000C
|
||||
#define IEP_FRM_START 0x0010
|
||||
#define IEP_SOFT_RST 0x0014
|
||||
#define IEP_CONF_DONE 0x0018
|
||||
|
||||
#define IEP_VIR_IMG_WIDTH 0x0020
|
||||
|
||||
#define IEP_IMG_SCL_FCT 0x0024
|
||||
|
||||
#define IEP_SRC_IMG_SIZE 0x0028
|
||||
#define IEP_DST_IMG_SIZE 0x002C
|
||||
|
||||
#define IEP_DST_IMG_WIDTH_TILE0 0x0030
|
||||
#define IEP_DST_IMG_WIDTH_TILE1 0x0034
|
||||
#define IEP_DST_IMG_WIDTH_TILE2 0x0038
|
||||
#define IEP_DST_IMG_WIDTH_TILE3 0x003C
|
||||
|
||||
#define IEP_ENH_YUV_CNFG_0 0x0040
|
||||
#define IEP_ENH_YUV_CNFG_1 0x0044
|
||||
#define IEP_ENH_YUV_CNFG_2 0x0048
|
||||
#define IEP_ENH_RGB_CNFG 0x004C
|
||||
#define IEP_ENH_C_COE 0x0050
|
||||
|
||||
#define IEP_SRC_ADDR_YRGB 0x0080
|
||||
#define IEP_SRC_ADDR_CBCR 0x0084
|
||||
#define IEP_SRC_ADDR_CR 0x0088
|
||||
#define IEP_SRC_ADDR_Y1 0x008C
|
||||
#define IEP_SRC_ADDR_CBCR1 0x0090
|
||||
#define IEP_SRC_ADDR_CR1 0x0094
|
||||
#define IEP_SRC_ADDR_Y_ITEMP 0x0098
|
||||
#define IEP_SRC_ADDR_CBCR_ITEMP 0x009C
|
||||
#define IEP_SRC_ADDR_CR_ITEMP 0x00A0
|
||||
#define IEP_SRC_ADDR_Y_FTEMP 0x00A4
|
||||
#define IEP_SRC_ADDR_CBCR_FTEMP 0x00A8
|
||||
#define IEP_SRC_ADDR_CR_FTEMP 0x00AC
|
||||
|
||||
#define IEP_DST_ADDR_YRGB 0x00B0
|
||||
#define IEP_DST_ADDR_CBCR 0x00B4
|
||||
#define IEP_DST_ADDR_CR 0x00B8
|
||||
#define IEP_DST_ADDR_Y1 0x00BC
|
||||
#define IEP_DST_ADDR_CBCR1 0x00C0
|
||||
#define IEP_DST_ADDR_CR1 0x00C4
|
||||
#define IEP_DST_ADDR_Y_ITEMP 0x00C8
|
||||
#define IEP_DST_ADDR_CBCR_ITEMP 0x00CC
|
||||
#define IEP_DST_ADDR_CR_ITEMP 0x00D0
|
||||
#define IEP_DST_ADDR_Y_FTEMP 0x00D4
|
||||
#define IEP_DST_ADDR_CBCR_FTEMP 0x00D8
|
||||
#define IEP_DST_ADDR_CR_FTEMP 0x00DC
|
||||
|
||||
#define IEP_DIL_MTN_TAB0 0x00E0
|
||||
#define IEP_DIL_MTN_TAB1 0x00E4
|
||||
#define IEP_DIL_MTN_TAB2 0x00E8
|
||||
#define IEP_DIL_MTN_TAB3 0x00EC
|
||||
#define IEP_DIL_MTN_TAB4 0x00F0
|
||||
#define IEP_DIL_MTN_TAB5 0x00F4
|
||||
#define IEP_DIL_MTN_TAB6 0x00F8
|
||||
#define IEP_DIL_MTN_TAB7 0x00FC
|
||||
|
||||
#define IEP_ENH_CG_TAB 0x0100
|
||||
|
||||
#define IEP_YUV_DNS_CRCT_TEMP 0x0400
|
||||
#define IEP_YUV_DNS_CRCT_SPAT 0x0800
|
||||
|
||||
#define IEP_ENH_DDE_COE0 0x0C00
|
||||
#define IEP_ENH_DDE_COE1 0x0E00
|
||||
|
||||
#define RAW_IEP_CONFIG0 0x0058
|
||||
#define RAW_IEP_CONFIG1 0x005C
|
||||
#define RAW_IEP_VIR_IMG_WIDTH 0x0060
|
||||
|
||||
#define RAW_IEP_IMG_SCL_FCT 0x0064
|
||||
|
||||
#define RAW_IEP_SRC_IMG_SIZE 0x0068
|
||||
#define RAW_IEP_DST_IMG_SIZE 0x006C
|
||||
|
||||
#define RAW_IEP_ENH_YUV_CNFG_0 0x0070
|
||||
#define RAW_IEP_ENH_YUV_CNFG_1 0x0074
|
||||
#define RAW_IEP_ENH_YUV_CNFG_2 0x0078
|
||||
#define RAW_IEP_ENH_RGB_CNFG 0x007C
|
||||
|
||||
#if defined(CONFIG_IEP_MMU)
|
||||
#define IEP_MMU_BASE 0x0800
|
||||
#define IEP_MMU_DTE_ADDR (IEP_MMU_BASE+0x00)
|
||||
#define IEP_MMU_STATUS (IEP_MMU_BASE+0x04)
|
||||
#define IEP_MMU_CMD (IEP_MMU_BASE+0x08)
|
||||
#define IEP_MMU_PAGE_FAULT_ADDR (IEP_MMU_BASE+0x0c)
|
||||
#define IEP_MMU_ZAP_ONE_LINE (IEP_MMU_BASE+0x10)
|
||||
#define IEP_MMU_INT_RAWSTAT (IEP_MMU_BASE+0x14)
|
||||
#define IEP_MMU_INT_CLEAR (IEP_MMU_BASE+0x18)
|
||||
#define IEP_MMU_INT_MASK (IEP_MMU_BASE+0x1c)
|
||||
#define IEP_MMU_INT_STATUS (IEP_MMU_BASE+0x20)
|
||||
#define IEP_MMU_AUTO_GATING (IEP_MMU_BASE+0x24)
|
||||
#endif
|
||||
|
||||
#define ReadReg32(base, raddr) (__raw_readl(base + raddr))
|
||||
#define WriteReg32(base, waddr, value) (__raw_writel(value, base + waddr))
|
||||
#define ConfRegBits32(base, raddr, waddr, position, value) WriteReg32(base, waddr, (ReadReg32(base, waddr)&~(position))|(value))
|
||||
#define MaskRegBits32(base, waddr, position, value) WriteReg32(base, waddr, (ReadReg32(base, waddr)&~(position))|(value))
|
||||
|
||||
#endif
|
||||
#ifndef HW_IEP_CONFIG_ADDR_H_
|
||||
#define HW_IEP_CONFIG_ADDR_H_
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
/*ignore the IEP_BASE when program running in linux kernel */
|
||||
#define IEP_BASE 0x0
|
||||
|
||||
#define IEP_CONFIG0 0x0000
|
||||
#define IEP_CONFIG1 0x0004
|
||||
|
||||
#define IEP_STATUS 0x0008
|
||||
#define IEP_INT 0x000C
|
||||
#define IEP_FRM_START 0x0010
|
||||
#define IEP_SOFT_RST 0x0014
|
||||
#define IEP_CONF_DONE 0x0018
|
||||
|
||||
#define IEP_VIR_IMG_WIDTH 0x0020
|
||||
|
||||
#define IEP_IMG_SCL_FCT 0x0024
|
||||
|
||||
#define IEP_SRC_IMG_SIZE 0x0028
|
||||
#define IEP_DST_IMG_SIZE 0x002C
|
||||
|
||||
#define IEP_DST_IMG_WIDTH_TILE0 0x0030
|
||||
#define IEP_DST_IMG_WIDTH_TILE1 0x0034
|
||||
#define IEP_DST_IMG_WIDTH_TILE2 0x0038
|
||||
#define IEP_DST_IMG_WIDTH_TILE3 0x003C
|
||||
|
||||
#define IEP_ENH_YUV_CNFG_0 0x0040
|
||||
#define IEP_ENH_YUV_CNFG_1 0x0044
|
||||
#define IEP_ENH_YUV_CNFG_2 0x0048
|
||||
#define IEP_ENH_RGB_CNFG 0x004C
|
||||
#define IEP_ENH_C_COE 0x0050
|
||||
|
||||
#define IEP_SRC_ADDR_YRGB 0x0080
|
||||
#define IEP_SRC_ADDR_CBCR 0x0084
|
||||
#define IEP_SRC_ADDR_CR 0x0088
|
||||
#define IEP_SRC_ADDR_Y1 0x008C
|
||||
#define IEP_SRC_ADDR_CBCR1 0x0090
|
||||
#define IEP_SRC_ADDR_CR1 0x0094
|
||||
#define IEP_SRC_ADDR_Y_ITEMP 0x0098
|
||||
#define IEP_SRC_ADDR_CBCR_ITEMP 0x009C
|
||||
#define IEP_SRC_ADDR_CR_ITEMP 0x00A0
|
||||
#define IEP_SRC_ADDR_Y_FTEMP 0x00A4
|
||||
#define IEP_SRC_ADDR_CBCR_FTEMP 0x00A8
|
||||
#define IEP_SRC_ADDR_CR_FTEMP 0x00AC
|
||||
|
||||
#define IEP_DST_ADDR_YRGB 0x00B0
|
||||
#define IEP_DST_ADDR_CBCR 0x00B4
|
||||
#define IEP_DST_ADDR_CR 0x00B8
|
||||
#define IEP_DST_ADDR_Y1 0x00BC
|
||||
#define IEP_DST_ADDR_CBCR1 0x00C0
|
||||
#define IEP_DST_ADDR_CR1 0x00C4
|
||||
#define IEP_DST_ADDR_Y_ITEMP 0x00C8
|
||||
#define IEP_DST_ADDR_CBCR_ITEMP 0x00CC
|
||||
#define IEP_DST_ADDR_CR_ITEMP 0x00D0
|
||||
#define IEP_DST_ADDR_Y_FTEMP 0x00D4
|
||||
#define IEP_DST_ADDR_CBCR_FTEMP 0x00D8
|
||||
#define IEP_DST_ADDR_CR_FTEMP 0x00DC
|
||||
|
||||
#define IEP_DIL_MTN_TAB0 0x00E0
|
||||
#define IEP_DIL_MTN_TAB1 0x00E4
|
||||
#define IEP_DIL_MTN_TAB2 0x00E8
|
||||
#define IEP_DIL_MTN_TAB3 0x00EC
|
||||
#define IEP_DIL_MTN_TAB4 0x00F0
|
||||
#define IEP_DIL_MTN_TAB5 0x00F4
|
||||
#define IEP_DIL_MTN_TAB6 0x00F8
|
||||
#define IEP_DIL_MTN_TAB7 0x00FC
|
||||
|
||||
#define IEP_ENH_CG_TAB 0x0100
|
||||
|
||||
#define IEP_YUV_DNS_CRCT_TEMP 0x0400
|
||||
#define IEP_YUV_DNS_CRCT_SPAT 0x0800
|
||||
|
||||
#define IEP_ENH_DDE_COE0 0x0C00
|
||||
#define IEP_ENH_DDE_COE1 0x0E00
|
||||
|
||||
#define RAW_IEP_CONFIG0 0x0058
|
||||
#define RAW_IEP_CONFIG1 0x005C
|
||||
#define RAW_IEP_VIR_IMG_WIDTH 0x0060
|
||||
|
||||
#define RAW_IEP_IMG_SCL_FCT 0x0064
|
||||
|
||||
#define RAW_IEP_SRC_IMG_SIZE 0x0068
|
||||
#define RAW_IEP_DST_IMG_SIZE 0x006C
|
||||
|
||||
#define RAW_IEP_ENH_YUV_CNFG_0 0x0070
|
||||
#define RAW_IEP_ENH_YUV_CNFG_1 0x0074
|
||||
#define RAW_IEP_ENH_YUV_CNFG_2 0x0078
|
||||
#define RAW_IEP_ENH_RGB_CNFG 0x007C
|
||||
|
||||
#if defined(CONFIG_IEP_MMU)
|
||||
#define IEP_MMU_BASE 0x0800
|
||||
#define IEP_MMU_DTE_ADDR (IEP_MMU_BASE+0x00)
|
||||
#define IEP_MMU_STATUS (IEP_MMU_BASE+0x04)
|
||||
#define IEP_MMU_CMD (IEP_MMU_BASE+0x08)
|
||||
#define IEP_MMU_PAGE_FAULT_ADDR (IEP_MMU_BASE+0x0c)
|
||||
#define IEP_MMU_ZAP_ONE_LINE (IEP_MMU_BASE+0x10)
|
||||
#define IEP_MMU_INT_RAWSTAT (IEP_MMU_BASE+0x14)
|
||||
#define IEP_MMU_INT_CLEAR (IEP_MMU_BASE+0x18)
|
||||
#define IEP_MMU_INT_MASK (IEP_MMU_BASE+0x1c)
|
||||
#define IEP_MMU_INT_STATUS (IEP_MMU_BASE+0x20)
|
||||
#define IEP_MMU_AUTO_GATING (IEP_MMU_BASE+0x24)
|
||||
#endif
|
||||
|
||||
#define ReadReg32(base, raddr) (__raw_readl(base + raddr))
|
||||
#define WriteReg32(base, waddr, value) (__raw_writel(value, base + waddr))
|
||||
#define ConfRegBits32(base, raddr, waddr, position, value) WriteReg32(base, waddr, (ReadReg32(base, waddr)&~(position))|(value))
|
||||
#define MaskRegBits32(base, waddr, position, value) WriteReg32(base, waddr, (ReadReg32(base, waddr)&~(position))|(value))
|
||||
|
||||
#endif
|
||||
|
||||
2612
drivers/video/rockchip/iep/hw_iep_reg.c
Executable file → Normal file
2612
drivers/video/rockchip/iep/hw_iep_reg.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
1366
drivers/video/rockchip/iep/hw_iep_reg.h
Executable file → Normal file
1366
drivers/video/rockchip/iep/hw_iep_reg.h
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
457
drivers/video/rockchip/iep/iep.h
Executable file → Normal file
457
drivers/video/rockchip/iep/iep.h
Executable file → Normal file
@@ -1,234 +1,223 @@
|
||||
#ifndef _IEP_H_
|
||||
#define _IEP_H_
|
||||
|
||||
#define IEP_IOC_MAGIC 'i'
|
||||
|
||||
#define IEP_SET_PARAMETER_REQ _IOW(IEP_IOC_MAGIC, 1, unsigned long)
|
||||
#define IEP_SET_PARAMETER_DEINTERLACE _IOW(IEP_IOC_MAGIC, 2, unsigned long)
|
||||
#define IEP_SET_PARAMETER_ENHANCE _IOW(IEP_IOC_MAGIC, 3, unsigned long)
|
||||
#define IEP_SET_PARAMETER_CONVERT _IOW(IEP_IOC_MAGIC, 4, unsigned long)
|
||||
#define IEP_SET_PARAMETER_SCALE _IOW(IEP_IOC_MAGIC, 5, unsigned long)
|
||||
#define IEP_GET_RESULT_SYNC _IOW(IEP_IOC_MAGIC, 6, unsigned long)
|
||||
#define IEP_GET_RESULT_ASYNC _IOW(IEP_IOC_MAGIC, 7, unsigned long)
|
||||
#define IEP_SET_PARAMETER _IOW(IEP_IOC_MAGIC, 8, unsigned long)
|
||||
#define IEP_RELEASE_CURRENT_TASK _IOW(IEP_IOC_MAGIC, 9, unsigned long)
|
||||
|
||||
/* Driver information */
|
||||
#define DRIVER_DESC "IEP Device Driver"
|
||||
#define DRIVER_NAME "iep"
|
||||
|
||||
/* Logging */
|
||||
#define IEP_DEBUG 0
|
||||
#if IEP_DEBUG
|
||||
#define IEP_DBG(format, args...) printk("%s: " format, DRIVER_NAME, ## args)
|
||||
#else
|
||||
#define IEP_DBG(format, args...)
|
||||
#endif
|
||||
|
||||
#define IEP_INFORMATION 1
|
||||
#if IEP_INFORMATION
|
||||
#define IEP_INFO(format, args...) printk(format, ## args)
|
||||
#else
|
||||
#define IEP_INFO(format, args...)
|
||||
#endif
|
||||
|
||||
#define IEP_ERR(format, args...) printk(KERN_ERR "%s: " format, DRIVER_NAME, ## args)
|
||||
#define IEP_WARNING(format, args...) printk(KERN_WARNING "%s: " format, DRIVER_NAME, ## args)
|
||||
|
||||
enum
|
||||
{
|
||||
yuv2rgb_BT_601_l = 0x0, /* BT.601_1 */
|
||||
yuv2rgb_BT_601_f = 0x1, /* BT.601_f */
|
||||
yuv2rgb_BT_709_l = 0x2, /* BT.709_1 */
|
||||
yuv2rgb_BT_709_f = 0x3, /* BT.709_f */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
rgb2yuv_BT_601_l = 0x0, /* BT.601_1 */
|
||||
rgb2yuv_BT_601_f = 0x1, /* BT.601_f */
|
||||
rgb2yuv_BT_709_l = 0x2, /* BT.709_1 */
|
||||
rgb2yuv_BT_709_f = 0x3, /* BT.709_f */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
dein_mode_bypass_dis = 0x0,
|
||||
dein_mode_I4O2 = 0x1,
|
||||
dein_mode_I4O1B = 0x2,
|
||||
dein_mode_I4O1T = 0x3,
|
||||
dein_mode_I2O1B = 0x4,
|
||||
dein_mode_I2O1T = 0x5,
|
||||
dein_mode_bypass = 0x6,
|
||||
};
|
||||
|
||||
typedef enum IEP_FIELD_ORDER
|
||||
{
|
||||
FIELD_ORDER_TOP_FIRST,
|
||||
FIELD_ORDER_BOTTOM_FIRST
|
||||
} IEP_FIELD_ORDER_t;
|
||||
|
||||
typedef enum IEP_YUV_DEINTERLACE_MODE {
|
||||
IEP_DEINTERLACE_MODE_DISABLE,
|
||||
IEP_DEINTERLACE_MODE_I2O1,
|
||||
IEP_DEINTERLACE_MODE_I4O1,
|
||||
IEP_DEINTERLACE_MODE_I4O2,
|
||||
IEP_DEINTERLACE_MODE_BYPASS
|
||||
} IEP_YUV_DEINTERLACE_MODE_t;
|
||||
|
||||
enum
|
||||
{
|
||||
rgb_enhance_bypass = 0x0,
|
||||
rgb_enhance_denoise = 0x1,
|
||||
rgb_enhance_detail = 0x2,
|
||||
rgb_enhance_edge = 0x3,
|
||||
};//for rgb_enhance_mode
|
||||
|
||||
enum
|
||||
{
|
||||
rgb_contrast_CC_P_DDE = 0x0, //cg prior to dde
|
||||
rgb_contrast_DDE_P_CC = 0x1, //dde prior to cg
|
||||
}; //for rgb_contrast_enhance_mode
|
||||
|
||||
enum
|
||||
{
|
||||
black_screen = 0x0,
|
||||
blue_screen = 0x1,
|
||||
color_bar = 0x2,
|
||||
normal_mode = 0x3,
|
||||
}; //for video mode
|
||||
|
||||
/*
|
||||
// Alpha Red Green Blue
|
||||
{ 4, 32, {{32,24, 24,16, 16, 8, 8, 0 }}, GGL_RGBA }, // IEP_FORMAT_ARGB_8888
|
||||
{ 4, 32, {{32,24, 8, 0, 16, 8, 24,16 }}, GGL_RGB }, // IEP_FORMAT_ABGR_8888
|
||||
{ 4, 32, {{ 8, 0, 32,24, 24,16, 16, 8 }}, GGL_RGB }, // IEP_FORMAT_RGBA_8888
|
||||
{ 4, 32, {{ 8, 0, 16, 8, 24,16, 32,24 }}, GGL_BGRA }, // IEP_FORMAT_BGRA_8888
|
||||
{ 2, 16, {{ 0, 0, 16,11, 11, 5, 5, 0 }}, GGL_RGB }, // IEP_FORMAT_RGB_565
|
||||
{ 2, 16, {{ 0, 0, 5, 0, 11, 5, 16,11 }}, GGL_RGB }, // IEP_FORMAT_RGB_565
|
||||
*/
|
||||
enum
|
||||
{
|
||||
IEP_FORMAT_ARGB_8888 = 0x0,
|
||||
IEP_FORMAT_ABGR_8888 = 0x1,
|
||||
IEP_FORMAT_RGBA_8888 = 0x2,
|
||||
IEP_FORMAT_BGRA_8888 = 0x3,
|
||||
IEP_FORMAT_RGB_565 = 0x4,
|
||||
IEP_FORMAT_BGR_565 = 0x5,
|
||||
|
||||
IEP_FORMAT_YCbCr_422_SP = 0x10,
|
||||
IEP_FORMAT_YCbCr_422_P = 0x11,
|
||||
IEP_FORMAT_YCbCr_420_SP = 0x12,
|
||||
IEP_FORMAT_YCbCr_420_P = 0x13,
|
||||
IEP_FORMAT_YCrCb_422_SP = 0x14,
|
||||
IEP_FORMAT_YCrCb_422_P = 0x15,//same as IEP_FORMAT_YCbCr_422_P
|
||||
IEP_FORMAT_YCrCb_420_SP = 0x16,
|
||||
IEP_FORMAT_YCrCb_420_P = 0x17,//same as IEP_FORMAT_YCbCr_420_P
|
||||
|
||||
}; //for format
|
||||
|
||||
typedef struct iep_img
|
||||
{
|
||||
unsigned short act_w; // act_width
|
||||
unsigned short act_h; // act_height
|
||||
signed short x_off; // x offset for the vir,word unit
|
||||
signed short y_off; // y offset for the vir,word unit
|
||||
|
||||
unsigned short vir_w; //unit :pix
|
||||
unsigned short vir_h; //unit :pix
|
||||
unsigned int format;
|
||||
unsigned int *mem_addr;
|
||||
unsigned int *uv_addr;
|
||||
unsigned int *v_addr;
|
||||
|
||||
unsigned char rb_swap;//not be used
|
||||
unsigned char uv_swap;//not be used
|
||||
|
||||
unsigned char alpha_swap;//not be used
|
||||
}
|
||||
iep_img;
|
||||
|
||||
|
||||
typedef struct IEP_MSG
|
||||
{
|
||||
iep_img src; // src active window
|
||||
iep_img dst; // src virtual window
|
||||
|
||||
iep_img src1;
|
||||
iep_img dst1;
|
||||
|
||||
iep_img src_itemp;
|
||||
iep_img src_ftemp;
|
||||
|
||||
iep_img dst_itemp;
|
||||
iep_img dst_ftemp;
|
||||
|
||||
unsigned char dither_up_en;
|
||||
unsigned char dither_down_en;//not to be used
|
||||
|
||||
unsigned char yuv2rgb_mode;
|
||||
unsigned char rgb2yuv_mode;
|
||||
|
||||
unsigned char global_alpha_value;
|
||||
|
||||
unsigned char rgb2yuv_clip_en;
|
||||
unsigned char yuv2rgb_clip_en;
|
||||
|
||||
unsigned char lcdc_path_en;
|
||||
int off_x;
|
||||
int off_y;
|
||||
int width;
|
||||
int height;
|
||||
int layer;
|
||||
|
||||
unsigned char yuv_3D_denoise_en;
|
||||
|
||||
/// yuv color enhance
|
||||
unsigned char yuv_enhance_en;
|
||||
int sat_con_int;
|
||||
int contrast_int;
|
||||
int cos_hue_int;
|
||||
int sin_hue_int;
|
||||
signed char yuv_enh_brightness;//-32<brightness<31
|
||||
unsigned char video_mode;//0-3
|
||||
unsigned char color_bar_y;//0-127
|
||||
unsigned char color_bar_u;//0-127
|
||||
unsigned char color_bar_v;//0-127
|
||||
|
||||
|
||||
unsigned char rgb_enhance_en;//i don't konw what is used
|
||||
|
||||
unsigned char rgb_color_enhance_en;//sw_rgb_color_enh_en
|
||||
unsigned int rgb_enh_coe;
|
||||
|
||||
unsigned char rgb_enhance_mode;//sw_rgb_enh_sel,dde sel
|
||||
|
||||
unsigned char rgb_cg_en;//sw_rgb_con_gam_en
|
||||
unsigned int cg_tab[192];
|
||||
|
||||
unsigned char rgb_contrast_enhance_mode;//sw_con_gam_order;0 cg prior to dde,1 dde prior to cg
|
||||
|
||||
int enh_threshold;
|
||||
int enh_alpha;
|
||||
int enh_radius;
|
||||
|
||||
unsigned char scale_up_mode;
|
||||
|
||||
unsigned char field_order;
|
||||
unsigned char dein_mode;
|
||||
//DIL HF
|
||||
unsigned char dein_high_fre_en;
|
||||
unsigned char dein_high_fre_fct;
|
||||
//DIL EI
|
||||
unsigned char dein_ei_mode;
|
||||
unsigned char dein_ei_smooth;
|
||||
unsigned char dein_ei_sel;
|
||||
unsigned char dein_ei_radius;//when dein_ei_sel=0 will be used
|
||||
|
||||
bool vir_addr_enable;
|
||||
|
||||
void *base;
|
||||
}
|
||||
IEP_MSG;
|
||||
|
||||
#endif
|
||||
#ifndef _IEP_H_
|
||||
#define _IEP_H_
|
||||
|
||||
#define IEP_IOC_MAGIC 'i'
|
||||
|
||||
#define IEP_SET_PARAMETER_REQ _IOW(IEP_IOC_MAGIC, 1, unsigned long)
|
||||
#define IEP_SET_PARAMETER_DEINTERLACE _IOW(IEP_IOC_MAGIC, 2, unsigned long)
|
||||
#define IEP_SET_PARAMETER_ENHANCE _IOW(IEP_IOC_MAGIC, 3, unsigned long)
|
||||
#define IEP_SET_PARAMETER_CONVERT _IOW(IEP_IOC_MAGIC, 4, unsigned long)
|
||||
#define IEP_SET_PARAMETER_SCALE _IOW(IEP_IOC_MAGIC, 5, unsigned long)
|
||||
#define IEP_GET_RESULT_SYNC _IOW(IEP_IOC_MAGIC, 6, unsigned long)
|
||||
#define IEP_GET_RESULT_ASYNC _IOW(IEP_IOC_MAGIC, 7, unsigned long)
|
||||
#define IEP_SET_PARAMETER _IOW(IEP_IOC_MAGIC, 8, unsigned long)
|
||||
#define IEP_RELEASE_CURRENT_TASK _IOW(IEP_IOC_MAGIC, 9, unsigned long)
|
||||
|
||||
/* Driver information */
|
||||
#define DRIVER_DESC "IEP Device Driver"
|
||||
#define DRIVER_NAME "iep"
|
||||
|
||||
/* Logging */
|
||||
#define IEP_DEBUG 0
|
||||
#if IEP_DEBUG
|
||||
#define IEP_DBG(format, args...) printk("%s: " format, DRIVER_NAME, ## args)
|
||||
#else
|
||||
#define IEP_DBG(format, args...)
|
||||
#endif
|
||||
|
||||
#define IEP_INFORMATION 1
|
||||
#if IEP_INFORMATION
|
||||
#define IEP_INFO(format, args...) printk(format, ## args)
|
||||
#else
|
||||
#define IEP_INFO(format, args...)
|
||||
#endif
|
||||
|
||||
#define IEP_ERR(format, args...) printk(KERN_ERR "%s: " format, DRIVER_NAME, ## args)
|
||||
#define IEP_WARNING(format, args...) printk(KERN_WARNING "%s: " format, DRIVER_NAME, ## args)
|
||||
|
||||
enum {
|
||||
yuv2rgb_BT_601_l = 0x0, /* BT.601_1 */
|
||||
yuv2rgb_BT_601_f = 0x1, /* BT.601_f */
|
||||
yuv2rgb_BT_709_l = 0x2, /* BT.709_1 */
|
||||
yuv2rgb_BT_709_f = 0x3, /* BT.709_f */
|
||||
};
|
||||
|
||||
enum {
|
||||
rgb2yuv_BT_601_l = 0x0, /* BT.601_1 */
|
||||
rgb2yuv_BT_601_f = 0x1, /* BT.601_f */
|
||||
rgb2yuv_BT_709_l = 0x2, /* BT.709_1 */
|
||||
rgb2yuv_BT_709_f = 0x3, /* BT.709_f */
|
||||
};
|
||||
|
||||
enum {
|
||||
dein_mode_bypass_dis = 0x0,
|
||||
dein_mode_I4O2 = 0x1,
|
||||
dein_mode_I4O1B = 0x2,
|
||||
dein_mode_I4O1T = 0x3,
|
||||
dein_mode_I2O1B = 0x4,
|
||||
dein_mode_I2O1T = 0x5,
|
||||
dein_mode_bypass = 0x6,
|
||||
};
|
||||
|
||||
enum IEP_FIELD_ORDER {
|
||||
FIELD_ORDER_TOP_FIRST,
|
||||
FIELD_ORDER_BOTTOM_FIRST
|
||||
};
|
||||
|
||||
enum IEP_YUV_DEINTERLACE_MODE {
|
||||
IEP_DEINTERLACE_MODE_DISABLE,
|
||||
IEP_DEINTERLACE_MODE_I2O1,
|
||||
IEP_DEINTERLACE_MODE_I4O1,
|
||||
IEP_DEINTERLACE_MODE_I4O2,
|
||||
IEP_DEINTERLACE_MODE_BYPASS
|
||||
};
|
||||
|
||||
enum {
|
||||
rgb_enhance_bypass = 0x0,
|
||||
rgb_enhance_denoise = 0x1,
|
||||
rgb_enhance_detail = 0x2,
|
||||
rgb_enhance_edge = 0x3,
|
||||
};/* for rgb_enhance_mode */
|
||||
|
||||
enum {
|
||||
rgb_contrast_CC_P_DDE = 0x0, /* cg prior to dde */
|
||||
rgb_contrast_DDE_P_CC = 0x1, /* dde prior to cg */
|
||||
}; /* for rgb_contrast_enhance_mode */
|
||||
|
||||
enum {
|
||||
black_screen = 0x0,
|
||||
blue_screen = 0x1,
|
||||
color_bar = 0x2,
|
||||
normal_mode = 0x3,
|
||||
}; /* for video mode */
|
||||
|
||||
/*
|
||||
Alpha Red Green Blue
|
||||
{ 4, 32, {{32,24, 24,16, 16, 8, 8, 0 }}, GGL_RGBA }, IEP_FORMAT_ARGB_8888
|
||||
{ 4, 32, {{32,24, 8, 0, 16, 8, 24,16 }}, GGL_RGB }, IEP_FORMAT_ABGR_8888
|
||||
{ 4, 32, {{ 8, 0, 32,24, 24,16, 16, 8 }}, GGL_RGB }, IEP_FORMAT_RGBA_8888
|
||||
{ 4, 32, {{ 8, 0, 16, 8, 24,16, 32,24 }}, GGL_BGRA }, IEP_FORMAT_BGRA_8888
|
||||
{ 2, 16, {{ 0, 0, 16,11, 11, 5, 5, 0 }}, GGL_RGB }, IEP_FORMAT_RGB_565
|
||||
{ 2, 16, {{ 0, 0, 5, 0, 11, 5, 16,11 }}, GGL_RGB }, IEP_FORMAT_RGB_565
|
||||
*/
|
||||
enum {
|
||||
IEP_FORMAT_ARGB_8888 = 0x0,
|
||||
IEP_FORMAT_ABGR_8888 = 0x1,
|
||||
IEP_FORMAT_RGBA_8888 = 0x2,
|
||||
IEP_FORMAT_BGRA_8888 = 0x3,
|
||||
IEP_FORMAT_RGB_565 = 0x4,
|
||||
IEP_FORMAT_BGR_565 = 0x5,
|
||||
|
||||
IEP_FORMAT_YCbCr_422_SP = 0x10,
|
||||
IEP_FORMAT_YCbCr_422_P = 0x11,
|
||||
IEP_FORMAT_YCbCr_420_SP = 0x12,
|
||||
IEP_FORMAT_YCbCr_420_P = 0x13,
|
||||
IEP_FORMAT_YCrCb_422_SP = 0x14,
|
||||
IEP_FORMAT_YCrCb_422_P = 0x15,/* same as IEP_FORMAT_YCbCr_422_P */
|
||||
IEP_FORMAT_YCrCb_420_SP = 0x16,
|
||||
IEP_FORMAT_YCrCb_420_P = 0x17,/* same as IEP_FORMAT_YCbCr_420_P */
|
||||
}; /* for format */
|
||||
|
||||
struct iep_img
|
||||
{
|
||||
unsigned short act_w; // act_width
|
||||
unsigned short act_h; // act_height
|
||||
signed short x_off; // x offset for the vir,word unit
|
||||
signed short y_off; // y offset for the vir,word unit
|
||||
|
||||
unsigned short vir_w; //unit :pix
|
||||
unsigned short vir_h; //unit :pix
|
||||
unsigned int format;
|
||||
unsigned int *mem_addr;
|
||||
unsigned int *uv_addr;
|
||||
unsigned int *v_addr;
|
||||
|
||||
unsigned char rb_swap;//not be used
|
||||
unsigned char uv_swap;//not be used
|
||||
|
||||
unsigned char alpha_swap;//not be used
|
||||
};
|
||||
|
||||
|
||||
struct IEP_MSG {
|
||||
struct iep_img src;
|
||||
struct iep_img dst;
|
||||
|
||||
struct iep_img src1;
|
||||
struct iep_img dst1;
|
||||
|
||||
struct iep_img src_itemp;
|
||||
struct iep_img src_ftemp;
|
||||
|
||||
struct iep_img dst_itemp;
|
||||
struct iep_img dst_ftemp;
|
||||
|
||||
u8 dither_up_en;
|
||||
u8 dither_down_en;/* not to be used */
|
||||
|
||||
u8 yuv2rgb_mode;
|
||||
u8 rgb2yuv_mode;
|
||||
|
||||
u8 global_alpha_value;
|
||||
|
||||
u8 rgb2yuv_clip_en;
|
||||
u8 yuv2rgb_clip_en;
|
||||
|
||||
u8 lcdc_path_en;
|
||||
int off_x;
|
||||
int off_y;
|
||||
int width;
|
||||
int height;
|
||||
int layer;
|
||||
|
||||
u8 yuv_3D_denoise_en;
|
||||
|
||||
/* yuv color enhance */
|
||||
u8 yuv_enhance_en;
|
||||
int sat_con_int;
|
||||
int contrast_int;
|
||||
int cos_hue_int;
|
||||
int sin_hue_int;
|
||||
s8 yuv_enh_brightness; /*-32<brightness<31*/
|
||||
u8 video_mode; /*0-3*/
|
||||
u8 color_bar_y; /*0-127*/
|
||||
u8 color_bar_u; /*0-127*/
|
||||
u8 color_bar_v; /*0-127*/
|
||||
|
||||
|
||||
u8 rgb_enhance_en;/*i don't konw what is used*/
|
||||
|
||||
u8 rgb_color_enhance_en;/*sw_rgb_color_enh_en*/
|
||||
unsigned int rgb_enh_coe;
|
||||
|
||||
u8 rgb_enhance_mode;/*sw_rgb_enh_sel,dde sel*/
|
||||
|
||||
u8 rgb_cg_en;/*sw_rgb_con_gam_en*/
|
||||
unsigned int cg_tab[192];
|
||||
|
||||
/*sw_con_gam_order;0 cg prior to dde,1 dde prior to cg*/
|
||||
u8 rgb_contrast_enhance_mode;
|
||||
|
||||
int enh_threshold;
|
||||
int enh_alpha;
|
||||
int enh_radius;
|
||||
|
||||
u8 scale_up_mode;
|
||||
|
||||
u8 field_order;
|
||||
u8 dein_mode;
|
||||
/*DIL HF*/
|
||||
u8 dein_high_fre_en;
|
||||
u8 dein_high_fre_fct;
|
||||
/*DIL EI*/
|
||||
u8 dein_ei_mode;
|
||||
u8 dein_ei_smooth;
|
||||
u8 dein_ei_sel;
|
||||
u8 dein_ei_radius;/*when dein_ei_sel=0 will be used*/
|
||||
|
||||
u8 vir_addr_enable;
|
||||
|
||||
void *base;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
#include "iep_api.h"
|
||||
|
||||
|
||||
|
||||
void
|
||||
iep_set_act_info(iep_img *img, unsigned int w, unsigned int h, unsigned int x_off, unsigned int y_off)
|
||||
{
|
||||
|
||||
img->act_w = w;
|
||||
img->act_h = h;
|
||||
img->x_off = x_off;
|
||||
img->y_off = y_off;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_vir_info(iep_img *img, unsigned int w, unsigned int h, unsigned int *yrgb, unsigned int *uv, unsigned int *v, unsigned int format )
|
||||
{
|
||||
|
||||
img->vir_w = w;
|
||||
img->vir_h = h;
|
||||
img->mem_addr = yrgb;
|
||||
img->uv_addr = uv;
|
||||
img->v_addr = v;
|
||||
img->format = format;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_scl_up_mode(IEP_MSG *msg, unsigned char mode)
|
||||
{
|
||||
msg->scale_up_mode = mode;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_color_enhance(IEP_MSG *msg, unsigned char color_enh_en,float color_enh_coe)
|
||||
{
|
||||
msg->rgb_color_enhance_en = color_enh_en;
|
||||
msg->rgb_enh_coe = color_enh_coe;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
iep_rgb_cg(IEP_MSG *msg,unsigned char cg_en,double cg_rr,double cg_rg,double cg_rb)
|
||||
{
|
||||
msg->rgb_cg_en=cg_en;
|
||||
msg->cg_rr=cg_rr;
|
||||
msg->cg_rg=cg_rg;
|
||||
msg->cg_rb=cg_rb;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_deinterlace(IEP_MSG *msg, unsigned char mode, unsigned char dein_high_fre_en, unsigned char dein_edge_interp_en)
|
||||
{
|
||||
msg->dein_mode = mode;
|
||||
msg->dein_high_fre_en = dein_high_fre_en;
|
||||
msg->dein_ei_mode = dein_edge_interp_en;
|
||||
}
|
||||
void
|
||||
iep_set_dil_ei_smooth(IEP_MSG *msg,unsigned int en)
|
||||
{
|
||||
msg->dein_ei_smooth = en;
|
||||
}
|
||||
void
|
||||
iep_set_dil_ei(IEP_MSG *msg,unsigned char ei_sel,unsigned char ei_radius,unsigned char ei_smooth_en,unsigned char ei_mode)
|
||||
{
|
||||
msg->dein_ei_sel=ei_sel;
|
||||
msg->dein_ei_radius=ei_radius;
|
||||
msg->dein_ei_smooth=ei_smooth_en;
|
||||
msg->dein_ei_mode=ei_mode;
|
||||
}
|
||||
void
|
||||
iep_set_dil_hf(IEP_MSG *msg,unsigned char dil_hf_en,unsigned char dil_hf_fct)
|
||||
{
|
||||
msg->dein_high_fre_en=dil_hf_en;
|
||||
msg->dein_high_fre_fct=dil_hf_fct;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_rgb2yuv(IEP_MSG *msg, unsigned char rgb2yuv_mode, unsigned char rgb2yuv_clip_en)
|
||||
{
|
||||
msg->rgb2yuv_mode = rgb2yuv_mode;
|
||||
msg->rgb2yuv_clip_en = rgb2yuv_clip_en;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_yuv2rgb(IEP_MSG *msg, unsigned char yuv2rgb_mode, unsigned char yuv2rgb_clip_en)
|
||||
{
|
||||
msg->yuv2rgb_mode = yuv2rgb_mode;
|
||||
msg->yuv2rgb_clip_en = yuv2rgb_clip_en;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_dither_up(IEP_MSG *msg,unsigned int en)
|
||||
{
|
||||
msg->dither_up_en = en;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_lcdc_path(IEP_MSG *msg)
|
||||
{
|
||||
msg->lcdc_path_en = 1;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_3D_denoise(IEP_MSG *msg)
|
||||
{
|
||||
msg->yuv_3D_denoise_en = 1;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_yuv_normal_mode_enh(IEP_MSG *msg,float saturation,float contrast,signed char brightness,signed char angle)
|
||||
{
|
||||
msg->yuv_enhance_en = 1;
|
||||
msg->video_mode = normal_mode;
|
||||
msg->yuv_enh_saturation = saturation;
|
||||
msg->yuv_enh_contrast = contrast;
|
||||
msg->yuv_enh_brightness = brightness;
|
||||
msg->yuv_enh_hue_angle = angle;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_yuv_black_screen(IEP_MSG *msg)
|
||||
{
|
||||
msg->yuv_enhance_en = 1;
|
||||
msg->video_mode = black_screen;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_yuv_blue_screen(IEP_MSG *msg)
|
||||
{
|
||||
msg->yuv_enhance_en = 1;
|
||||
msg->video_mode = blue_screen;
|
||||
}
|
||||
|
||||
void
|
||||
iep_set_yuv_color_bar(IEP_MSG *msg,unsigned char color_bar_y,unsigned char color_bar_u,unsigned char color_bar_v)
|
||||
{
|
||||
msg->yuv_enhance_en = 1;
|
||||
msg->video_mode = color_bar;
|
||||
msg->color_bar_y = color_bar_y;
|
||||
msg->color_bar_u = color_bar_u;
|
||||
msg->color_bar_v = color_bar_v;
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#ifndef __IEP_API_H__
|
||||
#define __IEP_API_H__
|
||||
|
||||
|
||||
#include "iep.h"
|
||||
//#include "../lcdc/hwapi_lcdc.h"
|
||||
|
||||
void
|
||||
iep_set_act_info(iep_img *img, unsigned int w, unsigned int h, unsigned int x_off, unsigned int y_off);
|
||||
|
||||
void
|
||||
iep_set_vir_info(iep_img *img, unsigned int w, unsigned int h, unsigned int *yrgb, unsigned int *uv, unsigned int *v, unsigned int format );
|
||||
|
||||
void
|
||||
iep_set_scl_up_mode(IEP_MSG *msg, unsigned char mode);
|
||||
|
||||
void
|
||||
iep_set_color_enhance(IEP_MSG *msg, unsigned char color_enh_en,float color_enh_coe);
|
||||
|
||||
void
|
||||
iep_rgb_cg(IEP_MSG *msg,unsigned char cg_en,double cg_rr,double cg_rg,double cg_rb);
|
||||
|
||||
void
|
||||
iep_set_deinterlace(IEP_MSG *msg, unsigned char mode, unsigned char dein_high_fre_en, unsigned char dein_edge_interp_en);
|
||||
|
||||
void
|
||||
iep_set_dil_ei_smooth(IEP_MSG *msg,unsigned int en);
|
||||
|
||||
void
|
||||
iep_set_rgb2yuv(IEP_MSG *msg, unsigned char rgb2yuv_mode, unsigned char rgb2yuv_clip_en);
|
||||
|
||||
void
|
||||
iep_set_yuv2rgb(IEP_MSG *msg, unsigned char yuv2rgb_mode, unsigned char yuv2rgb_clip_en);
|
||||
|
||||
void
|
||||
iep_set_dither_up(IEP_MSG *msg,unsigned int en);
|
||||
|
||||
void
|
||||
iep_set_lcdc_path(IEP_MSG *msg);
|
||||
|
||||
void
|
||||
iep_set_3D_denoise(IEP_MSG *msg);
|
||||
|
||||
void
|
||||
iep_set_yuv_normal_mode_enh(IEP_MSG *msg,float saturation,float contrast,signed char brightness,signed char angle);
|
||||
|
||||
void
|
||||
iep_set_yuv_black_screen(IEP_MSG *msg);
|
||||
|
||||
void
|
||||
iep_set_yuv_blue_screen(IEP_MSG *msg);
|
||||
|
||||
void
|
||||
iep_set_yuv_color_bar(IEP_MSG *msg,unsigned char color_bar_y,unsigned char color_bar_u,unsigned char color_bar_v);
|
||||
|
||||
#endif
|
||||
1520
drivers/video/rockchip/iep/iep_drv.c
Executable file → Normal file
1520
drivers/video/rockchip/iep/iep_drv.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
364
drivers/video/rockchip/iep/iep_drv.h
Executable file → Normal file
364
drivers/video/rockchip/iep/iep_drv.h
Executable file → Normal file
@@ -1,182 +1,182 @@
|
||||
#ifndef IEP_DRV_H_
|
||||
#define IEP_DRV_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_IOMMU) && defined(CONFIG_ION_ROCKCHIP)
|
||||
#define CONFIG_IEP_IOMMU
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IEP_IOMMU
|
||||
#include <linux/rockchip_ion.h>
|
||||
#include <linux/rockchip-iovmm.h>
|
||||
#include <linux/dma-buf.h>
|
||||
#endif
|
||||
#include "iep.h"
|
||||
|
||||
#define IEP_REG_LEN 0x100
|
||||
#define IEP_CMD_REG_LEN 0xE
|
||||
#define IEP_ADD_REG_LEN 0xE0
|
||||
#define IEP_RAW_REG_LEN 0xA
|
||||
#define IEP_SYS_REG_LEN 0x6
|
||||
#define IEP_CNF_REG_LEN 0x2
|
||||
|
||||
#define IEP_CNF_REG_BASE 0x0
|
||||
#define IEP_SYS_REG_BASE 0x2
|
||||
#define IEP_CMD_REG_BASE 0x8
|
||||
#define IEP_ADD_REG_BASE 0x20
|
||||
#define IEP_RAW_REG_BASE 0x16
|
||||
|
||||
#if defined(CONFIG_IEP_MMU)
|
||||
#define IEP_MMU_REG_BASE 0x200
|
||||
#define IEP_MMU_REG_LEN 0xA
|
||||
#endif
|
||||
|
||||
struct iep_parameter_req {
|
||||
iep_img src;
|
||||
iep_img dst;
|
||||
};
|
||||
|
||||
struct iep_parameter_deinterlace {
|
||||
iep_img src1;
|
||||
iep_img dst1;
|
||||
|
||||
iep_img src_itemp;
|
||||
iep_img src_ftemp;
|
||||
|
||||
iep_img dst_itemp;
|
||||
iep_img dst_ftemp;
|
||||
|
||||
u8 dein_mode;
|
||||
|
||||
// deinterlace high frequency
|
||||
u8 dein_high_fre_en;
|
||||
u8 dein_high_fre_fct;
|
||||
|
||||
// deinterlace edge interpolation
|
||||
u8 dein_ei_mode;
|
||||
u8 dein_ei_smooth;
|
||||
u8 dein_ei_sel;
|
||||
u8 dein_ei_radius;
|
||||
};
|
||||
|
||||
struct iep_parameter_enhance {
|
||||
u8 yuv_3D_denoise_en;
|
||||
|
||||
u8 yuv_enhance_en;
|
||||
float yuv_enh_saturation; //0-1.992
|
||||
float yuv_enh_contrast; //0-1.992
|
||||
s8 yuv_enh_brightness; //-32<brightness<31
|
||||
s8 yuv_enh_hue_angle; //0-30<EFBFBD>㣬value is 0 - 30
|
||||
|
||||
u8 video_mode; //0-3
|
||||
u8 color_bar_y; //0-127
|
||||
u8 color_bar_u; //0-127
|
||||
u8 color_bar_v; //0-127
|
||||
|
||||
u8 rgb_enhance_en;
|
||||
|
||||
u8 rgb_cg_en; //sw_rgb_con_gam_en
|
||||
double cg_rr;
|
||||
double cg_rg;
|
||||
double cg_rb;
|
||||
u8 rgb_color_enhance_en; //sw_rgb_color_enh_en
|
||||
float rgb_enh_coe; //0-3.96875
|
||||
};
|
||||
|
||||
struct iep_parameter_scale {
|
||||
u8 scale_up_mode;
|
||||
};
|
||||
|
||||
struct iep_parameter_convert {
|
||||
u8 dither_up_en;
|
||||
u8 dither_down_en; //not to be used
|
||||
|
||||
u8 yuv2rgb_mode;
|
||||
u8 rgb2yuv_mode;
|
||||
|
||||
u8 global_alpha_value;
|
||||
|
||||
u8 rgb2yuv_clip_en;
|
||||
u8 yuv2rgb_clip_en;
|
||||
};
|
||||
|
||||
typedef struct iep_session {
|
||||
/* a linked list of data so we can access them for debugging */
|
||||
struct list_head list_session;
|
||||
/* a linked list of register data waiting for process */
|
||||
struct list_head waiting;
|
||||
/* a linked list of register data in ready */
|
||||
struct list_head ready;
|
||||
/* a linked list of register data in processing */
|
||||
struct list_head running;
|
||||
/* all coommand this thread done */
|
||||
atomic_t done;
|
||||
wait_queue_head_t wait;
|
||||
pid_t pid;
|
||||
atomic_t task_running;
|
||||
atomic_t num_done;
|
||||
|
||||
#if defined(CONFIG_IEP_MMU)
|
||||
uint32_t* dte_table;
|
||||
struct list_head pte_list;
|
||||
struct task_struct *tsk;
|
||||
#endif
|
||||
} iep_session;
|
||||
|
||||
typedef struct iep_service_info {
|
||||
struct mutex lock;
|
||||
struct timer_list timer; /* timer for power off */
|
||||
struct list_head waiting; /* link to link_reg in struct iep_reg */
|
||||
atomic_t waitcnt;
|
||||
struct list_head ready; /* link to link_reg in struct iep_reg */
|
||||
struct list_head running; /* link to link_reg in struct iep_reg */
|
||||
struct list_head done; /* link to link_reg in struct iep_reg */
|
||||
struct list_head session; /* link to list_session in struct vpu_session */
|
||||
atomic_t total_running;
|
||||
|
||||
struct iep_reg *reg;
|
||||
bool enable;
|
||||
|
||||
struct mutex mutex; // mutex
|
||||
|
||||
#ifdef CONFIG_IEP_IOMMU
|
||||
struct ion_client *ion_client;
|
||||
struct device *iommu_dev;
|
||||
#endif
|
||||
} iep_service_info;
|
||||
|
||||
struct iep_reg {
|
||||
iep_session *session;
|
||||
struct list_head session_link; /* link to rga service session */
|
||||
struct list_head status_link; /* link to register set list */
|
||||
uint32_t reg[0x300];
|
||||
bool dpi_en;
|
||||
int off_x;
|
||||
int off_y;
|
||||
int act_width;
|
||||
int act_height;
|
||||
int vir_width;
|
||||
int vir_height;
|
||||
int layer;
|
||||
unsigned int format;
|
||||
#if defined(CONFIG_IEP_IOMMU)
|
||||
struct list_head mem_region_list;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(CONFIG_IEP_IOMMU)
|
||||
struct iep_mem_region {
|
||||
struct list_head srv_lnk;
|
||||
struct list_head reg_lnk;
|
||||
struct list_head session_lnk;
|
||||
unsigned long iova; /* virtual address for iommu */
|
||||
unsigned long len;
|
||||
struct ion_handle *hdl;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef IEP_DRV_H_
|
||||
#define IEP_DRV_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_IOMMU) && defined(CONFIG_ION_ROCKCHIP)
|
||||
#define CONFIG_IEP_IOMMU
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IEP_IOMMU
|
||||
#include <linux/rockchip_ion.h>
|
||||
#include <linux/rockchip-iovmm.h>
|
||||
#include <linux/dma-buf.h>
|
||||
#endif
|
||||
#include "iep.h"
|
||||
|
||||
#define IEP_REG_LEN 0x100
|
||||
#define IEP_CMD_REG_LEN 0xE
|
||||
#define IEP_ADD_REG_LEN 0xE0
|
||||
#define IEP_RAW_REG_LEN 0xA
|
||||
#define IEP_SYS_REG_LEN 0x6
|
||||
#define IEP_CNF_REG_LEN 0x2
|
||||
|
||||
#define IEP_CNF_REG_BASE 0x0
|
||||
#define IEP_SYS_REG_BASE 0x2
|
||||
#define IEP_CMD_REG_BASE 0x8
|
||||
#define IEP_ADD_REG_BASE 0x20
|
||||
#define IEP_RAW_REG_BASE 0x16
|
||||
|
||||
#if defined(CONFIG_IEP_MMU)
|
||||
#define IEP_MMU_REG_BASE 0x200
|
||||
#define IEP_MMU_REG_LEN 0xA
|
||||
#endif
|
||||
|
||||
struct iep_parameter_req {
|
||||
struct iep_img src;
|
||||
struct iep_img dst;
|
||||
};
|
||||
|
||||
struct iep_parameter_deinterlace {
|
||||
struct iep_img src1;
|
||||
struct iep_img dst1;
|
||||
|
||||
struct iep_img src_itemp;
|
||||
struct iep_img src_ftemp;
|
||||
|
||||
struct iep_img dst_itemp;
|
||||
struct iep_img dst_ftemp;
|
||||
|
||||
u8 dein_mode;
|
||||
|
||||
// deinterlace high frequency
|
||||
u8 dein_high_fre_en;
|
||||
u8 dein_high_fre_fct;
|
||||
|
||||
// deinterlace edge interpolation
|
||||
u8 dein_ei_mode;
|
||||
u8 dein_ei_smooth;
|
||||
u8 dein_ei_sel;
|
||||
u8 dein_ei_radius;
|
||||
};
|
||||
|
||||
struct iep_parameter_enhance {
|
||||
u8 yuv_3D_denoise_en;
|
||||
|
||||
u8 yuv_enhance_en;
|
||||
float yuv_enh_saturation; //0-1.992
|
||||
float yuv_enh_contrast; //0-1.992
|
||||
s8 yuv_enh_brightness; //-32<brightness<31
|
||||
s8 yuv_enh_hue_angle; //0-30,value is 0 - 30
|
||||
|
||||
u8 video_mode; //0-3
|
||||
u8 color_bar_y; //0-127
|
||||
u8 color_bar_u; //0-127
|
||||
u8 color_bar_v; //0-127
|
||||
|
||||
u8 rgb_enhance_en;
|
||||
|
||||
u8 rgb_cg_en; //sw_rgb_con_gam_en
|
||||
double cg_rr;
|
||||
double cg_rg;
|
||||
double cg_rb;
|
||||
u8 rgb_color_enhance_en; //sw_rgb_color_enh_en
|
||||
float rgb_enh_coe; //0-3.96875
|
||||
};
|
||||
|
||||
struct iep_parameter_scale {
|
||||
u8 scale_up_mode;
|
||||
};
|
||||
|
||||
struct iep_parameter_convert {
|
||||
u8 dither_up_en;
|
||||
u8 dither_down_en; //not to be used
|
||||
|
||||
u8 yuv2rgb_mode;
|
||||
u8 rgb2yuv_mode;
|
||||
|
||||
u8 global_alpha_value;
|
||||
|
||||
u8 rgb2yuv_clip_en;
|
||||
u8 yuv2rgb_clip_en;
|
||||
};
|
||||
|
||||
typedef struct iep_session {
|
||||
/* a linked list of data so we can access them for debugging */
|
||||
struct list_head list_session;
|
||||
/* a linked list of register data waiting for process */
|
||||
struct list_head waiting;
|
||||
/* a linked list of register data in ready */
|
||||
struct list_head ready;
|
||||
/* a linked list of register data in processing */
|
||||
struct list_head running;
|
||||
/* all coommand this thread done */
|
||||
atomic_t done;
|
||||
wait_queue_head_t wait;
|
||||
pid_t pid;
|
||||
atomic_t task_running;
|
||||
atomic_t num_done;
|
||||
|
||||
#if defined(CONFIG_IEP_MMU)
|
||||
uint32_t *dte_table;
|
||||
struct list_head pte_list;
|
||||
struct task_struct *tsk;
|
||||
#endif
|
||||
} iep_session;
|
||||
|
||||
typedef struct iep_service_info {
|
||||
struct mutex lock;
|
||||
struct timer_list timer; /* timer for power off */
|
||||
struct list_head waiting; /* link to link_reg in struct iep_reg */
|
||||
atomic_t waitcnt;
|
||||
struct list_head ready; /* link to link_reg in struct iep_reg */
|
||||
struct list_head running; /* link to link_reg in struct iep_reg */
|
||||
struct list_head done; /* link to link_reg in struct iep_reg */
|
||||
struct list_head session; /* link to list_session in struct vpu_session */
|
||||
atomic_t total_running;
|
||||
|
||||
struct iep_reg *reg;
|
||||
bool enable;
|
||||
|
||||
struct mutex mutex; // mutex
|
||||
|
||||
#ifdef CONFIG_IEP_IOMMU
|
||||
struct ion_client *ion_client;
|
||||
struct device *iommu_dev;
|
||||
#endif
|
||||
} iep_service_info;
|
||||
|
||||
struct iep_reg {
|
||||
iep_session *session;
|
||||
struct list_head session_link; /* link to rga service session */
|
||||
struct list_head status_link; /* link to register set list */
|
||||
uint32_t reg[0x300];
|
||||
bool dpi_en;
|
||||
int off_x;
|
||||
int off_y;
|
||||
int act_width;
|
||||
int act_height;
|
||||
int vir_width;
|
||||
int vir_height;
|
||||
int layer;
|
||||
unsigned int format;
|
||||
#if defined(CONFIG_IEP_IOMMU)
|
||||
struct list_head mem_region_list;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(CONFIG_IEP_IOMMU)
|
||||
struct iep_mem_region {
|
||||
struct list_head srv_lnk;
|
||||
struct list_head reg_lnk;
|
||||
struct list_head session_lnk;
|
||||
unsigned long iova; /* virtual address for iommu */
|
||||
unsigned long len;
|
||||
struct ion_handle *hdl;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user