Skip to content

Commit 70644c1

Browse files
author
Yu Qiaowei
committed
video/rockchip: rga2: Modify the format of YUYV and RGB565.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com> Change-Id: Id1c1e77bddfc909c643f07b0ff0a9fa07059688b
1 parent 41b3e5c commit 70644c1

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

drivers/video/rockchip/rga2/rga2_reg_info.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,17 @@ static void RGA2_set_reg_src_info(RK_U8 *base, struct rga2_req *msg)
243243
case RGA2_FORMAT_BGRX_8888 : src0_format = 0x1; src0_rb_swp = 0x1; pixel_width = 4; msg->src_trans_mode &= 0x07; break;
244244
case RGA2_FORMAT_RGB_888 : src0_format = 0x2; src0_rgb_pack = 1; pixel_width = 3; msg->src_trans_mode &= 0x07; break;
245245
case RGA2_FORMAT_BGR_888 : src0_format = 0x2; src0_rgb_pack = 1; src0_rb_swp = 1; pixel_width = 3; msg->src_trans_mode &= 0x07; break;
246-
case RGA2_FORMAT_RGB_565 : src0_format = 0x4; pixel_width = 2; msg->src_trans_mode &= 0x07; src0_rb_swp = 0x1; break;
246+
case RGA2_FORMAT_RGB_565 : src0_format = 0x4; pixel_width = 2; msg->src_trans_mode &= 0x07; break;
247247
case RGA2_FORMAT_RGBA_5551 : src0_format = 0x5; pixel_width = 2; src0_rb_swp = 0x1; break;
248248
case RGA2_FORMAT_RGBA_4444 : src0_format = 0x6; pixel_width = 2; src0_rb_swp = 0x1; break;
249-
case RGA2_FORMAT_BGR_565 : src0_format = 0x4; pixel_width = 2; msg->src_trans_mode &= 0x07; break;
249+
case RGA2_FORMAT_BGR_565 : src0_format = 0x4; pixel_width = 2; msg->src_trans_mode &= 0x07; src0_rb_swp = 0x1; break;
250250
case RGA2_FORMAT_BGRA_5551 : src0_format = 0x5; pixel_width = 2; break;
251251
case RGA2_FORMAT_BGRA_4444 : src0_format = 0x6; pixel_width = 2; break;
252252

253-
case RGA2_FORMAT_YVYU_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 0; src0_rb_swp = 0x0; break;//rbswap=ycswap
254-
case RGA2_FORMAT_VYUY_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 0; src0_rb_swp = 0x1; break;
255-
case RGA2_FORMAT_YUYV_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 1; src0_rb_swp = 0x0; break;
256-
case RGA2_FORMAT_UYVY_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 1; src0_rb_swp = 0x1; break;
253+
case RGA2_FORMAT_YVYU_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 1; src0_rb_swp = 0x1; break;//rbswap=ycswap
254+
case RGA2_FORMAT_VYUY_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 1; src0_rb_swp = 0x0; break;
255+
case RGA2_FORMAT_YUYV_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 0; src0_rb_swp = 0x1; break;
256+
case RGA2_FORMAT_UYVY_422 : src0_format = 0x7; pixel_width = 2; src0_cbcr_swp = 0; src0_rb_swp = 0x0; break;
257257

