aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-03 13:13:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-03 13:13:34 -0400
commit01627d968c8b5e2810fe8c417b406b968297c236 (patch)
treee49077d45d6998adee302f142f7d54e472c81bc3 /drivers/gpu
parente1a7eb08ee097e97e928062a242b0de5b2599a11 (diff)
parente37acc0f5ea18ff1ea4db96a84a51b90044c0dbd (diff)
Merge branch 'drm-fixes-intel' of git://people.freedesktop.org/~airlied/linux
Pull drm update from Dave Airlie: "This pull just contains a forward of the Intel fixes from Daniel. The only annoyance is the RC6 enable, which really should have made -next, but since Ubuntu are shipping it I reckon its getting a good testing now by the time 3.4 comes out. The pull from Daniel contains his pull message to me: "A few patches for 3.4, major part is 3 regression fixes: - ppgtt broke hibernate on snb/ivb. Somehow our QA claims that it still works, which is why this has not been caught earlier. - ppgtt flails in combination with dmar. I kinda expected this one :( - fence handling bugfix for gen2/3. Iirc this one is about a year old, fix curtesy Chris Wilson. I've created an shockingly simple i-g-t test to catch this in the future." Wrt regressions I've just got a report that gmbus (newly enabled again in 3.4) is a bit noisy. I'm looking into this atm. Also included are the rc6 enable patches for snb from Eugeni. I wanted to include these in the main 3.4 pull but screwed it up. Please hit me. Imo these kind of patches really should go in before -rc1, but in thise case rc6 has brought us tons of press and guinea pigs^W^W testers and ubuntu is already running with it. So I estimate a pretty small chance for this to blow up. And some smaller things: - two minor locking snafus - server gt2 ivb pciid - 2 patches to sanitize the register state left behind by the bios some more - 2 new quirk entries - cs readback trick against missed IRQs from ivb also enabled on snb - sprite fix from Jesse" Let's see if the "enable RC6 on sandybridge" finally works and sticks. I've been enabling it by hand (i915.i915_enable_rc6=1) for several months on my Macbook Air, and it definitely makes a difference (and has worked for me). But every time we enabled it before it showed some odd hw buglet for *somebody*. This time it's all good, I'm sure. * 'drm-fixes-intel' of git://people.freedesktop.org/~airlied/linux: drm/i915: treat src w & h as fixed point in sprite handling code drm/i915: no-lvds quirk on MSI DC500 drm/i915: Add lock on drm_helper_resume_force_mode drm/i915: don't leak struct_mutex lock on ppgtt init failures drm/i915: disable ppgtt on snb when dmar is enabled drm/i915: add Ivy Bridge GT2 Server entries drm/i915: properly clear SSC1 bit in the pch refclock init code drm/i915: apply CS reg readback trick against missed IRQ on snb drm/i915: quirk away broken OpRegion VBT drm/i915: enable plain RC6 on Sandy Bridge by default drm/i915: allow to select rc6 modes via kernel parameter drm/i915: Mark untiled BLT commands as fenced on gen2/3 drm/i915: properly restore the ppgtt page directory on resume drm/i915: Sanitize BIOS debugging bits from PIPECONF
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c21
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c13
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h23
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c37
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c9
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h1
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c23
-rw-r--r--drivers/gpu/drm/i915/intel_display.c37
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c8
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c2
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c3
12 files changed, 145 insertions, 34 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 9341eb8ce93b..785f67f963ef 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1183,6 +1183,21 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
1183 return can_switch; 1183 return can_switch;
1184} 1184}
1185 1185
1186static bool
1187intel_enable_ppgtt(struct drm_device *dev)
1188{
1189 if (i915_enable_ppgtt >= 0)
1190 return i915_enable_ppgtt;
1191
1192#ifdef CONFIG_INTEL_IOMMU
1193 /* Disable ppgtt on SNB if VT-d is on. */
1194 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped)
1195 return false;
1196#endif
1197
1198 return true;
1199}
1200
1186static int i915_load_gem_init(struct drm_device *dev) 1201static int i915_load_gem_init(struct drm_device *dev)
1187{ 1202{
1188 struct drm_i915_private *dev_priv = dev->dev_private; 1203 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1197,7 +1212,7 @@ static int i915_load_gem_init(struct drm_device *dev)
1197 drm_mm_init(&dev_priv->mm.stolen, 0, prealloc_size); 1212 drm_mm_init(&dev_priv->mm.stolen, 0, prealloc_size);
1198 1213
1199 mutex_lock(&dev->struct_mutex); 1214 mutex_lock(&dev->struct_mutex);
1200 if (i915_enable_ppgtt && HAS_ALIASING_PPGTT(dev)) { 1215 if (intel_enable_ppgtt(dev) && HAS_ALIASING_PPGTT(dev)) {
1201 /* PPGTT pdes are stolen from global gtt ptes, so shrink the 1216 /* PPGTT pdes are stolen from global gtt ptes, so shrink the
1202 * aperture accordingly when using aliasing ppgtt. */ 1217 * aperture accordingly when using aliasing ppgtt. */
1203 gtt_size -= I915_PPGTT_PD_ENTRIES*PAGE_SIZE; 1218 gtt_size -= I915_PPGTT_PD_ENTRIES*PAGE_SIZE;
@@ -1207,8 +1222,10 @@ static int i915_load_gem_init(struct drm_device *dev)
1207 i915_gem_do_init(dev, 0, mappable_size, gtt_size); 1222 i915_gem_do_init(dev, 0, mappable_size, gtt_size);
1208 1223
1209 ret = i915_gem_init_aliasing_ppgtt(dev); 1224 ret = i915_gem_init_aliasing_ppgtt(dev);
1210 if (ret) 1225 if (ret) {
1226 mutex_unlock(&dev->struct_mutex);
1211 return ret; 1227 return ret;
1228 }
1212 } else { 1229 } else {
1213 /* Let GEM Manage all of the aperture. 1230 /* Let GEM Manage all of the aperture.
1214 * 1231 *
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1a7559b59997..dfa55e7478fb 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -66,7 +66,11 @@ MODULE_PARM_DESC(semaphores,
66int i915_enable_rc6 __read_mostly = -1; 66int i915_enable_rc6 __read_mostly = -1;
67module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); 67module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600);
68MODULE_PARM_DESC(i915_enable_rc6, 68MODULE_PARM_DESC(i915_enable_rc6,
69 "Enable power-saving render C-state 6 (default: -1 (use per-chip default)"); 69 "Enable power-saving render C-state 6. "
70 "Different stages can be selected via bitmask values "
71 "(0 = disable; 1 = enable rc6; 2 = enable deep rc6; 4 = enable deepest rc6). "
72 "For example, 3 would enable rc6 and deep rc6, and 7 would enable everything. "
73 "default: -1 (use per-chip default)");
70 74
71int i915_enable_fbc __read_mostly = -1; 75int i915_enable_fbc __read_mostly = -1;
72module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); 76module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600);
@@ -103,8 +107,8 @@ MODULE_PARM_DESC(enable_hangcheck,
103 "WARNING: Disabling this can cause system wide hangs. " 107 "WARNING: Disabling this can cause system wide hangs. "
104 "(default: true)"); 108 "(default: true)");
105 109
106bool i915_enable_ppgtt __read_mostly = 1; 110int i915_enable_ppgtt __read_mostly = -1;
107module_param_named(i915_enable_ppgtt, i915_enable_ppgtt, bool, 0600); 111module_param_named(i915_enable_ppgtt, i915_enable_ppgtt, int, 0600);
108MODULE_PARM_DESC(i915_enable_ppgtt, 112MODULE_PARM_DESC(i915_enable_ppgtt,
109 "Enable PPGTT (default: true)"); 113 "Enable PPGTT (default: true)");
110 114
@@ -292,6 +296,7 @@ static const struct pci_device_id pciidlist[] = { /* aka */
292 INTEL_VGA_DEVICE(0x0152, &intel_ivybridge_d_info), /* GT1 desktop */ 296 INTEL_VGA_DEVICE(0x0152, &intel_ivybridge_d_info), /* GT1 desktop */
293 INTEL_VGA_DEVICE(0x0162, &intel_ivybridge_d_info), /* GT2 desktop */ 297 INTEL_VGA_DEVICE(0x0162, &intel_ivybridge_d_info), /* GT2 desktop */
294 INTEL_VGA_DEVICE(0x015a, &intel_ivybridge_d_info), /* GT1 server */ 298 INTEL_VGA_DEVICE(0x015a, &intel_ivybridge_d_info), /* GT1 server */
299 INTEL_VGA_DEVICE(0x016a, &intel_ivybridge_d_info), /* GT2 server */
295 {0, 0, 0} 300 {0, 0, 0}
296}; 301};
297 302
@@ -533,7 +538,9 @@ static int i915_drm_thaw(struct drm_device *dev)
533 drm_irq_install(dev); 538 drm_irq_install(dev);
534 539
535 /* Resume the modeset for every activated CRTC */ 540 /* Resume the modeset for every activated CRTC */
541 mutex_lock(&dev->mode_config.mutex);
536 drm_helper_resume_force_mode(dev); 542 drm_helper_resume_force_mode(dev);
543 mutex_unlock(&dev->mode_config.mutex);
537 544
538 if (IS_IRONLAKE_M(dev)) 545 if (IS_IRONLAKE_M(dev))
539 ironlake_enable_rc6(dev); 546 ironlake_enable_rc6(dev);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c0f19f572004..5fabc6c31fec 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1053,6 +1053,27 @@ struct drm_i915_file_private {
1053 1053
1054#include "i915_trace.h" 1054#include "i915_trace.h"
1055 1055
1056/**
1057 * RC6 is a special power stage which allows the GPU to enter an very
1058 * low-voltage mode when idle, using down to 0V while at this stage. This
1059 * stage is entered automatically when the GPU is idle when RC6 support is
1060 * enabled, and as soon as new workload arises GPU wakes up automatically as well.
1061 *
1062 * There are different RC6 modes available in Intel GPU, which differentiate
1063 * among each other with the latency required to enter and leave RC6 and
1064 * voltage consumed by the GPU in different states.
1065 *
1066 * The combination of the following flags define which states GPU is allowed
1067 * to enter, while RC6 is the normal RC6 state, RC6p is the deep RC6, and
1068 * RC6pp is deepest RC6. Their support by hardware varies according to the
1069 * GPU, BIOS, chipset and platform. RC6 is usually the safest one and the one
1070 * which brings the most power savings; deeper states save more power, but
1071 * require higher latency to switch to and wake up.
1072 */
1073#define INTEL_RC6_ENABLE (1<<0)
1074#define INTEL_RC6p_ENABLE (1<<1)
1075#define INTEL_RC6pp_ENABLE (1<<2)
1076
1056extern struct drm_ioctl_desc i915_ioctls[]; 1077extern struct drm_ioctl_desc i915_ioctls[];
1057extern int i915_max_ioctl; 1078extern int i915_max_ioctl;
1058extern unsigned int i915_fbpercrtc __always_unused; 1079extern unsigned int i915_fbpercrtc __always_unused;
@@ -1065,7 +1086,7 @@ extern int i915_vbt_sdvo_panel_type __read_mostly;
1065extern int i915_enable_rc6 __read_mostly; 1086extern int i915_enable_rc6 __read_mostly;
1066extern int i915_enable_fbc __read_mostly; 1087extern int i915_enable_fbc __read_mostly;
1067extern bool i915_enable_hangcheck __read_mostly; 1088extern bool i915_enable_hangcheck __read_mostly;
1068extern bool i915_enable_ppgtt __read_mostly; 1089extern int i915_enable_ppgtt __read_mostly;
1069 1090
1070extern int i915_suspend(struct drm_device *dev, pm_message_t state); 1091extern int i915_suspend(struct drm_device *dev, pm_message_t state);
1071extern int i915_resume(struct drm_device *dev); 1092extern int i915_resume(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1f441f5c2405..4c65c639f772 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1472,16 +1472,19 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
1472 list_move_tail(&obj->ring_list, &ring->active_list); 1472 list_move_tail(&obj->ring_list, &ring->active_list);
1473 1473
1474 obj->last_rendering_seqno = seqno; 1474 obj->last_rendering_seqno = seqno;
1475 if (obj->fenced_gpu_access) {
1476 struct drm_i915_fence_reg *reg;
1477
1478 BUG_ON(obj->fence_reg == I915_FENCE_REG_NONE);
1479 1475
1476 if (obj->fenced_gpu_access) {
1480 obj->last_fenced_seqno = seqno; 1477 obj->last_fenced_seqno = seqno;
1481 obj->last_fenced_ring = ring; 1478 obj->last_fenced_ring = ring;
1482 1479
1483 reg = &dev_priv->fence_regs[obj->fence_reg]; 1480 /* Bump MRU to take account of the delayed flush */
1484 list_move_tail(&reg->lru_list, &dev_priv->mm.fence_list); 1481 if (obj->fence_reg != I915_FENCE_REG_NONE) {
1482 struct drm_i915_fence_reg *reg;
1483
1484 reg = &dev_priv->fence_regs[obj->fence_reg];
1485 list_move_tail(&reg->lru_list,
1486 &dev_priv->mm.fence_list);
1487 }
1485 } 1488 }
1486} 1489}
1487 1490
@@ -3754,12 +3757,32 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
3754 drm_i915_private_t *dev_priv = dev->dev_private; 3757 drm_i915_private_t *dev_priv = dev->dev_private;
3755 uint32_t pd_offset; 3758 uint32_t pd_offset;
3756 struct intel_ring_buffer *ring; 3759 struct intel_ring_buffer *ring;
3760 struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
3761 uint32_t __iomem *pd_addr;
3762 uint32_t pd_entry;
3757 int i; 3763 int i;
3758 3764
3759 if (!dev_priv->mm.aliasing_ppgtt) 3765 if (!dev_priv->mm.aliasing_ppgtt)
3760 return; 3766 return;
3761 3767
3762 pd_offset = dev_priv->mm.aliasing_ppgtt->pd_offset; 3768
3769 pd_addr = dev_priv->mm.gtt->gtt + ppgtt->pd_offset/sizeof(uint32_t);
3770 for (i = 0; i < ppgtt->num_pd_entries; i++) {
3771 dma_addr_t pt_addr;
3772
3773 if (dev_priv->mm.gtt->needs_dmar)
3774 pt_addr = ppgtt->pt_dma_addr[i];
3775 else
3776 pt_addr = page_to_phys(ppgtt->pt_pages[i]);
3777
3778 pd_entry = GEN6_PDE_ADDR_ENCODE(pt_addr);
3779 pd_entry |= GEN6_PDE_VALID;
3780
3781 writel(pd_entry, pd_addr + i);
3782 }
3783 readl(pd_addr);
3784
3785 pd_offset = ppgtt->pd_offset;
3763 pd_offset /= 64; /* in cachelines, */ 3786 pd_offset /= 64; /* in cachelines, */
3764 pd_offset <<= 16; 3787 pd_offset <<= 16;
3765 3788
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 81687af00893..f51a696486cb 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -498,8 +498,8 @@ pin_and_fence_object(struct drm_i915_gem_object *obj,
498 if (ret) 498 if (ret)
499 goto err_unpin; 499 goto err_unpin;
500 } 500 }
501 obj->pending_fenced_gpu_access = true;
501 } 502 }
502 obj->pending_fenced_gpu_access = need_fence;
503 } 503 }
504 504
505 entry->offset = obj->gtt_offset; 505 entry->offset = obj->gtt_offset;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 2eacd78bb93b..a135c61f4119 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -65,9 +65,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev)
65{ 65{
66 struct drm_i915_private *dev_priv = dev->dev_private; 66 struct drm_i915_private *dev_priv = dev->dev_private;
67 struct i915_hw_ppgtt *ppgtt; 67 struct i915_hw_ppgtt *ppgtt;
68 uint32_t pd_entry;
69 unsigned first_pd_entry_in_global_pt; 68 unsigned first_pd_entry_in_global_pt;
70 uint32_t __iomem *pd_addr;
71 int i; 69 int i;
72 int ret = -ENOMEM; 70 int ret = -ENOMEM;
73 71
@@ -100,7 +98,6 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev)
100 goto err_pt_alloc; 98 goto err_pt_alloc;
101 } 99 }
102 100
103 pd_addr = dev_priv->mm.gtt->gtt + first_pd_entry_in_global_pt;
104 for (i = 0; i < ppgtt->num_pd_entries; i++) { 101 for (i = 0; i < ppgtt->num_pd_entries; i++) {
105 dma_addr_t pt_addr; 102 dma_addr_t pt_addr;
106 if (dev_priv->mm.gtt->needs_dmar) { 103 if (dev_priv->mm.gtt->needs_dmar) {
@@ -117,13 +114,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev)
117 ppgtt->pt_dma_addr[i] = pt_addr; 114 ppgtt->pt_dma_addr[i] = pt_addr;
118 } else 115 } else
119 pt_addr = page_to_phys(ppgtt->pt_pages[i]); 116 pt_addr = page_to_phys(ppgtt->pt_pages[i]);
120
121 pd_entry = GEN6_PDE_ADDR_ENCODE(pt_addr);
122 pd_entry |= GEN6_PDE_VALID;
123
124 writel(pd_entry, pd_addr + i);
125 } 117 }
126 readl(pd_addr);
127 118
128 ppgtt->scratch_page_dma_addr = dev_priv->mm.gtt->scratch_page_dma; 119 ppgtt->scratch_page_dma_addr = dev_priv->mm.gtt->scratch_page_dma;
129 120
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 3886cf051bac..2abf4eb94039 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2385,6 +2385,7 @@
2385#define PIPECONF_DISABLE 0 2385#define PIPECONF_DISABLE 0
2386#define PIPECONF_DOUBLE_WIDE (1<<30) 2386#define PIPECONF_DOUBLE_WIDE (1<<30)
2387#define I965_PIPECONF_ACTIVE (1<<30) 2387#define I965_PIPECONF_ACTIVE (1<<30)
2388#define PIPECONF_FRAME_START_DELAY_MASK (3<<27)
2388#define PIPECONF_SINGLE_WIDE 0 2389#define PIPECONF_SINGLE_WIDE 0
2389#define PIPECONF_PIPE_UNLOCKED 0 2390#define PIPECONF_PIPE_UNLOCKED 0
2390#define PIPECONF_PIPE_LOCKED (1<<25) 2391#define PIPECONF_PIPE_LOCKED (1<<25)
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 8168d8f8a634..b48fc2a8410c 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -24,6 +24,7 @@
24 * Eric Anholt <eric@anholt.net> 24 * Eric Anholt <eric@anholt.net>
25 * 25 *
26 */ 26 */
27#include <linux/dmi.h>
27#include <drm/drm_dp_helper.h> 28#include <drm/drm_dp_helper.h>
28#include "drmP.h" 29#include "drmP.h"
29#include "drm.h" 30#include "drm.h"
@@ -621,6 +622,26 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
621 dev_priv->edp.bpp = 18; 622 dev_priv->edp.bpp = 18;
622} 623}
623 624
625static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
626{
627 DRM_DEBUG_KMS("Falling back to manually reading VBT from "
628 "VBIOS ROM for %s\n",
629 id->ident);
630 return 1;
631}
632
633static const struct dmi_system_id intel_no_opregion_vbt[] = {
634 {
635 .callback = intel_no_opregion_vbt_callback,
636 .ident = "ThinkCentre A57",
637 .matches = {
638 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
639 DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
640 },
641 },
642 { }
643};
644
624/** 645/**
625 * intel_parse_bios - find VBT and initialize settings from the BIOS 646 * intel_parse_bios - find VBT and initialize settings from the BIOS
626 * @dev: DRM device 647 * @dev: DRM device
@@ -641,7 +662,7 @@ intel_parse_bios(struct drm_device *dev)
641 init_vbt_defaults(dev_priv); 662 init_vbt_defaults(dev_priv);
642 663
643 /* XXX Should this validation be moved to intel_opregion.c? */ 664 /* XXX Should this validation be moved to intel_opregion.c? */
644 if (dev_priv->opregion.vbt) { 665 if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) {
645 struct vbt_header *vbt = dev_priv->opregion.vbt; 666 struct vbt_header *vbt = dev_priv->opregion.vbt;
646 if (memcmp(vbt->signature, "$VBT", 4) == 0) { 667 if (memcmp(vbt->signature, "$VBT", 4) == 0) {
647 DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n", 668 DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d514719f65e2..91b35fd1db8c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5539,7 +5539,8 @@ void ironlake_init_pch_refclk(struct drm_device *dev)
5539 if (intel_panel_use_ssc(dev_priv) && can_ssc) { 5539 if (intel_panel_use_ssc(dev_priv) && can_ssc) {
5540 DRM_DEBUG_KMS("Using SSC on panel\n"); 5540 DRM_DEBUG_KMS("Using SSC on panel\n");
5541 temp |= DREF_SSC1_ENABLE; 5541 temp |= DREF_SSC1_ENABLE;
5542 } 5542 } else
5543 temp &= ~DREF_SSC1_ENABLE;
5543 5544
5544 /* Get SSC going before enabling the outputs */ 5545 /* Get SSC going before enabling the outputs */
5545 I915_WRITE(PCH_DREF_CONTROL, temp); 5546 I915_WRITE(PCH_DREF_CONTROL, temp);
@@ -7580,6 +7581,12 @@ static void intel_sanitize_modesetting(struct drm_device *dev,
7580 struct drm_i915_private *dev_priv = dev->dev_private; 7581 struct drm_i915_private *dev_priv = dev->dev_private;
7581 u32 reg, val; 7582 u32 reg, val;
7582 7583
7584 /* Clear any frame start delays used for debugging left by the BIOS */
7585 for_each_pipe(pipe) {
7586 reg = PIPECONF(pipe);
7587 I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
7588 }
7589
7583 if (HAS_PCH_SPLIT(dev)) 7590 if (HAS_PCH_SPLIT(dev))
7584 return; 7591 return;
7585 7592
@@ -8215,7 +8222,7 @@ void intel_init_emon(struct drm_device *dev)
8215 dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); 8222 dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK);
8216} 8223}
8217 8224
8218static bool intel_enable_rc6(struct drm_device *dev) 8225static int intel_enable_rc6(struct drm_device *dev)
8219{ 8226{
8220 /* 8227 /*
8221 * Respect the kernel parameter if it is set 8228 * Respect the kernel parameter if it is set
@@ -8233,11 +8240,11 @@ static bool intel_enable_rc6(struct drm_device *dev)
8233 * Disable rc6 on Sandybridge 8240 * Disable rc6 on Sandybridge
8234 */ 8241 */
8235 if (INTEL_INFO(dev)->gen == 6) { 8242 if (INTEL_INFO(dev)->gen == 6) {
8236 DRM_DEBUG_DRIVER("Sandybridge: RC6 disabled\n"); 8243 DRM_DEBUG_DRIVER("Sandybridge: deep RC6 disabled\n");
8237 return 0; 8244 return INTEL_RC6_ENABLE;
8238 } 8245 }
8239 DRM_DEBUG_DRIVER("RC6 enabled\n"); 8246 DRM_DEBUG_DRIVER("RC6 and deep RC6 enabled\n");
8240 return 1; 8247 return (INTEL_RC6_ENABLE | INTEL_RC6p_ENABLE);
8241} 8248}
8242 8249
8243void gen6_enable_rps(struct drm_i915_private *dev_priv) 8250void gen6_enable_rps(struct drm_i915_private *dev_priv)
@@ -8247,6 +8254,7 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
8247 u32 pcu_mbox, rc6_mask = 0; 8254 u32 pcu_mbox, rc6_mask = 0;
8248 u32 gtfifodbg; 8255 u32 gtfifodbg;
8249 int cur_freq, min_freq, max_freq; 8256 int cur_freq, min_freq, max_freq;
8257 int rc6_mode;
8250 int i; 8258 int i;
8251 8259
8252 /* Here begins a magic sequence of register writes to enable 8260 /* Here begins a magic sequence of register writes to enable
@@ -8284,9 +8292,20 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
8284 I915_WRITE(GEN6_RC6p_THRESHOLD, 100000); 8292 I915_WRITE(GEN6_RC6p_THRESHOLD, 100000);
8285 I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ 8293 I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */
8286 8294
8287 if (intel_enable_rc6(dev_priv->dev)) 8295 rc6_mode = intel_enable_rc6(dev_priv->dev);
8288 rc6_mask = GEN6_RC_CTL_RC6_ENABLE | 8296 if (rc6_mode & INTEL_RC6_ENABLE)
8289 ((IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0); 8297 rc6_mask |= GEN6_RC_CTL_RC6_ENABLE;
8298
8299 if (rc6_mode & INTEL_RC6p_ENABLE)
8300 rc6_mask |= GEN6_RC_CTL_RC6p_ENABLE;
8301
8302 if (rc6_mode & INTEL_RC6pp_ENABLE)
8303 rc6_mask |= GEN6_RC_CTL_RC6pp_ENABLE;
8304
8305 DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n",
8306 (rc6_mode & INTEL_RC6_ENABLE) ? "on" : "off",
8307 (rc6_mode & INTEL_RC6p_ENABLE) ? "on" : "off",
8308 (rc6_mode & INTEL_RC6pp_ENABLE) ? "on" : "off");
8290 8309
8291 I915_WRITE(GEN6_RC_CONTROL, 8310 I915_WRITE(GEN6_RC_CONTROL,
8292 rc6_mask | 8311 rc6_mask |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index c5c0973af8a1..95db2e988227 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -755,6 +755,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
755 DMI_MATCH(DMI_BOARD_NAME, "hp st5747"), 755 DMI_MATCH(DMI_BOARD_NAME, "hp st5747"),
756 }, 756 },
757 }, 757 },
758 {
759 .callback = intel_no_lvds_dmi_callback,
760 .ident = "MSI Wind Box DC500",
761 .matches = {
762 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
763 DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
764 },
765 },
758 766
759 { } /* terminating entry */ 767 { } /* terminating entry */
760}; 768};
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index fc66af6a9448..e25581a9f60f 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -626,7 +626,7 @@ gen6_ring_get_seqno(struct intel_ring_buffer *ring)
626 /* Workaround to force correct ordering between irq and seqno writes on 626 /* Workaround to force correct ordering between irq and seqno writes on
627 * ivb (and maybe also on snb) by reading from a CS register (like 627 * ivb (and maybe also on snb) by reading from a CS register (like
628 * ACTHD) before reading the status page. */ 628 * ACTHD) before reading the status page. */
629 if (IS_GEN7(dev)) 629 if (IS_GEN6(dev) || IS_GEN7(dev))
630 intel_ring_get_active_head(ring); 630 intel_ring_get_active_head(ring);
631 return intel_read_status_page(ring, I915_GEM_HWS_INDEX); 631 return intel_read_status_page(ring, I915_GEM_HWS_INDEX);
632} 632}
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 7aa0450399a1..a464771a7240 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -411,6 +411,9 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
411 411
412 old_obj = intel_plane->obj; 412 old_obj = intel_plane->obj;
413 413
414 src_w = src_w >> 16;
415 src_h = src_h >> 16;
416
414 /* Pipe must be running... */ 417 /* Pipe must be running... */
415 if (!(I915_READ(PIPECONF(pipe)) & PIPECONF_ENABLE)) 418 if (!(I915_READ(PIPECONF(pipe)) & PIPECONF_ENABLE))
416 return -EINVAL; 419 return -EINVAL;