diff options
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_uncore.c | 8 |
3 files changed, 28 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index e5daad5f75fb..5b205863b659 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2936,9 +2936,9 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file) | |||
2936 | req = obj->last_read_req; | 2936 | req = obj->last_read_req; |
2937 | 2937 | ||
2938 | /* Do this after OLR check to make sure we make forward progress polling | 2938 | /* Do this after OLR check to make sure we make forward progress polling |
2939 | * on this IOCTL with a timeout <=0 (like busy ioctl) | 2939 | * on this IOCTL with a timeout == 0 (like busy ioctl) |
2940 | */ | 2940 | */ |
2941 | if (args->timeout_ns <= 0) { | 2941 | if (args->timeout_ns == 0) { |
2942 | ret = -ETIME; | 2942 | ret = -ETIME; |
2943 | goto out; | 2943 | goto out; |
2944 | } | 2944 | } |
@@ -2948,7 +2948,8 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file) | |||
2948 | i915_gem_request_reference(req); | 2948 | i915_gem_request_reference(req); |
2949 | mutex_unlock(&dev->struct_mutex); | 2949 | mutex_unlock(&dev->struct_mutex); |
2950 | 2950 | ||
2951 | ret = __i915_wait_request(req, reset_counter, true, &args->timeout_ns, | 2951 | ret = __i915_wait_request(req, reset_counter, true, |
2952 | args->timeout_ns > 0 ? &args->timeout_ns : NULL, | ||
2952 | file->driver_priv); | 2953 | file->driver_priv); |
2953 | mutex_lock(&dev->struct_mutex); | 2954 | mutex_lock(&dev->struct_mutex); |
2954 | i915_gem_request_unreference(req); | 2955 | i915_gem_request_unreference(req); |
@@ -4792,6 +4793,9 @@ i915_gem_init_hw(struct drm_device *dev) | |||
4792 | if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) | 4793 | if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) |
4793 | return -EIO; | 4794 | return -EIO; |
4794 | 4795 | ||
4796 | /* Double layer security blanket, see i915_gem_init() */ | ||
4797 | intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); | ||
4798 | |||
4795 | if (dev_priv->ellc_size) | 4799 | if (dev_priv->ellc_size) |
4796 | I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf)); | 4800 | I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf)); |
4797 | 4801 | ||
@@ -4824,7 +4828,7 @@ i915_gem_init_hw(struct drm_device *dev) | |||
4824 | for_each_ring(ring, dev_priv, i) { | 4828 | for_each_ring(ring, dev_priv, i) { |
4825 | ret = ring->init_hw(ring); | 4829 | ret = ring->init_hw(ring); |
4826 | if (ret) | 4830 | if (ret) |
4827 | return ret; | 4831 | goto out; |
4828 | } | 4832 | } |
4829 | 4833 | ||
4830 | for (i = 0; i < NUM_L3_SLICES(dev); i++) | 4834 | for (i = 0; i < NUM_L3_SLICES(dev); i++) |
@@ -4841,9 +4845,11 @@ i915_gem_init_hw(struct drm_device *dev) | |||
4841 | DRM_ERROR("Context enable failed %d\n", ret); | 4845 | DRM_ERROR("Context enable failed %d\n", ret); |
4842 | i915_gem_cleanup_ringbuffer(dev); | 4846 | i915_gem_cleanup_ringbuffer(dev); |
4843 | 4847 | ||
4844 | return ret; | 4848 | goto out; |
4845 | } | 4849 | } |
4846 | 4850 | ||
4851 | out: | ||
4852 | intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); | ||
4847 | return ret; | 4853 | return ret; |
4848 | } | 4854 | } |
4849 | 4855 | ||
@@ -4877,6 +4883,14 @@ int i915_gem_init(struct drm_device *dev) | |||
4877 | dev_priv->gt.stop_ring = intel_logical_ring_stop; | 4883 | dev_priv->gt.stop_ring = intel_logical_ring_stop; |
4878 | } | 4884 | } |
4879 | 4885 | ||
4886 | /* This is just a security blanket to placate dragons. | ||
4887 | * On some systems, we very sporadically observe that the first TLBs | ||
4888 | * used by the CS may be stale, despite us poking the TLB reset. If | ||
4889 | * we hold the forcewake during initialisation these problems | ||
4890 | * just magically go away. | ||
4891 | */ | ||
4892 | intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); | ||
4893 | |||
4880 | ret = i915_gem_init_userptr(dev); | 4894 | ret = i915_gem_init_userptr(dev); |
4881 | if (ret) | 4895 | if (ret) |
4882 | goto out_unlock; | 4896 | goto out_unlock; |
@@ -4903,6 +4917,7 @@ int i915_gem_init(struct drm_device *dev) | |||
4903 | } | 4917 | } |
4904 | 4918 | ||
4905 | out_unlock: | 4919 | out_unlock: |
4920 | intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); | ||
4906 | mutex_unlock(&dev->struct_mutex); | 4921 | mutex_unlock(&dev->struct_mutex); |
4907 | 4922 | ||
4908 | return ret; | 4923 | return ret; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e730789b53b7..9943c20a741d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -9716,7 +9716,7 @@ void intel_check_page_flip(struct drm_device *dev, int pipe) | |||
9716 | struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; | 9716 | struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; |
9717 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 9717 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
9718 | 9718 | ||
9719 | WARN_ON(!in_irq()); | 9719 | WARN_ON(!in_interrupt()); |
9720 | 9720 | ||
9721 | if (crtc == NULL) | 9721 | if (crtc == NULL) |
9722 | return; | 9722 | return; |
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index c47a3baa53d5..4e8fb891d4ea 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c | |||
@@ -1048,8 +1048,14 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev) | |||
1048 | 1048 | ||
1049 | /* We need to init first for ECOBUS access and then | 1049 | /* We need to init first for ECOBUS access and then |
1050 | * determine later if we want to reinit, in case of MT access is | 1050 | * determine later if we want to reinit, in case of MT access is |
1051 | * not working | 1051 | * not working. In this stage we don't know which flavour this |
1052 | * ivb is, so it is better to reset also the gen6 fw registers | ||
1053 | * before the ecobus check. | ||
1052 | */ | 1054 | */ |
1055 | |||
1056 | __raw_i915_write32(dev_priv, FORCEWAKE, 0); | ||
1057 | __raw_posting_read(dev_priv, ECOBUS); | ||
1058 | |||
1053 | fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER, | 1059 | fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER, |
1054 | FORCEWAKE_MT, FORCEWAKE_MT_ACK); | 1060 | FORCEWAKE_MT, FORCEWAKE_MT_ACK); |
1055 | 1061 | ||