diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f6a615ea302..56153685d14 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1795,8 +1795,7 @@ void i915_gem_reset(struct drm_device *dev) | |||
1795 | int i; | 1795 | int i; |
1796 | 1796 | ||
1797 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->render_ring); | 1797 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->render_ring); |
1798 | if (HAS_BSD(dev)) | 1798 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->bsd_ring); |
1799 | i915_gem_reset_ring_lists(dev_priv, &dev_priv->bsd_ring); | ||
1800 | 1799 | ||
1801 | /* Remove anything from the flushing lists. The GPU cache is likely | 1800 | /* Remove anything from the flushing lists. The GPU cache is likely |
1802 | * to be lost on reset along with the data, so simply move the | 1801 | * to be lost on reset along with the data, so simply move the |
@@ -1918,8 +1917,7 @@ i915_gem_retire_requests(struct drm_device *dev) | |||
1918 | } | 1917 | } |
1919 | 1918 | ||
1920 | i915_gem_retire_requests_ring(dev, &dev_priv->render_ring); | 1919 | i915_gem_retire_requests_ring(dev, &dev_priv->render_ring); |
1921 | if (HAS_BSD(dev)) | 1920 | i915_gem_retire_requests_ring(dev, &dev_priv->bsd_ring); |
1922 | i915_gem_retire_requests_ring(dev, &dev_priv->bsd_ring); | ||
1923 | } | 1921 | } |
1924 | 1922 | ||
1925 | static void | 1923 | static void |
@@ -1942,8 +1940,7 @@ i915_gem_retire_work_handler(struct work_struct *work) | |||
1942 | 1940 | ||
1943 | if (!dev_priv->mm.suspended && | 1941 | if (!dev_priv->mm.suspended && |
1944 | (!list_empty(&dev_priv->render_ring.request_list) || | 1942 | (!list_empty(&dev_priv->render_ring.request_list) || |
1945 | (HAS_BSD(dev) && | 1943 | !list_empty(&dev_priv->bsd_ring.request_list))) |
1946 | !list_empty(&dev_priv->bsd_ring.request_list)))) | ||
1947 | queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ); | 1944 | queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ); |
1948 | mutex_unlock(&dev->struct_mutex); | 1945 | mutex_unlock(&dev->struct_mutex); |
1949 | } | 1946 | } |
@@ -2181,8 +2178,7 @@ i915_gpu_idle(struct drm_device *dev) | |||
2181 | 2178 | ||
2182 | lists_empty = (list_empty(&dev_priv->mm.flushing_list) && | 2179 | lists_empty = (list_empty(&dev_priv->mm.flushing_list) && |
2183 | list_empty(&dev_priv->render_ring.active_list) && | 2180 | list_empty(&dev_priv->render_ring.active_list) && |
2184 | (!HAS_BSD(dev) || | 2181 | list_empty(&dev_priv->bsd_ring.active_list)); |
2185 | list_empty(&dev_priv->bsd_ring.active_list))); | ||
2186 | if (lists_empty) | 2182 | if (lists_empty) |
2187 | return 0; | 2183 | return 0; |
2188 | 2184 | ||
@@ -2191,11 +2187,9 @@ i915_gpu_idle(struct drm_device *dev) | |||
2191 | if (ret) | 2187 | if (ret) |
2192 | return ret; | 2188 | return ret; |
2193 | 2189 | ||
2194 | if (HAS_BSD(dev)) { | 2190 | ret = i915_ring_idle(dev, &dev_priv->bsd_ring); |
2195 | ret = i915_ring_idle(dev, &dev_priv->bsd_ring); | 2191 | if (ret) |
2196 | if (ret) | 2192 | return ret; |
2197 | return ret; | ||
2198 | } | ||
2199 | 2193 | ||
2200 | return 0; | 2194 | return 0; |
2201 | } | 2195 | } |
@@ -4349,10 +4343,7 @@ i915_gem_idle(struct drm_device *dev) | |||
4349 | 4343 | ||
4350 | mutex_lock(&dev->struct_mutex); | 4344 | mutex_lock(&dev->struct_mutex); |
4351 | 4345 | ||
4352 | if (dev_priv->mm.suspended || | 4346 | if (dev_priv->mm.suspended) { |
4353 | (dev_priv->render_ring.gem_object == NULL) || | ||
4354 | (HAS_BSD(dev) && | ||
4355 | dev_priv->bsd_ring.gem_object == NULL)) { | ||
4356 | mutex_unlock(&dev->struct_mutex); | 4347 | mutex_unlock(&dev->struct_mutex); |
4357 | return 0; | 4348 | return 0; |
4358 | } | 4349 | } |
@@ -4491,8 +4482,7 @@ i915_gem_cleanup_ringbuffer(struct drm_device *dev) | |||
4491 | drm_i915_private_t *dev_priv = dev->dev_private; | 4482 | drm_i915_private_t *dev_priv = dev->dev_private; |
4492 | 4483 | ||
4493 | intel_cleanup_ring_buffer(dev, &dev_priv->render_ring); | 4484 | intel_cleanup_ring_buffer(dev, &dev_priv->render_ring); |
4494 | if (HAS_BSD(dev)) | 4485 | intel_cleanup_ring_buffer(dev, &dev_priv->bsd_ring); |
4495 | intel_cleanup_ring_buffer(dev, &dev_priv->bsd_ring); | ||
4496 | if (HAS_PIPE_CONTROL(dev)) | 4486 | if (HAS_PIPE_CONTROL(dev)) |
4497 | i915_gem_cleanup_pipe_control(dev); | 4487 | i915_gem_cleanup_pipe_control(dev); |
4498 | } | 4488 | } |
@@ -4522,11 +4512,11 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data, | |||
4522 | } | 4512 | } |
4523 | 4513 | ||
4524 | BUG_ON(!list_empty(&dev_priv->render_ring.active_list)); | 4514 | BUG_ON(!list_empty(&dev_priv->render_ring.active_list)); |
4525 | BUG_ON(HAS_BSD(dev) && !list_empty(&dev_priv->bsd_ring.active_list)); | 4515 | BUG_ON(!list_empty(&dev_priv->bsd_ring.active_list)); |
4526 | BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); | 4516 | BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); |
4527 | BUG_ON(!list_empty(&dev_priv->mm.inactive_list)); | 4517 | BUG_ON(!list_empty(&dev_priv->mm.inactive_list)); |
4528 | BUG_ON(!list_empty(&dev_priv->render_ring.request_list)); | 4518 | BUG_ON(!list_empty(&dev_priv->render_ring.request_list)); |
4529 | BUG_ON(HAS_BSD(dev) && !list_empty(&dev_priv->bsd_ring.request_list)); | 4519 | BUG_ON(!list_empty(&dev_priv->bsd_ring.request_list)); |
4530 | mutex_unlock(&dev->struct_mutex); | 4520 | mutex_unlock(&dev->struct_mutex); |
4531 | 4521 | ||
4532 | ret = drm_irq_install(dev); | 4522 | ret = drm_irq_install(dev); |
@@ -4582,10 +4572,8 @@ i915_gem_load(struct drm_device *dev) | |||
4582 | INIT_LIST_HEAD(&dev_priv->mm.deferred_free_list); | 4572 | INIT_LIST_HEAD(&dev_priv->mm.deferred_free_list); |
4583 | INIT_LIST_HEAD(&dev_priv->render_ring.active_list); | 4573 | INIT_LIST_HEAD(&dev_priv->render_ring.active_list); |
4584 | INIT_LIST_HEAD(&dev_priv->render_ring.request_list); | 4574 | INIT_LIST_HEAD(&dev_priv->render_ring.request_list); |
4585 | if (HAS_BSD(dev)) { | 4575 | INIT_LIST_HEAD(&dev_priv->bsd_ring.active_list); |
4586 | INIT_LIST_HEAD(&dev_priv->bsd_ring.active_list); | 4576 | INIT_LIST_HEAD(&dev_priv->bsd_ring.request_list); |
4587 | INIT_LIST_HEAD(&dev_priv->bsd_ring.request_list); | ||
4588 | } | ||
4589 | for (i = 0; i < 16; i++) | 4577 | for (i = 0; i < 16; i++) |
4590 | INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); | 4578 | INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); |
4591 | INIT_DELAYED_WORK(&dev_priv->mm.retire_work, | 4579 | INIT_DELAYED_WORK(&dev_priv->mm.retire_work, |
@@ -4848,9 +4836,8 @@ i915_gpu_is_active(struct drm_device *dev) | |||
4848 | int lists_empty; | 4836 | int lists_empty; |
4849 | 4837 | ||
4850 | lists_empty = list_empty(&dev_priv->mm.flushing_list) && | 4838 | lists_empty = list_empty(&dev_priv->mm.flushing_list) && |
4851 | list_empty(&dev_priv->render_ring.active_list); | 4839 | list_empty(&dev_priv->render_ring.active_list) && |
4852 | if (HAS_BSD(dev)) | 4840 | list_empty(&dev_priv->bsd_ring.active_list); |
4853 | lists_empty &= list_empty(&dev_priv->bsd_ring.active_list); | ||
4854 | 4841 | ||
4855 | return !lists_empty; | 4842 | return !lists_empty; |
4856 | } | 4843 | } |