video: rockchip: rga3: add check_csc
Change-Id: I178d07038e233b9cf8943f57660e61bf7e64bcd2 Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
This commit is contained in:
@@ -139,6 +139,7 @@ enum {
|
||||
RGA_YUV_VDS = 0x1 << 10,
|
||||
RGA_OSD = 0x1 << 11,
|
||||
RGA_PRE_INTR = 0x1 << 12,
|
||||
RGA_FULL_CSC = 0x1 << 13,
|
||||
};
|
||||
|
||||
enum rga_surf_format {
|
||||
|
||||
@@ -292,9 +292,8 @@ const struct rga_hw_data rga2e_data = {
|
||||
|
||||
.feature = RGA_COLOR_FILL | RGA_COLOR_PALETTE |
|
||||
RGA_COLOR_KEY | RGA_ROP_CALCULATE |
|
||||
RGA_NN_QUANTIZE | RGA_DITHER,
|
||||
.csc_r2y_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F |
|
||||
RGA_MODE_CSC_BT709,
|
||||
RGA_NN_QUANTIZE | RGA_DITHER | RGA_FULL_CSC,
|
||||
.csc_r2y_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F,
|
||||
.csc_y2r_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F |
|
||||
RGA_MODE_CSC_BT709,
|
||||
.mmu = RGA_MMU,
|
||||
@@ -318,7 +317,7 @@ const struct rga_hw_data rga2e_1106_data = {
|
||||
RGA_COLOR_KEY | RGA_ROP_CALCULATE |
|
||||
RGA_NN_QUANTIZE | RGA_DITHER | RGA_MOSAIC |
|
||||
RGA_YIN_YOUT | RGA_YUV_HDS | RGA_YUV_VDS |
|
||||
RGA_OSD | RGA_PRE_INTR,
|
||||
RGA_OSD | RGA_PRE_INTR | RGA_FULL_CSC,
|
||||
.csc_r2y_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F |
|
||||
RGA_MODE_CSC_BT709,
|
||||
.csc_y2r_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F |
|
||||
@@ -344,7 +343,7 @@ const struct rga_hw_data rga2e_iommu_data = {
|
||||
RGA_COLOR_KEY | RGA_ROP_CALCULATE |
|
||||
RGA_NN_QUANTIZE | RGA_DITHER | RGA_MOSAIC |
|
||||
RGA_YIN_YOUT | RGA_YUV_HDS | RGA_YUV_VDS |
|
||||
RGA_OSD | RGA_PRE_INTR,
|
||||
RGA_OSD | RGA_PRE_INTR | RGA_FULL_CSC,
|
||||
.csc_r2y_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F |
|
||||
RGA_MODE_CSC_BT709,
|
||||
.csc_y2r_mode = RGA_MODE_CSC_BT601L | RGA_MODE_CSC_BT601F |
|
||||
|
||||
@@ -46,6 +46,53 @@ static int rga_set_feature(struct rga_req *rga_base)
|
||||
return feature;
|
||||
}
|
||||
|
||||
static bool rga_check_csc_constant(const struct rga_hw_data *data, struct rga_req *rga_base,
|
||||
uint32_t mode, uint32_t flag)
|
||||
{
|
||||
if (mode & flag)
|
||||
return true;
|
||||
|
||||
if ((rga_base->full_csc.flag & 0x1) && (data->feature & RGA_FULL_CSC))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool rga_check_csc(const struct rga_hw_data *data, struct rga_req *rga_base)
|
||||
{
|
||||
switch (rga_base->yuv2rgb_mode) {
|
||||
case 0x1:
|
||||
return rga_check_csc_constant(data, rga_base,
|
||||
data->csc_y2r_mode, RGA_MODE_CSC_BT601L);
|
||||
case 0x2:
|
||||
return rga_check_csc_constant(data, rga_base,
|
||||
data->csc_y2r_mode, RGA_MODE_CSC_BT601F);
|
||||
case 0x3:
|
||||
return rga_check_csc_constant(data, rga_base,
|
||||
data->csc_y2r_mode, RGA_MODE_CSC_BT709);
|
||||
case 0x1 << 2:
|
||||
return rga_check_csc_constant(data, rga_base,
|
||||
data->csc_r2y_mode, RGA_MODE_CSC_BT601F);
|
||||
case 0x2 << 2:
|
||||
return rga_check_csc_constant(data, rga_base,
|
||||
data->csc_r2y_mode, RGA_MODE_CSC_BT601L);
|
||||
case 0x3 << 2:
|
||||
return rga_check_csc_constant(data, rga_base,
|
||||
data->csc_r2y_mode, RGA_MODE_CSC_BT709);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ((rga_base->full_csc.flag & 0x1)) {
|
||||
if (data->feature & RGA_FULL_CSC)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool rga_check_resolution(const struct rga_rect_range *range, int width, int height)
|
||||
{
|
||||
if (width > range->max.width || height > range->max.height)
|
||||
@@ -324,6 +371,13 @@ int rga_job_assign(struct rga_job *job)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!rga_check_csc(data, rga_base)) {
|
||||
if (DEBUGGER_EN(MSG))
|
||||
pr_info("core = %d, break on rga_check_csc",
|
||||
scheduler->core);
|
||||
continue;
|
||||
}
|
||||
|
||||
optional_cores |= scheduler->core;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user