drm/rockchip: vop: fix rb swap error when deal with rgb888 format

1. VOP full need to do rb swap to show rgb888 format color correctly
2. uboot change bmp decoder result from BGR565 to RGB565 format;

so this commit depend on uboot commit:
    59cf3802954 ("drm/rockchip: fix rgb888 format color incorrect")
    f4e3a173323 ("drm/rockchip: change 8bit bmp decoder result")

Change-Id: I2e0329b8c3f35d4ec1e224f0570575934c889dca
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
Sandy Huang
2020-05-15 14:40:00 +08:00
committed by Tao Huang
parent 085c5ba4a7
commit 97407f1db3
2 changed files with 5 additions and 7 deletions

View File

@@ -315,10 +315,10 @@ get_framebuffer_by_node(struct drm_device *drm_dev, struct device_node *node)
switch (bpp) {
case 16:
mode_cmd.pixel_format = DRM_FORMAT_BGR565;
mode_cmd.pixel_format = DRM_FORMAT_RGB565;
break;
case 24:
mode_cmd.pixel_format = DRM_FORMAT_BGR888;
mode_cmd.pixel_format = DRM_FORMAT_RGB888;
break;
case 32:
mode_cmd.pixel_format = DRM_FORMAT_XRGB8888;

View File

@@ -1779,12 +1779,10 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
rb_swap = has_rb_swapped(fb->format->format);
/*
* Px30 treats rgb888 as bgr888
* so we reverse the rb swap to workaround
* VOP full need to do rb swap to show rgb888/bgr888 format color correctly
*/
if ((fb->format->format == DRM_FORMAT_RGB888 ||
fb->format->format == DRM_FORMAT_BGR888) &&
(VOP_MAJOR(vop->version) == 2 && VOP_MINOR(vop->version) == 6))
if ((fb->format->format == DRM_FORMAT_RGB888 || fb->format->format == DRM_FORMAT_BGR888) &&
VOP_MAJOR(vop->version) == 3)
rb_swap = !rb_swap;
VOP_WIN_SET(vop, win, rb_swap, rb_swap);