diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 149c18b7c375..fbe42f0a315d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/vgaarb.h> | ||
32 | #include "drmP.h" | 33 | #include "drmP.h" |
33 | #include "intel_drv.h" | 34 | #include "intel_drv.h" |
34 | #include "i915_drm.h" | 35 | #include "i915_drm.h" |
@@ -1621,29 +1622,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
1621 | return 0; | 1622 | return 0; |
1622 | } | 1623 | } |
1623 | 1624 | ||
1624 | /* Disable the VGA plane that we never use */ | ||
1625 | static void i915_disable_vga (struct drm_device *dev) | ||
1626 | { | ||
1627 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1628 | u8 sr1; | ||
1629 | u32 vga_reg; | ||
1630 | |||
1631 | if (HAS_PCH_SPLIT(dev)) | ||
1632 | vga_reg = CPU_VGACNTRL; | ||
1633 | else | ||
1634 | vga_reg = VGACNTRL; | ||
1635 | |||
1636 | if (I915_READ(vga_reg) & VGA_DISP_DISABLE) | ||
1637 | return; | ||
1638 | |||
1639 | I915_WRITE8(VGA_SR_INDEX, 1); | ||
1640 | sr1 = I915_READ8(VGA_SR_DATA); | ||
1641 | I915_WRITE8(VGA_SR_DATA, sr1 | (1 << 5)); | ||
1642 | udelay(100); | ||
1643 | |||
1644 | I915_WRITE(vga_reg, VGA_DISP_DISABLE); | ||
1645 | } | ||
1646 | |||
1647 | static void ironlake_disable_pll_edp (struct drm_crtc *crtc) | 1625 | static void ironlake_disable_pll_edp (struct drm_crtc *crtc) |
1648 | { | 1626 | { |
1649 | struct drm_device *dev = crtc->dev; | 1627 | struct drm_device *dev = crtc->dev; |
@@ -2156,8 +2134,6 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2156 | dev_priv->display.disable_fbc) | 2134 | dev_priv->display.disable_fbc) |
2157 | dev_priv->display.disable_fbc(dev); | 2135 | dev_priv->display.disable_fbc(dev); |
2158 | 2136 | ||
2159 | i915_disable_vga(dev); | ||
2160 | |||
2161 | /* disable cpu pipe, disable after all planes disabled */ | 2137 | /* disable cpu pipe, disable after all planes disabled */ |
2162 | temp = I915_READ(pipeconf_reg); | 2138 | temp = I915_READ(pipeconf_reg); |
2163 | if ((temp & PIPEACONF_ENABLE) != 0) { | 2139 | if ((temp & PIPEACONF_ENABLE) != 0) { |
@@ -2391,9 +2367,6 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2391 | dev_priv->display.disable_fbc) | 2367 | dev_priv->display.disable_fbc) |
2392 | dev_priv->display.disable_fbc(dev); | 2368 | dev_priv->display.disable_fbc(dev); |
2393 | 2369 | ||
2394 | /* Disable the VGA plane that we never use */ | ||
2395 | i915_disable_vga(dev); | ||
2396 | |||
2397 | /* Disable display plane */ | 2370 | /* Disable display plane */ |
2398 | temp = I915_READ(dspcntr_reg); | 2371 | temp = I915_READ(dspcntr_reg); |
2399 | if ((temp & DISPLAY_PLANE_ENABLE) != 0) { | 2372 | if ((temp & DISPLAY_PLANE_ENABLE) != 0) { |
@@ -6002,6 +5975,29 @@ static void intel_init_quirks(struct drm_device *dev) | |||
6002 | } | 5975 | } |
6003 | } | 5976 | } |
6004 | 5977 | ||
5978 | /* Disable the VGA plane that we never use */ | ||
5979 | static void i915_disable_vga(struct drm_device *dev) | ||
5980 | { | ||
5981 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5982 | u8 sr1; | ||
5983 | u32 vga_reg; | ||
5984 | |||
5985 | if (HAS_PCH_SPLIT(dev)) | ||
5986 | vga_reg = CPU_VGACNTRL; | ||
5987 | else | ||
5988 | vga_reg = VGACNTRL; | ||
5989 | |||
5990 | vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO); | ||
5991 | outb(1, VGA_SR_INDEX); | ||
5992 | sr1 = inb(VGA_SR_DATA); | ||
5993 | outb(sr1 | 1<<5, VGA_SR_DATA); | ||
5994 | vga_put(dev->pdev, VGA_RSRC_LEGACY_IO); | ||
5995 | udelay(300); | ||
5996 | |||
5997 | I915_WRITE(vga_reg, VGA_DISP_DISABLE); | ||
5998 | POSTING_READ(vga_reg); | ||
5999 | } | ||
6000 | |||
6005 | void intel_modeset_init(struct drm_device *dev) | 6001 | void intel_modeset_init(struct drm_device *dev) |
6006 | { | 6002 | { |
6007 | struct drm_i915_private *dev_priv = dev->dev_private; | 6003 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -6050,6 +6046,9 @@ void intel_modeset_init(struct drm_device *dev) | |||
6050 | 6046 | ||
6051 | intel_init_clock_gating(dev); | 6047 | intel_init_clock_gating(dev); |
6052 | 6048 | ||
6049 | /* Just disable it once at startup */ | ||
6050 | i915_disable_vga(dev); | ||
6051 | |||
6053 | if (IS_IRONLAKE_M(dev)) { | 6052 | if (IS_IRONLAKE_M(dev)) { |
6054 | ironlake_enable_drps(dev); | 6053 | ironlake_enable_drps(dev); |
6055 | intel_init_emon(dev); | 6054 | intel_init_emon(dev); |