Skip to content

Commit d93fa1b

Browse files
committed
Revert "drm/i915/edp: Allow alternate fixed mode for eDP if available."
This reverts commit dc911f5. Per the report, no matter what display mode you select with xrandr, the i915 driver will always select the alternate fixed mode. For the reporter this means that the display will always run at 40Hz which is quite annoying. This may be due to the mode comparison. But there are some other potential issues. The choice of alt_fixed_mode seems dubious. It's the first non-preferred mode, but there are no guarantees that the only difference would be refresh rate. Similarly, there may be more than one preferred mode in the probed modes list, and the commit changes the preferred mode selection to choose the last one on the list instead of the first. (Note that the probed modes list is the raw, unfiltered, unsorted list of modes from drm_add_edid_modes(), not the pretty result after a drm_helper_probe_single_connector_modes() call.) Finally, we already have eerily similar code in place to find the downclock mode for DRRS that seems like could be reused here. Back to the drawing board. Note: This is a hand-crafted revert due to conflicts. If it fails to backport, please just try reverting the original commit directly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105469 Reported-by: Rune Petersen <[email protected]> Reported-by: Mark Spencer <[email protected]> Fixes: dc911f5 ("drm/i915/edp: Allow alternate fixed mode for eDP if available.") Cc: Clint Taylor <[email protected]> Cc: David Weinehall <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Paulo Zanoni <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Jim Bride <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: [email protected] Cc: <[email protected]> # v4.14+ Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Dhinakaran Pandiyan <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a268bcd commit d93fa1b

File tree

6 files changed

+8
-45
lines changed

6 files changed

+8
-45
lines changed

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,23 +1679,6 @@ static int intel_dp_compute_bpp(struct intel_dp *intel_dp,
16791679
return bpp;
16801680
}
16811681

1682-
static bool intel_edp_compare_alt_mode(struct drm_display_mode *m1,
1683-
struct drm_display_mode *m2)
1684-
{
1685-
bool bres = false;
1686-
1687-
if (m1 && m2)
1688-
bres = (m1->hdisplay == m2->hdisplay &&
1689-
m1->hsync_start == m2->hsync_start &&
1690-
m1->hsync_end == m2->hsync_end &&
1691-
m1->htotal == m2->htotal &&
1692-
m1->vdisplay == m2->vdisplay &&
1693-
m1->vsync_start == m2->vsync_start &&
1694-
m1->vsync_end == m2->vsync_end &&
1695-
m1->vtotal == m2->vtotal);
1696-
return bres;
1697-
}
1698-
16991682
/* Adjust link config limits based on compliance test requests. */
17001683
static void
17011684
intel_dp_adjust_compliance_config(struct intel_dp *intel_dp,
@@ -1860,16 +1843,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
18601843
pipe_config->has_audio = intel_conn_state->force_audio == HDMI_AUDIO_ON;
18611844

18621845
if (intel_dp_is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
1863-
struct drm_display_mode *panel_mode =
1864-
intel_connector->panel.alt_fixed_mode;
1865-
struct drm_display_mode *req_mode = &pipe_config->base.mode;
1866-
1867-
if (!intel_edp_compare_alt_mode(req_mode, panel_mode))
1868-
panel_mode = intel_connector->panel.fixed_mode;
1869-
1870-
drm_mode_debug_printmodeline(panel_mode);
1871-
1872-
intel_fixed_panel_mode(panel_mode, adjusted_mode);
1846+
intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
1847+
adjusted_mode);
18731848

18741849
if (INTEL_GEN(dev_priv) >= 9) {
18751850
int ret;
@@ -6137,7 +6112,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
61376112
struct drm_i915_private *dev_priv = to_i915(dev);
61386113
struct drm_connector *connector = &intel_connector->base;
61396114
struct drm_display_mode *fixed_mode = NULL;
6140-
struct drm_display_mode *alt_fixed_mode = NULL;
61416115
struct drm_display_mode *downclock_mode = NULL;
61426116
bool has_dpcd;
61436117
struct drm_display_mode *scan;
@@ -6192,14 +6166,13 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
61926166
}
61936167
intel_connector->edid = edid;
61946168

6195-
/* prefer fixed mode from EDID if available, save an alt mode also */
6169+
/* prefer fixed mode from EDID if available */
61966170
list_for_each_entry(scan, &connector->probed_modes, head) {
61976171
if ((scan->type & DRM_MODE_TYPE_PREFERRED)) {
61986172
fixed_mode = drm_mode_duplicate(dev, scan);
61996173
downclock_mode = intel_dp_drrs_init(
62006174
intel_connector, fixed_mode);
6201-
} else if (!alt_fixed_mode) {
6202-
alt_fixed_mode = drm_mode_duplicate(dev, scan);
6175+
break;
62036176
}
62046177
}
62056178

@@ -6236,8 +6209,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
62366209
pipe_name(pipe));
62376210
}
62386211

