aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/intel_display.c92
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c1
3 files changed, 10 insertions, 85 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 5dbaf6b24494..a1b2672cfe56 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1161,11 +1161,9 @@ enum intel_sbi_destination {
1161 SBI_MPHY, 1161 SBI_MPHY,
1162}; 1162};
1163 1163
1164#define QUIRK_PIPEA_FORCE (1<<0)
1165#define QUIRK_LVDS_SSC_DISABLE (1<<1) 1164#define QUIRK_LVDS_SSC_DISABLE (1<<1)
1166#define QUIRK_INVERT_BRIGHTNESS (1<<2) 1165#define QUIRK_INVERT_BRIGHTNESS (1<<2)
1167#define QUIRK_BACKLIGHT_PRESENT (1<<3) 1166#define QUIRK_BACKLIGHT_PRESENT (1<<3)
1168#define QUIRK_PIPEB_FORCE (1<<4)
1169#define QUIRK_PIN_SWIZZLED_PAGES (1<<5) 1167#define QUIRK_PIN_SWIZZLED_PAGES (1<<5)
1170 1168
1171struct intel_fbdev; 1169struct intel_fbdev;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c3d9c8e511c6..4836e537c7f8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1193,9 +1193,8 @@ void assert_pipe(struct drm_i915_private *dev_priv,
1193 pipe); 1193 pipe);
1194 enum intel_display_power_domain power_domain; 1194 enum intel_display_power_domain power_domain;
1195 1195
1196 /* if we need the pipe quirk it must be always on */ 1196 /* we keep both pipes enabled on 830 */
1197 if ((pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) || 1197 if (IS_I830(dev_priv))
1198 (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
1199 state = true; 1198 state = true;
1200 1199
1201 power_domain = POWER_DOMAIN_TRANSCODER(cpu_transcoder); 1200 power_domain = POWER_DOMAIN_TRANSCODER(cpu_transcoder);
@@ -1629,8 +1628,7 @@ static void i9xx_disable_pll(struct intel_crtc *crtc)
1629 } 1628 }
1630 1629
1631 /* Don't disable pipe or pipe PLLs if needed */ 1630 /* Don't disable pipe or pipe PLLs if needed */
1632 if ((pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) || 1631 if (IS_I830(dev_priv))
1633 (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
1634 return; 1632 return;
1635 1633
1636 /* Make sure the pipe isn't still relying on us */ 1634 /* Make sure the pipe isn't still relying on us */
@@ -1913,8 +1911,8 @@ static void intel_enable_pipe(struct intel_crtc *crtc)
1913 reg = PIPECONF(cpu_transcoder); 1911 reg = PIPECONF(cpu_transcoder);
1914 val = I915_READ(reg); 1912 val = I915_READ(reg);
1915 if (val & PIPECONF_ENABLE) { 1913 if (val & PIPECONF_ENABLE) {
1916 WARN_ON(!((pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) || 1914 /* we keep both pipes enabled on 830 */
1917 (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))); 1915 WARN_ON(!IS_I830(dev_priv));
1918 return; 1916 return;
1919 } 1917 }
1920 1918
@@ -1974,8 +1972,7 @@ static void intel_disable_pipe(struct intel_crtc *crtc)
1974 val &= ~PIPECONF_DOUBLE_WIDE; 1972 val &= ~PIPECONF_DOUBLE_WIDE;
1975 1973
1976 /* Don't disable pipe or pipe PLLs if needed */ 1974 /* Don't disable pipe or pipe PLLs if needed */
1977 if (!(pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) && 1975 if (!IS_I830(dev_priv))
1978 !(pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
1979 val &= ~PIPECONF_ENABLE; 1976 val &= ~PIPECONF_ENABLE;
1980 1977
1981 I915_WRITE(reg, val); 1978 I915_WRITE(reg, val);
@@ -7045,8 +7042,8 @@ static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc)
7045 7042
7046 pipeconf = 0; 7043 pipeconf = 0;
7047 7044
7048 if ((intel_crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) || 7045 /* we keep both pipes enabled on 830 */
7049 (intel_crtc->pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE)) 7046 if (IS_I830(dev_priv))
7050 pipeconf |= I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE; 7047 pipeconf |= I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE;
7051 7048
7052 if (intel_crtc->config->double_wide) 7049 if (intel_crtc->config->double_wide)
@@ -12231,9 +12228,8 @@ verify_crtc_state(struct drm_crtc *crtc,
12231 12228
12232 active = dev_priv->display.get_pipe_config(intel_crtc, pipe_config); 12229 active = dev_priv->display.get_pipe_config(intel_crtc, pipe_config);
12233 12230
12234 /* hw state is inconsistent with the pipe quirk */ 12231 /* we keep both pipes enabled on 830 */
12235 if ((intel_crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) || 12232 if (IS_I830(dev_priv))
12236 (intel_crtc->pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
12237 active = new_crtc_state->active; 12233 active = new_crtc_state->active;
12238 12234
12239 I915_STATE_WARN(new_crtc_state->active != active, 12235 I915_STATE_WARN(new_crtc_state->active != active,
@@ -14732,27 +14728,6 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv)
14732} 14728}
14733 14729
14734/* 14730/*
14735 * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend,
14736 * resume, or other times. This quirk makes sure that's the case for
14737 * affected systems.
14738 */
14739static void quirk_pipea_force(struct drm_device *dev)
14740{
14741 struct drm_i915_private *dev_priv = to_i915(dev);
14742
14743 dev_priv->quirks |= QUIRK_PIPEA_FORCE;
14744 DRM_INFO("applying pipe a force quirk\n");
14745}
14746
14747static void quirk_pipeb_force(struct drm_device *dev)
14748{
14749 struct drm_i915_private *dev_priv = to_i915(dev);
14750
14751 dev_priv->quirks |= QUIRK_PIPEB_FORCE;
14752 DRM_INFO("applying pipe b force quirk\n");
14753}
14754
14755/*
14756 * Some machines (Lenovo U160) do not work with SSC on LVDS for some reason 14731 * Some machines (Lenovo U160) do not work with SSC on LVDS for some reason
14757 */ 14732 */
14758static void quirk_ssc_force_disable(struct drm_device *dev) 14733static void quirk_ssc_force_disable(struct drm_device *dev)
@@ -14817,12 +14792,6 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
14817}; 14792};
14818 14793
14819static struct intel_quirk intel_quirks[] = { 14794static struct intel_quirk intel_quirks[] = {
14820 /* 830 needs to leave pipe A & dpll A up */
14821 { 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
14822
14823 /* 830 needs to leave pipe B & dpll B up */
14824 { 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipeb_force },
14825
14826 /* Lenovo U160 cannot use SSC on LVDS */ 14795 /* Lenovo U160 cannot use SSC on LVDS */
14827 { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable }, 14796 { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },
14828 14797
@@ -15228,37 +15197,6 @@ void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
15228 POSTING_READ(DPLL(pipe)); 15197 POSTING_READ(DPLL(pipe));
15229} 15198}
15230 15199
15231static void intel_enable_pipe_a(struct drm_device *dev,
15232 struct drm_modeset_acquire_ctx *ctx)
15233{
15234 struct intel_connector *connector;
15235 struct drm_connector_list_iter conn_iter;
15236 struct drm_connector *crt = NULL;
15237 struct intel_load_detect_pipe load_detect_temp;
15238 int ret;
15239
15240 /* We can't just switch on the pipe A, we need to set things up with a
15241 * proper mode and output configuration. As a gross hack, enable pipe A
15242 * by enabling the load detect pipe once. */
15243 drm_connector_list_iter_begin(dev, &conn_iter);
15244 for_each_intel_connector_iter(connector, &conn_iter) {
15245 if (connector->encoder->type == INTEL_OUTPUT_ANALOG) {
15246 crt = &connector->base;
15247 break;
15248 }
15249 }
15250 drm_connector_list_iter_end(&conn_iter);
15251
15252 if (!crt)
15253 return;
15254
15255 ret = intel_get_load_detect_pipe(crt, NULL, &load_detect_temp, ctx);
15256 WARN(ret < 0, "All modeset mutexes are locked, but intel_get_load_detect_pipe failed\n");
15257
15258 if (ret > 0)
15259 intel_release_load_detect_pipe(crt, &load_detect_temp, ctx);
15260}
15261
15262static bool 15200static bool
15263intel_check_plane_mapping(struct intel_crtc *crtc) 15201intel_check_plane_mapping(struct intel_crtc *crtc)
15264{ 15202{
@@ -15357,16 +15295,6 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
15357 crtc->plane = plane; 15295 crtc->plane = plane;
15358 } 15296 }
15359 15297
15360 if (!IS_I830(dev_priv) &&
15361 dev_priv->quirks & QUIRK_PIPEA_FORCE &&
15362 crtc->pipe == PIPE_A && !crtc->active) {
15363 /* BIOS forgot to enable pipe A, this mostly happens after
15364 * resume. Force-enable the pipe to fix this, the update_dpms
15365 * call below we restore the pipe to the right state, but leave
15366 * the required bits on. */
15367 intel_enable_pipe_a(dev, ctx);
15368 }
15369
15370 /* Adjust the state of the output pipe according to whether we 15298 /* Adjust the state of the output pipe according to whether we
15371 * have active connectors/encoders. */ 15299 * have active connectors/encoders. */
15372 if (crtc->active && !intel_crtc_has_encoders(crtc)) 15300 if (crtc->active && !intel_crtc_has_encoders(crtc))
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 2e0c56ed22bb..b96aed941b97 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -270,7 +270,6 @@ static int intel_overlay_on(struct intel_overlay *overlay)
270 u32 *cs; 270 u32 *cs;
271 271
272 WARN_ON(overlay->active); 272 WARN_ON(overlay->active);
273 WARN_ON(IS_I830(dev_priv) && !(dev_priv->quirks & QUIRK_PIPEA_FORCE));
274 273
275 req = alloc_request(overlay); 274 req = alloc_request(overlay);
276 if (IS_ERR(req)) 275 if (IS_ERR(req))