aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-12-11 20:39:49 -0500
committerDave Airlie <airlied@redhat.com>2014-12-11 20:39:49 -0500
commitb59f78228ca3d81ecb491fb17d348b07002dbe03 (patch)
treed3600fbc2382128962fefb24e2d956f1fee0803a
parentf41c2581bc2b6b21f774596845952a7cb4c15c74 (diff)
parent9f49c37635d5c2a801f7670d5fbf0b25ec461f2c (diff)
Merge tag 'drm-intel-next-fixes-2014-12-11' of git://anongit.freedesktop.org/drm-intel into drm-next
Here's a batch of i915 fixes for 3.19. * tag 'drm-intel-next-fixes-2014-12-11' of git://anongit.freedesktop.org/drm-intel: drm/i915: save/restore GMBUS freq across suspend/resume on gen4 drm/i915: Remove '& 0xffff' from the mask given to WA_REG() drm/i915: Invert the mask and val arguments in wa_add() and WA_REG() drm/i915/bdw: Fix the write setting up the WIZ hashing mode drm/i915: Don't complain about stolen conflicts on gen3 drm/i915: resume MST after reading back hw state drm/i915: Handle inaccurate time conversion issues drm/i915: compute wait_ioctl timeout correctly drm/i915: don't always do full mode sets when infoframes are enabled
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c3
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h6
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c13
-rw-r--r--drivers/gpu/drm/i915/i915_gem_stolen.c6
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h18
-rw-r--r--drivers/gpu/drm/i915/i915_suspend.c8
-rw-r--r--drivers/gpu/drm/i915/intel_display.c10
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c6
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c24
-rw-r--r--kernel/time/time.c1
10 files changed, 72 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1e9c136a874c..f990ab4c3efb 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -706,11 +706,12 @@ static int i915_drm_resume(struct drm_device *dev)
706 dev_priv->display.hpd_irq_setup(dev); 706 dev_priv->display.hpd_irq_setup(dev);
707 spin_unlock_irq(&dev_priv->irq_lock); 707 spin_unlock_irq(&dev_priv->irq_lock);
708 708
709 intel_dp_mst_resume(dev);
710 drm_modeset_lock_all(dev); 709 drm_modeset_lock_all(dev);
711 intel_modeset_setup_hw_state(dev, true); 710 intel_modeset_setup_hw_state(dev, true);
712 drm_modeset_unlock_all(dev); 711 drm_modeset_unlock_all(dev);
713 712
713 intel_dp_mst_resume(dev);
714
714 /* 715 /*
715 * ... but also need to make sure that hotplug processing 716 * ... but also need to make sure that hotplug processing
716 * doesn't cause havoc. Like in the driver load code we don't 717 * doesn't cause havoc. Like in the driver load code we don't
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index bb1892d72efe..63bcda5541ec 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -924,6 +924,7 @@ struct i915_suspend_saved_registers {
924 u32 savePIPEB_LINK_N1; 924 u32 savePIPEB_LINK_N1;
925 u32 saveMCHBAR_RENDER_STANDBY; 925 u32 saveMCHBAR_RENDER_STANDBY;
926 u32 savePCH_PORT_HOTPLUG; 926 u32 savePCH_PORT_HOTPLUG;
927 u16 saveGCDGMBUS;
927}; 928};
928 929
929struct vlv_s0ix_state { 930struct vlv_s0ix_state {
@@ -3032,6 +3033,11 @@ static inline unsigned long msecs_to_jiffies_timeout(const unsigned int m)
3032 return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1); 3033 return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1);
3033} 3034}
3034 3035
3036static inline unsigned long nsecs_to_jiffies_timeout(const u64 n)
3037{
3038 return min_t(u64, MAX_JIFFY_OFFSET, nsecs_to_jiffies64(n) + 1);
3039}
3040
3035static inline unsigned long 3041static inline unsigned long
3036timespec_to_jiffies_timeout(const struct timespec *value) 3042timespec_to_jiffies_timeout(const struct timespec *value)
3037{ 3043{
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d2ba315f4c92..4a9faea626db 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1227,7 +1227,8 @@ int __i915_wait_seqno(struct intel_engine_cs *ring, u32 seqno,
1227 if (i915_seqno_passed(ring->get_seqno(ring, true), seqno)) 1227 if (i915_seqno_passed(ring->get_seqno(ring, true), seqno))
1228 return 0; 1228 return 0;
1229 1229
1230 timeout_expire = timeout ? jiffies + nsecs_to_jiffies((u64)*timeout) : 0; 1230 timeout_expire = timeout ?
1231 jiffies + nsecs_to_jiffies_timeout((u64)*timeout) : 0;
1231 1232
1232 if (INTEL_INFO(dev)->gen >= 6 && ring->id == RCS && can_wait_boost(file_priv)) { 1233 if (INTEL_INFO(dev)->gen >= 6 && ring->id == RCS && can_wait_boost(file_priv)) {
1233 gen6_rps_boost(dev_priv); 1234 gen6_rps_boost(dev_priv);
@@ -1303,6 +1304,16 @@ int __i915_wait_seqno(struct intel_engine_cs *ring, u32 seqno,
1303 s64 tres = *timeout - (now - before); 1304 s64 tres = *timeout - (now - before);
1304 1305
1305 *timeout = tres < 0 ? 0 : tres; 1306 *timeout = tres < 0 ? 0 : tres;
1307
1308 /*
1309 * Apparently ktime isn't accurate enough and occasionally has a
1310 * bit of mismatch in the jiffies<->nsecs<->ktime loop. So patch
1311 * things up to make the test happy. We allow up to 1 jiffy.
1312 *
1313 * This is a regrssion from the timespec->ktime conversion.
1314 */
1315 if (ret == -ETIME && *timeout < jiffies_to_usecs(1)*1000)
1316 *timeout = 0;
1306 } 1317 }
1307 1318
1308 return ret; 1319 return ret;
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index c38891892547..a2045848bd1a 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -137,7 +137,11 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
137 r = devm_request_mem_region(dev->dev, base + 1, 137 r = devm_request_mem_region(dev->dev, base + 1,
138 dev_priv->gtt.stolen_size - 1, 138 dev_priv->gtt.stolen_size - 1,
139 "Graphics Stolen Memory"); 139 "Graphics Stolen Memory");
140 if (r == NULL) { 140 /*
141 * GEN3 firmware likes to smash pci bridges into the stolen
142 * range. Apparently this works.
143 */
144 if (r == NULL && !IS_GEN3(dev)) {
141 DRM_ERROR("conflict detected with stolen region: [0x%08x - 0x%08x]\n", 145 DRM_ERROR("conflict detected with stolen region: [0x%08x - 0x%08x]\n",
142 base, base + (uint32_t)dev_priv->gtt.stolen_size); 146 base, base + (uint32_t)dev_priv->gtt.stolen_size);
143 base = 0; 147 base = 0;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 544675895c8d..eefdc238f70b 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -32,8 +32,19 @@
32#define _PIPE3(pipe, a, b, c) ((pipe) == PIPE_A ? (a) : \ 32#define _PIPE3(pipe, a, b, c) ((pipe) == PIPE_A ? (a) : \
33 (pipe) == PIPE_B ? (b) : (c)) 33 (pipe) == PIPE_B ? (b) : (c))
34 34
35#define _MASKED_BIT_ENABLE(a) (((a) << 16) | (a)) 35#define _MASKED_FIELD(mask, value) ({ \
36#define _MASKED_BIT_DISABLE(a) ((a) << 16) 36 if (__builtin_constant_p(mask)) \
37 BUILD_BUG_ON_MSG(((mask) & 0xffff0000), "Incorrect mask"); \
38 if (__builtin_constant_p(value)) \
39 BUILD_BUG_ON_MSG((value) & 0xffff0000, "Incorrect value"); \
40 if (__builtin_constant_p(mask) && __builtin_constant_p(value)) \
41 BUILD_BUG_ON_MSG((value) & ~(mask), \
42 "Incorrect value for mask"); \
43 (mask) << 16 | (value); })
44#define _MASKED_BIT_ENABLE(a) ({ typeof(a) _a = (a); _MASKED_FIELD(_a, _a); })
45#define _MASKED_BIT_DISABLE(a) (_MASKED_FIELD((a), 0))
46
47
37 48
38/* PCI config space */ 49/* PCI config space */
39 50
@@ -74,6 +85,7 @@
74#define I915_GC_RENDER_CLOCK_166_MHZ (0 << 0) 85#define I915_GC_RENDER_CLOCK_166_MHZ (0 << 0)
75#define I915_GC_RENDER_CLOCK_200_MHZ (1 << 0) 86#define I915_GC_RENDER_CLOCK_200_MHZ (1 << 0)
76#define I915_GC_RENDER_CLOCK_333_MHZ (4 << 0) 87#define I915_GC_RENDER_CLOCK_333_MHZ (4 << 0)
88#define GCDGMBUS 0xcc
77#define PCI_LBPC 0xf4 /* legacy/combination backlight modes, also called LBB */ 89#define PCI_LBPC 0xf4 /* legacy/combination backlight modes, also called LBB */
78 90
79 91
@@ -1282,7 +1294,7 @@ enum punit_power_well {
1282#define GEN6_WIZ_HASHING_8x8 GEN6_WIZ_HASHING(0, 0) 1294#define GEN6_WIZ_HASHING_8x8 GEN6_WIZ_HASHING(0, 0)
1283#define GEN6_WIZ_HASHING_8x4 GEN6_WIZ_HASHING(0, 1) 1295#define GEN6_WIZ_HASHING_8x4 GEN6_WIZ_HASHING(0, 1)
1284#define GEN6_WIZ_HASHING_16x4 GEN6_WIZ_HASHING(1, 0) 1296#define GEN6_WIZ_HASHING_16x4 GEN6_WIZ_HASHING(1, 0)
1285#define GEN6_WIZ_HASHING_MASK (GEN6_WIZ_HASHING(1, 1) << 16) 1297#define GEN6_WIZ_HASHING_MASK GEN6_WIZ_HASHING(1, 1)
1286#define GEN6_TD_FOUR_ROW_DISPATCH_DISABLE (1 << 5) 1298#define GEN6_TD_FOUR_ROW_DISPATCH_DISABLE (1 << 5)
1287 1299
1288#define GFX_MODE 0x02520 1300#define GFX_MODE 0x02520
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index dfe661743398..26368822a33f 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -303,6 +303,10 @@ int i915_save_state(struct drm_device *dev)
303 } 303 }
304 } 304 }
305 305
306 if (IS_GEN4(dev))
307 pci_read_config_word(dev->pdev, GCDGMBUS,
308 &dev_priv->regfile.saveGCDGMBUS);
309
306 /* Cache mode state */ 310 /* Cache mode state */
307 if (INTEL_INFO(dev)->gen < 7) 311 if (INTEL_INFO(dev)->gen < 7)
308 dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); 312 dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);
@@ -331,6 +335,10 @@ int i915_restore_state(struct drm_device *dev)
331 mutex_lock(&dev->struct_mutex); 335 mutex_lock(&dev->struct_mutex);
332 336