6239-
intel_panel_init(&intel_connector->panel, fixed_mode, alt_fixed_mode,
6240-
downclock_mode);
6212+
intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
62416213
intel_connector->panel.backlight.power = intel_edp_backlight_power;
62426214
intel_panel_setup_backlight(connector, pipe);
62436215

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ struct intel_encoder {
276276

277277
struct intel_panel {
278278
struct drm_display_mode *fixed_mode;
279-
struct drm_display_mode *alt_fixed_mode;
280279
struct drm_display_mode *downclock_mode;
281280

282281
/* backlight */
@@ -1855,7 +1854,6 @@ void intel_overlay_reset(struct drm_i915_private *dev_priv);
18551854
/* intel_panel.c */
18561855
int intel_panel_init(struct intel_panel *panel,
18571856
struct drm_display_mode *fixed_mode,
1858-
struct drm_display_mode *alt_fixed_mode,
18591857
struct drm_display_mode *downclock_mode);
18601858
void intel_panel_fini(struct intel_panel *panel);
18611859
void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,

drivers/gpu/drm/i915/intel_dsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
18461846
connector->display_info.width_mm = fixed_mode->width_mm;
18471847
connector->display_info.height_mm = fixed_mode->height_mm;
18481848

1849-
intel_panel_init(&intel_connector->panel, fixed_mode, NULL, NULL);
1849+
intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
18501850
intel_panel_setup_backlight(connector, INVALID_PIPE);
18511851

18521852
intel_dsi_add_properties(intel_connector);

drivers/gpu/drm/i915/intel_dvo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
531531
*/
532532
intel_panel_init(&intel_connector->panel,
533533
intel_dvo_get_current_mode(intel_encoder),
534-
NULL, NULL);
534+
NULL);
535535
intel_dvo->panel_wants_dither = true;
536536
}
537537

drivers/gpu/drm/i915/intel_lvds.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
11771177
out:
11781178
mutex_unlock(&dev->mode_config.mutex);
11791179

1180-
intel_panel_init(&intel_connector->panel, fixed_mode, NULL,
1181-
downclock_mode);
1180+
intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
11821181
intel_panel_setup_backlight(connector, INVALID_PIPE);
11831182

11841183
lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);

drivers/gpu/drm/i915/intel_panel.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,13 +1928,11 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel)
19281928

19291929
int intel_panel_init(struct intel_panel *panel,
19301930
struct drm_display_mode *fixed_mode,
1931-
struct drm_display_mode *alt_fixed_mode,
19321931
struct drm_display_mode *downclock_mode)
19331932
{
19341933
intel_panel_init_backlight_funcs(panel);
19351934

19361935
panel->fixed_mode = fixed_mode;
1937-
panel->alt_fixed_mode = alt_fixed_mode;
19381936
panel->downclock_mode = downclock_mode;
19391937

19401938
return 0;
@@ -1948,10 +1946,6 @@ void intel_panel_fini(struct intel_panel *panel)
19481946
if (panel->fixed_mode)
19491947
drm_mode_destroy(intel_connector->base.dev, panel->fixed_mode);
19501948

1951-
if (panel->alt_fixed_mode)
1952-
drm_mode_destroy(intel_connector->base.dev,
1953-
panel->alt_fixed_mode);
1954-
19551949
if (panel->downclock_mode)
19561950
drm_mode_destroy(intel_connector->base.dev,
19571951
panel->downclock_mode);

0 commit comments

Comments
 (0)