From ff148eedd4c9194ebffe9e26d405a75120dd2d74 Mon Sep 17 00:00:00 2001 From: Yu Qiaowei Date: Mon, 26 May 2025 15:45:28 +0800 Subject: [PATCH] video: rockchip: rga3: RGA2 scale mode add default config When the task is not submitted from the librga im2d API, the scale mode may be default, so additional default configuration is required. Change-Id: Ie5966308ad1af09a6a7eec489126670dc1085dac Signed-off-by: Yu Qiaowei --- drivers/video/rockchip/rga3/rga2_reg_info.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/video/rockchip/rga3/rga2_reg_info.c b/drivers/video/rockchip/rga3/rga2_reg_info.c index 886d4f33961e..8e3d18f4dad1 100644 --- a/drivers/video/rockchip/rga3/rga2_reg_info.c +++ b/drivers/video/rockchip/rga3/rga2_reg_info.c @@ -439,11 +439,20 @@ static void RGA2_set_reg_src_info(u8 *base, struct rga2_req *msg) case RGA_INTERP_LINEAR: vsp_scale_mode = 1; break; + case RGA_INTERP_DEFAULT: + if (((scale_w_flag == RGA2_SCALE_DOWN) && (dw < RGA2_VSP_BICUBIC_LIMIT)) || + (sw < RGA2_VSP_BICUBIC_LIMIT)) { + vsp_scale_mode = 0x0; + } else { + vsp_scale_mode = 0x1; + } + break; } } else if (scale_h_flag == RGA2_SCALE_DOWN) { switch (msg->interp.verti) { case RGA_INTERP_AVERAGE: + case RGA_INTERP_DEFAULT: vsd_scale_mode = 0; break; case RGA_INTERP_LINEAR: @@ -456,6 +465,7 @@ static void RGA2_set_reg_src_info(u8 *base, struct rga2_req *msg) if (scale_w_flag == RGA2_SCALE_UP) { switch (msg->interp.horiz) { case RGA_INTERP_BICUBIC: + case RGA_INTERP_DEFAULT: hsp_scale_mode = 0; break; case RGA_INTERP_LINEAR: @@ -465,6 +475,7 @@ static void RGA2_set_reg_src_info(u8 *base, struct rga2_req *msg) } else if (scale_w_flag == RGA2_SCALE_DOWN) { switch (msg->interp.horiz) { case RGA_INTERP_AVERAGE: + case RGA_INTERP_DEFAULT: hsd_scale_mode = 0; break; case RGA_INTERP_LINEAR: