drm/rockchip: dw_hdmi: support ROCKCHIP_OUT_MODE_YUV420
authorZheng Yang <zhengyang@rock-chips.com>
Wed, 1 Mar 2017 08:05:37 +0000 (16:05 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 7 Mar 2017 10:42:40 +0000 (18:42 +0800)
VOP output mode and bus_format must be ROCKCHIP_OUT_MODE_YUV420
and MEDIA_BUS_FMT_YUV8_1X24 when display mode has a YCbCr420
flag.

Change-Id: Ib2d51c119f5a8f1b8a9285c47ab228b22a293d56
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

index a1417f8379a68c61094362fb68ce9dda3e1a40f8..5b25a8f53ba5ba00af08cf4178c83be396996cf9 100644 (file)
@@ -329,9 +329,14 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
 {
        struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
 
-       s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
+       if (crtc_state->mode.flags & DRM_MODE_FLAG_420_MASK) {
+               s->output_mode = ROCKCHIP_OUT_MODE_YUV420;
+               s->bus_format = MEDIA_BUS_FMT_YUV8_1X24;
+       } else {
+               s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
+               s->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+       }
        s->output_type = DRM_MODE_CONNECTOR_HDMIA;
-       s->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
        return 0;
 }