diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp_mst.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dsi.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dvo.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 12 |
10 files changed, 84 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 211d601cd1b1..95aa29cf2d9c 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -304,6 +304,9 @@ intel_crt_mode_valid(struct drm_connector *connector, | |||
304 | int max_dotclk = dev_priv->max_dotclk_freq; | 304 | int max_dotclk = dev_priv->max_dotclk_freq; |
305 | int max_clock; | 305 | int max_clock; |
306 | 306 | ||
307 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
308 | return MODE_NO_DBLESCAN; | ||
309 | |||
307 | if (mode->clock < 25000) | 310 | if (mode->clock < 25000) |
308 | return MODE_CLOCK_LOW; | 311 | return MODE_CLOCK_LOW; |
309 | 312 | ||
@@ -337,6 +340,12 @@ static bool intel_crt_compute_config(struct intel_encoder *encoder, | |||
337 | struct intel_crtc_state *pipe_config, | 340 | struct intel_crtc_state *pipe_config, |
338 | struct drm_connector_state *conn_state) | 341 | struct drm_connector_state *conn_state) |
339 | { | 342 | { |
343 | struct drm_display_mode *adjusted_mode = | ||
344 | &pipe_config->base.adjusted_mode; | ||
345 | |||
346 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
347 | return false; | ||
348 | |||
340 | return true; | 349 | return true; |
341 | } | 350 | } |
342 | 351 | ||
@@ -344,6 +353,12 @@ static bool pch_crt_compute_config(struct intel_encoder *encoder, | |||
344 | struct intel_crtc_state *pipe_config, | 353 | struct intel_crtc_state *pipe_config, |
345 | struct drm_connector_state *conn_state) | 354 | struct drm_connector_state *conn_state) |
346 | { | 355 | { |
356 | struct drm_display_mode *adjusted_mode = | ||
357 | &pipe_config->base.adjusted_mode; | ||
358 | |||
359 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
360 | return false; | ||
361 | |||
347 | pipe_config->has_pch_encoder = true; | 362 | pipe_config->has_pch_encoder = true; |
348 | 363 | ||
349 | return true; | 364 | return true; |
@@ -354,6 +369,11 @@ static bool hsw_crt_compute_config(struct intel_encoder *encoder, | |||
354 | struct drm_connector_state *conn_state) | 369 | struct drm_connector_state *conn_state) |
355 | { | 370 | { |
356 | struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); | 371 | struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); |
372 | struct drm_display_mode *adjusted_mode = | ||
373 | &pipe_config->base.adjusted_mode; | ||
374 | |||
375 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
376 | return false; | ||
357 | 377 | ||
358 | pipe_config->has_pch_encoder = true; | 378 | pipe_config->has_pch_encoder = true; |
359 | 379 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 17c590b42fd7..3323470596ca 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -14529,12 +14529,22 @@ static enum drm_mode_status | |||
14529 | intel_mode_valid(struct drm_device *dev, | 14529 | intel_mode_valid(struct drm_device *dev, |
14530 | const struct drm_display_mode *mode) | 14530 | const struct drm_display_mode *mode) |
14531 | { | 14531 | { |
14532 | /* | ||
14533 | * Can't reject DBLSCAN here because Xorg ddxen can add piles | ||
14534 | * of DBLSCAN modes to the output's mode list when they detect | ||
14535 | * the scaling mode property on the connector. And they don't | ||
14536 | * ask the kernel to validate those modes in any way until | ||
14537 | * modeset time at which point the client gets a protocol error. | ||
14538 | * So in order to not upset those clients we silently ignore the | ||
14539 | * DBLSCAN flag on such connectors. For other connectors we will | ||
14540 | * reject modes with the DBLSCAN flag in encoder->compute_config(). | ||
14541 | * And we always reject DBLSCAN modes in connector->mode_valid() | ||
14542 | * as we never want such modes on the connector's mode list. | ||
14543 | */ | ||
14544 | |||
14532 | if (mode->vscan > 1) | 14545 | if (mode->vscan > 1) |
14533 | return MODE_NO_VSCAN; | 14546 | return MODE_NO_VSCAN; |
14534 | 14547 | ||
14535 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
14536 | return MODE_NO_DBLESCAN; | ||
14537 | |||
14538 | if (mode->flags & DRM_MODE_FLAG_HSKEW) | 14548 | if (mode->flags & DRM_MODE_FLAG_HSKEW) |
14539 | return MODE_H_ILLEGAL; | 14549 | return MODE_H_ILLEGAL; |
14540 | 14550 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 40ffd9163175..a58bac01aeea 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -420,6 +420,9 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
420 | int max_rate, mode_rate, max_lanes, max_link_clock; | 420 | int max_rate, mode_rate, max_lanes, max_link_clock; |
421 | int max_dotclk; | 421 | int max_dotclk; |
422 | 422 | ||
423 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
424 | return MODE_NO_DBLESCAN; | ||
425 | |||
423 | max_dotclk = intel_dp_downstream_max_dotclock(intel_dp); | 426 | max_dotclk = intel_dp_downstream_max_dotclock(intel_dp); |
424 | 427 | ||
425 | if (intel_dp_is_edp(intel_dp) && fixed_mode) { | 428 | if (intel_dp_is_edp(intel_dp) && fixed_mode) { |
@@ -1869,6 +1872,9 @@ intel_dp_compute_config(struct intel_encoder *encoder, | |||
1869 | conn_state->scaling_mode); | 1872 | conn_state->scaling_mode); |
1870 | } | 1873 | } |
1871 | 1874 | ||
1875 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
1876 | return false; | ||
1877 | |||
1872 | if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) && | 1878 | if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) && |
1873 | adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) | 1879 | adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) |
1874 | return false; | 1880 | return false; |
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 9e6956c08688..5890500a3a8b 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c | |||
@@ -48,6 +48,9 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, | |||
48 | bool reduce_m_n = drm_dp_has_quirk(&intel_dp->desc, | 48 | bool reduce_m_n = drm_dp_has_quirk(&intel_dp->desc, |
49 | DP_DPCD_QUIRK_LIMITED_M_N); | 49 | DP_DPCD_QUIRK_LIMITED_M_N); |
50 | 50 | ||
51 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
52 | return false; | ||
53 | |||
51 | pipe_config->has_pch_encoder = false; | 54 | pipe_config->has_pch_encoder = false; |
52 | bpp = 24; | 55 | bpp = 24; |
53 | if (intel_dp->compliance.test_data.bpc) { | 56 | if (intel_dp->compliance.test_data.bpc) { |
@@ -366,6 +369,9 @@ intel_dp_mst_mode_valid(struct drm_connector *connector, | |||
366 | if (!intel_dp) | 369 | if (!intel_dp) |
367 | return MODE_ERROR; | 370 | return MODE_ERROR; |
368 | 371 | ||
372 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
373 | return MODE_NO_DBLESCAN; | ||
374 | |||
369 | max_link_clock = intel_dp_max_link_rate(intel_dp); | 375 | max_link_clock = intel_dp_max_link_rate(intel_dp); |
370 | max_lanes = intel_dp_max_lane_count(intel_dp); | 376 | max_lanes = intel_dp_max_lane_count(intel_dp); |
371 | 377 | ||
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index cf1231f9c33b..3b7acb5a70b3 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c | |||
@@ -326,6 +326,9 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder, | |||
326 | conn_state->scaling_mode); | 326 | conn_state->scaling_mode); |
327 | } | 327 | } |
328 | 328 | ||
329 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
330 | return false; | ||
331 | |||
329 | /* DSI uses short packets for sync events, so clear mode flags for DSI */ | 332 | /* DSI uses short packets for sync events, so clear mode flags for DSI */ |
330 | adjusted_mode->flags = 0; | 333 | adjusted_mode->flags = 0; |
331 | 334 | ||
@@ -1266,6 +1269,9 @@ intel_dsi_mode_valid(struct drm_connector *connector, | |||
1266 | 1269 | ||
1267 | DRM_DEBUG_KMS("\n"); | 1270 | DRM_DEBUG_KMS("\n"); |
1268 | 1271 | ||
1272 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
1273 | return MODE_NO_DBLESCAN; | ||
1274 | |||
1269 | if (fixed_mode) { | 1275 | if (fixed_mode) { |
1270 | if (mode->hdisplay > fixed_mode->hdisplay) | 1276 | if (mode->hdisplay > fixed_mode->hdisplay) |
1271 | return MODE_PANEL; | 1277 | return MODE_PANEL; |
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c index 7b942b6c1700..27f16db8953a 100644 --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c | |||
@@ -215,6 +215,9 @@ intel_dvo_mode_valid(struct drm_connector *connector, | |||
215 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; | 215 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; |
216 | int target_clock = mode->clock; | 216 | int target_clock = mode->clock; |
217 | 217 | ||
218 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
219 | return MODE_NO_DBLESCAN; | ||
220 | |||
218 | /* XXX: Validate clock range */ | 221 | /* XXX: Validate clock range */ |
219 | 222 | ||
220 | if (fixed_mode) { | 223 | if (fixed_mode) { |
@@ -250,6 +253,9 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder, | |||
250 | if (fixed_mode) | 253 | if (fixed_mode) |
251 | intel_fixed_panel_mode(fixed_mode, adjusted_mode); | 254 | intel_fixed_panel_mode(fixed_mode, adjusted_mode); |
252 | 255 | ||
256 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
257 | return false; | ||
258 | |||
253 | return true; | 259 | return true; |
254 | } | 260 | } |
255 | 261 | ||
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index ef4de5a02cb5..447ffe590e55 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -1540,6 +1540,9 @@ intel_hdmi_mode_valid(struct drm_connector *connector, | |||
1540 | bool force_dvi = | 1540 | bool force_dvi = |
1541 | READ_ONCE(to_intel_digital_connector_state(connector->state)->force_audio) == HDMI_AUDIO_OFF_DVI; | 1541 | READ_ONCE(to_intel_digital_connector_state(connector->state)->force_audio) == HDMI_AUDIO_OFF_DVI; |
1542 | 1542 | ||
1543 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
1544 | return MODE_NO_DBLESCAN; | ||
1545 | |||
1543 | clock = mode->clock; | 1546 | clock = mode->clock; |
1544 | 1547 | ||
1545 | if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING) | 1548 | if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING) |
@@ -1660,6 +1663,9 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, | |||
1660 | int desired_bpp; | 1663 | int desired_bpp; |
1661 | bool force_dvi = intel_conn_state->force_audio == HDMI_AUDIO_OFF_DVI; | 1664 | bool force_dvi = intel_conn_state->force_audio == HDMI_AUDIO_OFF_DVI; |
1662 | 1665 | ||
1666 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
1667 | return false; | ||
1668 | |||
1663 | pipe_config->has_hdmi_sink = !force_dvi && intel_hdmi->has_hdmi_sink; | 1669 | pipe_config->has_hdmi_sink = !force_dvi && intel_hdmi->has_hdmi_sink; |
1664 | 1670 | ||
1665 | if (pipe_config->has_hdmi_sink) | 1671 | if (pipe_config->has_hdmi_sink) |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index e05c12e7629c..bb06744d28a4 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -378,6 +378,8 @@ intel_lvds_mode_valid(struct drm_connector *connector, | |||
378 | struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; | 378 | struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode; |
379 | int max_pixclk = to_i915(connector->dev)->max_dotclk_freq; | 379 | int max_pixclk = to_i915(connector->dev)->max_dotclk_freq; |
380 | 380 | ||
381 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
382 | return MODE_NO_DBLESCAN; | ||
381 | if (mode->hdisplay > fixed_mode->hdisplay) | 383 | if (mode->hdisplay > fixed_mode->hdisplay) |
382 | return MODE_PANEL; | 384 | return MODE_PANEL; |
383 | if (mode->vdisplay > fixed_mode->vdisplay) | 385 | if (mode->vdisplay > fixed_mode->vdisplay) |
@@ -427,6 +429,9 @@ static bool intel_lvds_compute_config(struct intel_encoder *intel_encoder, | |||
427 | intel_fixed_panel_mode(intel_connector->panel.fixed_mode, | 429 | intel_fixed_panel_mode(intel_connector->panel.fixed_mode, |
428 | adjusted_mode); | 430 | adjusted_mode); |
429 | 431 | ||
432 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
433 | return false; | ||
434 | |||
430 | if (HAS_PCH_SPLIT(dev_priv)) { | 435 | if (HAS_PCH_SPLIT(dev_priv)) { |
431 | pipe_config->has_pch_encoder = true; | 436 | pipe_config->has_pch_encoder = true; |
432 | 437 | ||
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 848b03a542d6..9d9229a1f36c 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1160,6 +1160,9 @@ static bool intel_sdvo_compute_config(struct intel_encoder *encoder, | |||
1160 | adjusted_mode); | 1160 | adjusted_mode); |
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
1164 | return false; | ||
1165 | |||
1163 | /* | 1166 | /* |
1164 | * Make the CRTC code factor in the SDVO pixel multiplier. The | 1167 | * Make the CRTC code factor in the SDVO pixel multiplier. The |
1165 | * SDVO device will factor out the multiplier during mode_set. | 1168 | * SDVO device will factor out the multiplier during mode_set. |
@@ -1631,6 +1634,9 @@ intel_sdvo_mode_valid(struct drm_connector *connector, | |||
1631 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); | 1634 | struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); |
1632 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; | 1635 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; |
1633 | 1636 | ||
1637 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
1638 | return MODE_NO_DBLESCAN; | ||
1639 | |||
1634 | if (intel_sdvo->pixel_clock_min > mode->clock) | 1640 | if (intel_sdvo->pixel_clock_min > mode->clock) |
1635 | return MODE_CLOCK_LOW; | 1641 | return MODE_CLOCK_LOW; |
1636 | 1642 | ||
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 99bc2368dda0..24dc368fdaa1 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
@@ -846,6 +846,9 @@ intel_tv_mode_valid(struct drm_connector *connector, | |||
846 | const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); | 846 | const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); |
847 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; | 847 | int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; |
848 | 848 | ||
849 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) | ||
850 | return MODE_NO_DBLESCAN; | ||
851 | |||
849 | if (mode->clock > max_dotclk) | 852 | if (mode->clock > max_dotclk) |
850 | return MODE_CLOCK_HIGH; | 853 | return MODE_CLOCK_HIGH; |
851 | 854 | ||
@@ -873,16 +876,21 @@ intel_tv_compute_config(struct intel_encoder *encoder, | |||
873 | struct drm_connector_state *conn_state) | 876 | struct drm_connector_state *conn_state) |
874 | { | 877 | { |
875 | const struct tv_mode *tv_mode = intel_tv_mode_find(conn_state); | 878 | const struct tv_mode *tv_mode = intel_tv_mode_find(conn_state); |
879 | struct drm_display_mode *adjusted_mode = | ||
880 | &pipe_config->base.adjusted_mode; | ||
876 | 881 | ||
877 | if (!tv_mode) | 882 | if (!tv_mode) |
878 | return false; | 883 | return false; |
879 | 884 | ||
880 | pipe_config->base.adjusted_mode.crtc_clock = tv_mode->clock; | 885 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) |
886 | return false; | ||
887 | |||
888 | adjusted_mode->crtc_clock = tv_mode->clock; | ||
881 | DRM_DEBUG_KMS("forcing bpc to 8 for TV\n"); | 889 | DRM_DEBUG_KMS("forcing bpc to 8 for TV\n"); |
882 | pipe_config->pipe_bpp = 8*3; | 890 | pipe_config->pipe_bpp = 8*3; |
883 | 891 | ||
884 | /* TV has it's own notion of sync and other mode flags, so clear them. */ | 892 | /* TV has it's own notion of sync and other mode flags, so clear them. */ |
885 | pipe_config->base.adjusted_mode.flags = 0; | 893 | adjusted_mode->flags = 0; |
886 | 894 | ||
887 | /* | 895 | /* |
888 | * FIXME: We don't check whether the input mode is actually what we want | 896 | * FIXME: We don't check whether the input mode is actually what we want |