258258
case RGA2_FORMAT_YCbCr_422_SP : src0_format = 0x8; xdiv = 1; ydiv = 1; break;
259259
case RGA2_FORMAT_YCbCr_422_P : src0_format = 0x9; xdiv = 2; ydiv = 1; break;
@@ -397,10 +397,10 @@ static void RGA2_set_reg_dst_info(u8 *base, struct rga2_req *msg)
397397
case RGA2_FORMAT_BGRX_8888 : src1_format = 0x1; src1_rb_swp = 0x1; spw = 4; break;
398398
case RGA2_FORMAT_RGB_888 : src1_format = 0x2; src1_rgb_pack = 1; spw = 3; break;
399399
case RGA2_FORMAT_BGR_888 : src1_format = 0x2; src1_rgb_pack = 1; src1_rb_swp = 1; spw = 3; break;
400-
case RGA2_FORMAT_RGB_565 : src1_format = 0x4; spw = 2; src1_rb_swp = 0x1; break;
400+
case RGA2_FORMAT_RGB_565 : src1_format = 0x4; spw = 2; break;
401401
case RGA2_FORMAT_RGBA_5551 : src1_format = 0x5; spw = 2; src1_rb_swp = 0x1; break;
402402
case RGA2_FORMAT_RGBA_4444 : src1_format = 0x6; spw = 2; src1_rb_swp = 0x1; break;
403-
case RGA2_FORMAT_BGR_565 : src1_format = 0x4; spw = 2; break;
403+
case RGA2_FORMAT_BGR_565 : src1_format = 0x4; spw = 2; src1_rb_swp = 0x1; break;
404404
case RGA2_FORMAT_BGRA_5551 : src1_format = 0x5; spw = 2; break;
405405
case RGA2_FORMAT_BGRA_4444 : src1_format = 0x6; spw = 2; break;
406406
default : spw = 4; break;
@@ -419,10 +419,10 @@ static void RGA2_set_reg_dst_info(u8 *base, struct rga2_req *msg)
419419
case RGA2_FORMAT_BGRX_8888 : dst_format = 0x1; dst_rb_swp = 0x1; dpw = 4; break;
420420
case RGA2_FORMAT_RGB_888 : dst_format = 0x2; dst_rgb_pack = 1; dpw = 3; break;
421421
case RGA2_FORMAT_BGR_888 : dst_format = 0x2; dst_rgb_pack = 1; dst_rb_swp = 1; dpw = 3; break;
422-
case RGA2_FORMAT_RGB_565 : dst_format = 0x4; dpw = 2; dst_rb_swp = 0x1; break;
422+
case RGA2_FORMAT_RGB_565 : dst_format = 0x4; dpw = 2; break;
423423
case RGA2_FORMAT_RGBA_5551 : dst_format = 0x5; dpw = 2; dst_rb_swp = 0x1; break;
424424
case RGA2_FORMAT_RGBA_4444 : dst_format = 0x6; dpw = 2; dst_rb_swp = 0x1; break;
425-
case RGA2_FORMAT_BGR_565 : dst_format = 0x4; dpw = 2; break;
425+
case RGA2_FORMAT_BGR_565 : dst_format = 0x4; dpw = 2; dst_rb_swp = 0x1; break;
426426
case RGA2_FORMAT_BGRA_5551 : dst_format = 0x5; dpw = 2; break;
427427
case RGA2_FORMAT_BGRA_4444 : dst_format = 0x6; dpw = 2; break;
428428

@@ -438,14 +438,14 @@ static void RGA2_set_reg_dst_info(u8 *base, struct rga2_req *msg)
438438
case RGA2_FORMAT_YCbCr_400 : dst_format = 0x8; dst_fmt_yuv400_en = 1; x_div = 1; y_div = 1; break;
439439
case RGA2_FORMAT_Y4 : dst_format = 0x8; dst_fmt_y4_en = 1; dst_fmt_yuv400_en = 1; x_div = 1; y_div = 1; break;
440440

441-
case RGA2_FORMAT_YUYV_422 : dst_format = 0xc; dpw = 2; break;
442-
case RGA2_FORMAT_YVYU_422 : dst_format = 0xc; dpw = 2; dst_cbcr_swp = 1; break;
443-
case RGA2_FORMAT_YUYV_420 : dst_format = 0xd; dpw = 2; break;
444-
case RGA2_FORMAT_YVYU_420 : dst_format = 0xd; dpw = 2; dst_cbcr_swp = 1; break;
445-
case RGA2_FORMAT_UYVY_422 : dst_format = 0xe; dpw = 2; break;
446-
case RGA2_FORMAT_VYUY_422 : dst_format = 0xe; dpw = 2; dst_cbcr_swp = 1; break;
447-
case RGA2_FORMAT_UYVY_420 : dst_format = 0xf; dpw = 2; break;
448-
case RGA2_FORMAT_VYUY_420 : dst_format = 0xf; dpw = 2; dst_cbcr_swp = 1; break;
441+
case RGA2_FORMAT_YUYV_422 : dst_format = 0xe; dpw = 2; dst_cbcr_swp = 1; break;
442+
case RGA2_FORMAT_YVYU_422 : dst_format = 0xe; dpw = 2; break;
443+
case RGA2_FORMAT_YUYV_420 : dst_format = 0xf; dpw = 2; dst_cbcr_swp = 1; break;
444+
case RGA2_FORMAT_YVYU_420 : dst_format = 0xf; dpw = 2; break;
445+
case RGA2_FORMAT_UYVY_422 : dst_format = 0xc; dpw = 2; dst_cbcr_swp = 1; break;
446+
case RGA2_FORMAT_VYUY_422 : dst_format = 0xc; dpw = 2; break;
447+
case RGA2_FORMAT_UYVY_420 : dst_format = 0xd; dpw = 2; dst_cbcr_swp = 1; break;
448+
case RGA2_FORMAT_VYUY_420 : dst_format = 0xd; dpw = 2; break;
449449
};
450450

451451
reg = ((reg & (~m_RGA2_DST_INFO_SW_DST_FMT)) | (s_RGA2_DST_INFO_SW_DST_FMT(dst_format)));

0 commit comments

Comments
 (0)