From 27e143efd71ebaa672e1460fa458f91b858fc86e Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Wed, 1 Mar 2017 16:05:37 +0800 Subject: [PATCH] drm/rockchip: dw_hdmi: support ROCKCHIP_OUT_MODE_YUV420 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 --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index a1417f8379a6..5b25a8f53ba5 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -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; } -- 2.34.1