drm/rockchip: hdmi: Limit rk3229/rk3328 max output resolution

Limit RK3229/RK3328 max output resolution to 4K 50/60 YCbCr420 mode.

Change-Id: Icb934f6f057503ccb619f4ca6167b0958def336a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
Zheng Yang 2017-07-11 17:53:32 +08:00 committed by Huang, Tao
parent e7a7270135
commit 96471cefb8
2 changed files with 19 additions and 0 deletions

View File

@ -2019,6 +2019,13 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
hdmi->hdmi_data.video_mode.mpixelrepetitioninput = 0;
}
if ((hdmi->dev_type == RK3328_HDMI ||
hdmi->dev_type == RK3228_HDMI) &&
drm_match_cea_mode(mode) > 94 &&
mode->crtc_clock > 340000 &&
!(mode->flags & DRM_MODE_FLAG_420_MASK))
mode->flags |= DRM_MODE_FLAG_420;
if (mode->flags & DRM_MODE_FLAG_420_MASK) {
hdmi->hdmi_data.enc_in_bus_format =
MEDIA_BUS_FMT_UYYVYY8_0_5X24;

View File

@ -493,6 +493,18 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_connector_state *conn_state)
{
struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder);
if (hdmi->phy) {
if (drm_match_cea_mode(&crtc_state->mode) > 94 &&
crtc_state->mode.crtc_clock > 340000 &&
!(crtc_state->mode.flags & DRM_MODE_FLAG_420_MASK)) {
crtc_state->mode.flags |= DRM_MODE_FLAG_420;
phy_set_bus_width(hdmi->phy, 4);
} else {
phy_set_bus_width(hdmi->phy, 8);
}
}
if (crtc_state->mode.flags & DRM_MODE_FLAG_420_MASK) {
s->output_mode = ROCKCHIP_OUT_MODE_YUV420;