Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos/hdmi: remove redundant mode field

Display mode is preserved in CRTC state, there is no need to keep local
copy of it. Moreover since HDMI should configure registers according to
requested mode, use it instead of adjusted_mode, which should contain
mode produced by CRTC - functionally it does not change anything, but
subsequent patches will make the difference.

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>

authored by

Andrzej Hajda and committed by
Inki Dae
991ea04e 524c59f1

+9 -25
+9 -25
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 119 119 bool powered; 120 120 bool dvi_mode; 121 121 struct delayed_work hotplug_work; 122 - struct drm_display_mode current_mode; 123 122 struct cec_notifier *notifier; 124 123 const struct hdmi_driver_data *drv_data; 125 124 ··· 769 770 770 771 static void hdmi_reg_infoframes(struct hdmi_context *hdata) 771 772 { 773 + struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; 772 774 union hdmi_infoframe frm; 773 775 u8 buf[25]; 774 776 int ret; ··· 783 783 return; 784 784 } 785 785 786 - ret = drm_hdmi_avi_infoframe_from_display_mode(&frm.avi, 787 - &hdata->current_mode, false); 786 + ret = drm_hdmi_avi_infoframe_from_display_mode(&frm.avi, m, false); 788 787 if (!ret) 789 788 ret = hdmi_avi_infoframe_pack(&frm.avi, buf, sizeof(buf)); 790 789 if (ret > 0) { ··· 793 794 DRM_INFO("%s: invalid AVI infoframe (%d)\n", __func__, ret); 794 795 } 795 796 796 - ret = drm_hdmi_vendor_infoframe_from_display_mode(&frm.vendor.hdmi, 797 - &hdata->current_mode); 797 + ret = drm_hdmi_vendor_infoframe_from_display_mode(&frm.vendor.hdmi, m); 798 798 if (!ret) 799 799 ret = hdmi_vendor_infoframe_pack(&frm.vendor.hdmi, buf, 800 800 sizeof(buf)); ··· 1094 1096 1095 1097 static void hdmi_start(struct hdmi_context *hdata, bool start) 1096 1098 { 1099 + struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; 1097 1100 u32 val = start ? HDMI_TG_EN : 0; 1098 1101 1099 - if (hdata->current_mode.flags & DRM_MODE_FLAG_INTERLACE) 1102 + if (m->flags & DRM_MODE_FLAG_INTERLACE) 1100 1103 val |= HDMI_FIELD_EN; 1101 1104 1102 1105 hdmi_reg_writemask(hdata, HDMI_CON_0, val, HDMI_EN); ··· 1167 1168 1168 1169 static void hdmi_v13_mode_apply(struct hdmi_context *hdata) 1169 1170 { 1170 - struct drm_display_mode *m = &hdata->current_mode; 1171 + struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; 1171 1172 unsigned int val; 1172 1173 1173 1174 hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay); ··· 1246 1247 1247 1248 static void hdmi_v14_mode_apply(struct hdmi_context *hdata) 1248 1249 { 1249 - struct drm_display_mode *m = &hdata->current_mode; 1250 + struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; 1250 1251 1251 1252 hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay); 1252 1253 hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal); ··· 1379 1380 1380 1381 static void hdmiphy_conf_apply(struct hdmi_context *hdata) 1381 1382 { 1383 + struct drm_display_mode *m = &hdata->encoder.crtc->state->mode; 1382 1384 int ret; 1383 1385 const u8 *phy_conf; 1384 1386 1385 - ret = hdmi_find_phy_conf(hdata, hdata->current_mode.clock * 1000); 1387 + ret = hdmi_find_phy_conf(hdata, m->clock * 1000); 1386 1388 if (ret < 0) { 1387 1389 DRM_ERROR("failed to find hdmiphy conf\n"); 1388 1390 return; ··· 1413 1413 hdmi_audio_init(hdata); 1414 1414 hdmi_mode_apply(hdata); 1415 1415 hdmi_audio_control(hdata, true); 1416 - } 1417 - 1418 - static void hdmi_mode_set(struct drm_encoder *encoder, 1419 - struct drm_display_mode *mode, 1420 - struct drm_display_mode *adjusted_mode) 1421 - { 1422 - struct hdmi_context *hdata = encoder_to_hdmi(encoder); 1423 - struct drm_display_mode *m = adjusted_mode; 1424 - 1425 - DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n", 1426 - m->hdisplay, m->vdisplay, 1427 - m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ? 1428 - "INTERLACED" : "PROGRESSIVE"); 1429 - 1430 - drm_mode_copy(&hdata->current_mode, m); 1431 1416 } 1432 1417 1433 1418 static void hdmi_set_refclk(struct hdmi_context *hdata, bool on) ··· 1497 1512 1498 1513 static const struct drm_encoder_helper_funcs exynos_hdmi_encoder_helper_funcs = { 1499 1514 .mode_fixup = hdmi_mode_fixup, 1500 - .mode_set = hdmi_mode_set, 1501 1515 .enable = hdmi_enable, 1502 1516 .disable = hdmi_disable, 1503 1517 };