From dea00e3236cbdb74253a50571cf40b692163f229 Mon Sep 17 00:00:00 2001 From: Huang Jiachai Date: Mon, 14 Mar 2016 21:00:49 +0800 Subject: [PATCH] video: rockchip: vop lite: add deal with BGR data format Change-Id: I5cac5cfd6385c5a0aa4152c927053ecd55290031 Signed-off-by: Huang Jiachai --- drivers/video/rockchip/lcdc/rk_vop_lite.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/video/rockchip/lcdc/rk_vop_lite.c b/drivers/video/rockchip/lcdc/rk_vop_lite.c index 5979f464373a..2430ab46d88b 100644 --- a/drivers/video/rockchip/lcdc/rk_vop_lite.c +++ b/drivers/video/rockchip/lcdc/rk_vop_lite.c @@ -376,7 +376,8 @@ static void vop_read_reg_default_cfg(struct vop_device *vop_dev) else if (win0->area[0].format == RGB888) win0->area[0].xvir = win0->area[0].y_vir_stride * 4 / 3; - else if (win0->area[0].format == RGB565) + else if ((win0->area[0].format == RGB565) || + (win0->area[0].format == BGR565)) win0->area[0].xvir = 2 * win0->area[0].y_vir_stride; else @@ -567,10 +568,13 @@ static int vop_axi_gather_cfg(struct vop_device *vop_dev, case ARGB888: case XBGR888: case ABGR888: + case XRGB888: yrgb_gather_num = 3; break; case RGB888: case RGB565: + case BGR888: + case BGR565: yrgb_gather_num = 2; break; case YUV444: @@ -1322,6 +1326,18 @@ static int win_0_1_set_par(struct vop_device *vop_dev, win->area[0].fmt_cfg = VOP_FORMAT_RGB565; win->area[0].swap_rb = 0; break; + case XRGB888: + win->area[0].fmt_cfg = VOP_FORMAT_ARGB888; + win->area[0].swap_rb = 0; + break; + case BGR888: + win->area[0].fmt_cfg = VOP_FORMAT_RGB888; + win->area[0].swap_rb = 1; + break; + case BGR565: + win->area[0].fmt_cfg = VOP_FORMAT_RGB565; + win->area[0].swap_rb = 1; + break; case YUV422: if (win->id == 0) { win->area[0].fmt_cfg = VOP_FORMAT_YCBCR422; -- 2.34.1