Commit 17b263f6 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2015-03-12' of git://anongit.freedesktop.org/drm-intel into drm-fixes

More i915 fixes, three out of four are fixes to old bugs, cc: stable.

* tag 'drm-intel-fixes-2015-03-12' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Prevent TLB error on first execution on SNB
  drm/i915: Do both mt and gen6 style forcewake reset on ivb probe
  drm/i915: Make WAIT_IOCTL negative timeouts be indefinite again
  drm/i915: use in_interrupt() not in_irq() to check context
parents cd961bb9 5e4f5189
...@@ -2936,9 +2936,9 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file) ...@@ -2936,9 +2936,9 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
req = obj->last_read_req; req = obj->last_read_req;
/* Do this after OLR check to make sure we make forward progress polling /* Do this after OLR check to make sure we make forward progress polling
* on this IOCTL with a timeout <=0 (like busy ioctl) * on this IOCTL with a timeout == 0 (like busy ioctl)
*/ */
if (args->timeout_ns <= 0) { if (args->timeout_ns == 0) {
ret = -ETIME; ret = -ETIME;
goto out; goto out;
} }
...@@ -2948,7 +2948,8 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file) ...@@ -2948,7 +2948,8 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
i915_gem_request_reference(req); i915_gem_request_reference(req);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
ret = __i915_wait_request(req, reset_counter, true, &args->timeout_ns, ret = __i915_wait_request(req, reset_counter, true,
args->timeout_ns > 0 ? &args->timeout_ns : NULL,
file->driver_priv); file->driver_priv);
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
i915_gem_request_unreference(req); i915_gem_request_unreference(req);
...@@ -4792,6 +4793,9 @@ i915_gem_init_hw(struct drm_device *dev) ...@@ -4792,6 +4793,9 @@ i915_gem_init_hw(struct drm_device *dev)
if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt())
return -EIO; return -EIO;
/* Double layer security blanket, see i915_gem_init() */
intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
if (dev_priv->ellc_size) if (dev_priv->ellc_size)
I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf)); I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf));
...@@ -4824,7 +4828,7 @@ i915_gem_init_hw(struct drm_device *dev) ...@@ -4824,7 +4828,7 @@ i915_gem_init_hw(struct drm_device *dev)
for_each_ring(ring, dev_priv, i) { for_each_ring(ring, dev_priv, i) {
ret = ring->init_hw(ring); ret = ring->init_hw(ring);
if (ret) if (ret)
return ret; goto out;
} }
for (i = 0; i < NUM_L3_SLICES(dev); i++) for (i = 0; i < NUM_L3_SLICES(dev); i++)
...@@ -4841,9 +4845,11 @@ i915_gem_init_hw(struct drm_device *dev) ...@@ -4841,9 +4845,11 @@ i915_gem_init_hw(struct drm_device *dev)
DRM_ERROR("Context enable failed %d\n", ret); DRM_ERROR("Context enable failed %d\n", ret);
i915_gem_cleanup_ringbuffer(dev); i915_gem_cleanup_ringbuffer(dev);
return ret; goto out;
} }
out:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
return ret; return ret;
} }
...@@ -4877,6 +4883,14 @@ int i915_gem_init(struct drm_device *dev) ...@@ -4877,6 +4883,14 @@ int i915_gem_init(struct drm_device *dev)
dev_priv->gt.stop_ring = intel_logical_ring_stop; dev_priv->gt.stop_ring = intel_logical_ring_stop;
} }
/* This is just a security blanket to placate dragons.
* On some systems, we very sporadically observe that the first TLBs
* used by the CS may be stale, despite us poking the TLB reset. If
* we hold the forcewake during initialisation these problems
* just magically go away.
*/
intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
ret = i915_gem_init_userptr(dev); ret = i915_gem_init_userptr(dev);
if (ret) if (ret)
goto out_unlock; goto out_unlock;
...@@ -4903,6 +4917,7 @@ int i915_gem_init(struct drm_device *dev) ...@@ -4903,6 +4917,7 @@ int i915_gem_init(struct drm_device *dev)
} }
out_unlock: out_unlock:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return ret; return ret;
......
...@@ -9716,7 +9716,7 @@ void intel_check_page_flip(struct drm_device *dev, int pipe) ...@@ -9716,7 +9716,7 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
WARN_ON(!in_irq()); WARN_ON(!in_interrupt());
if (crtc == NULL) if (crtc == NULL)
return; return;
......
...@@ -1048,8 +1048,14 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev) ...@@ -1048,8 +1048,14 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev)
/* We need to init first for ECOBUS access and then /* We need to init first for ECOBUS access and then
* determine later if we want to reinit, in case of MT access is * determine later if we want to reinit, in case of MT access is
* not working * not working. In this stage we don't know which flavour this
* ivb is, so it is better to reset also the gen6 fw registers
* before the ecobus check.
*/ */
__raw_i915_write32(dev_priv, FORCEWAKE, 0);
__raw_posting_read(dev_priv, ECOBUS);
fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER, fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER,
FORCEWAKE_MT, FORCEWAKE_MT_ACK); FORCEWAKE_MT, FORCEWAKE_MT_ACK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment