diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2017-09-29 06:05:40 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2017-10-25 20:06:33 -0400 |
commit | 36fd887acbd1ce349eba8283d9e8a9d7932a24ca (patch) | |
tree | 7be233ed99d03cdff27ff6763d1a1cd5a0999ca5 | |
parent | acc8bf040c39499139e6d26e72c642d42ffa5016 (diff) |
drm/exynos/hdmi: quirk for support mode timings conversion
MIXER in SoCs prior to Exynos5420 supports only 4 video modes:
720x480, 720x576, 1280x720, 1920x1080. Support for other modes
can be enabled by manipulating timings of HDMI. To do it
adjusted_mode should contain actual mode set on crtc.
With this patch it is possible to enable 1024x768 and 1280x1024
modes in MIXER.
Suggested-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 0d37d6928623..218914339cac 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -1247,6 +1247,18 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata) | |||
1247 | static void hdmi_v14_mode_apply(struct hdmi_context *hdata) | 1247 | static void hdmi_v14_mode_apply(struct hdmi_context *hdata) |
1248 | { | 1248 | { |
1249 | struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; | 1249 | struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; |
1250 | struct drm_display_mode *am = | ||
1251 | &hdata->encoder.crtc->state->adjusted_mode; | ||
1252 | int hquirk = 0; | ||
1253 | |||
1254 | /* | ||
1255 | * In case video mode coming from CRTC differs from requested one HDMI | ||
1256 | * sometimes is able to almost properly perform conversion - only | ||
1257 | * first line is distorted. | ||
1258 | */ | ||
1259 | if ((m->vdisplay != am->vdisplay) && | ||
1260 | (m->hdisplay == 1280 || m->hdisplay == 1024)) | ||
1261 | hquirk = 258; | ||
1250 | 1262 | ||
1251 | hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay); | 1263 | hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay); |
1252 | hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal); | 1264 | hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal); |
@@ -1340,8 +1352,9 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata) | |||
1340 | hdmi_reg_writev(hdata, HDMI_V_SYNC_LINE_AFT_PXL_6_0, 2, 0xffff); | 1352 | hdmi_reg_writev(hdata, HDMI_V_SYNC_LINE_AFT_PXL_6_0, 2, 0xffff); |
1341 | 1353 | ||
1342 | hdmi_reg_writev(hdata, HDMI_TG_H_FSZ_L, 2, m->htotal); | 1354 | hdmi_reg_writev(hdata, HDMI_TG_H_FSZ_L, 2, m->htotal); |
1343 | hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay); | 1355 | hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, |
1344 | hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay); | 1356 | m->htotal - m->hdisplay - hquirk); |
1357 | hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay + hquirk); | ||
1345 | hdmi_reg_writev(hdata, HDMI_TG_V_FSZ_L, 2, m->vtotal); | 1358 | hdmi_reg_writev(hdata, HDMI_TG_V_FSZ_L, 2, m->vtotal); |
1346 | if (hdata->drv_data == &exynos5433_hdmi_driver_data) | 1359 | if (hdata->drv_data == &exynos5433_hdmi_driver_data) |
1347 | hdmi_reg_writeb(hdata, HDMI_TG_DECON_EN, 1); | 1360 | hdmi_reg_writeb(hdata, HDMI_TG_DECON_EN, 1); |