aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-07-24 19:16:28 -0400
committerDave Airlie <airlied@redhat.com>2014-07-24 19:16:28 -0400
commit9d6ed3c695ddf66f7ff89565d843d95c420046d0 (patch)
treedba6c06e2966e28c948e22d6882babb365bd389e /drivers/gpu
parentec8a362f2e6e380e7a1f66a6c9a7f6c237ab3520 (diff)
parenteedd10f45bdcb2a5b2afa35f845e080c3bc984f2 (diff)
Merge tag 'drm-intel-fixes-2014-07-24' of git://anongit.freedesktop.org/drm-intel into drm-fixes
This time in time! Just 32bit-pae fix from Hugh, semaphores fun from Chris and a fix for runtime pm cherry-picked from next. Paulo is still working on a fix for runtime pm when X does cursor fun when the display is off, but that one isn't ready yet. * tag 'drm-intel-fixes-2014-07-24' of git://anongit.freedesktop.org/drm-intel: drm/i915: Simplify i915_gem_release_all_mmaps() drm/i915: fix freeze with blank screen booting highmem drm/i915: Reorder the semaphore deadlock check, again
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c25
-rw-r--r--drivers/gpu/drm/i915/i915_gem_render_state.c4
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c11
3 files changed, 15 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f36126383d26..d893e4da5dce 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1616,22 +1616,6 @@ out:
1616 return ret; 1616 return ret;
1617} 1617}
1618 1618
1619void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv)
1620{
1621 struct i915_vma *vma;
1622
1623 /*
1624 * Only the global gtt is relevant for gtt memory mappings, so restrict
1625 * list traversal to objects bound into the global address space. Note
1626 * that the active list should be empty, but better safe than sorry.
1627 */
1628 WARN_ON(!list_empty(&dev_priv->gtt.base.active_list));
1629 list_for_each_entry(vma, &dev_priv->gtt.base.active_list, mm_list)
1630 i915_gem_release_mmap(vma->obj);
1631 list_for_each_entry(vma, &dev_priv->gtt.base.inactive_list, mm_list)
1632 i915_gem_release_mmap(vma->obj);
1633}
1634
1635/** 1619/**
1636 * i915_gem_release_mmap - remove physical page mappings 1620 * i915_gem_release_mmap - remove physical page mappings
1637 * @obj: obj in question 1621 * @obj: obj in question
@@ -1657,6 +1641,15 @@ i915_gem_release_mmap(struct drm_i915_gem_object *obj)
1657 obj->fault_mappable = false; 1641 obj->fault_mappable = false;
1658} 1642}
1659 1643
1644void
1645i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv)
1646{
1647 struct drm_i915_gem_object *obj;
1648
1649 list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list)
1650 i915_gem_release_mmap(obj);
1651}
1652
1660uint32_t 1653uint32_t
1661i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode) 1654i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode)
1662{ 1655{
diff --git a/drivers/gpu/drm/i915/i915_gem_render_state.c b/drivers/gpu/drm/i915/i915_gem_render_state.c
index 3521f998a178..34894b573064 100644
--- a/drivers/gpu/drm/i915/i915_gem_render_state.c
+++ b/drivers/gpu/drm/i915/i915_gem_render_state.c
@@ -31,7 +31,7 @@
31struct i915_render_state { 31struct i915_render_state {
32 struct drm_i915_gem_object *obj; 32 struct drm_i915_gem_object *obj;
33 unsigned long ggtt_offset; 33 unsigned long ggtt_offset;
34 void *batch; 34 u32 *batch;
35 u32 size; 35 u32 size;
36 u32 len; 36 u32 len;
37}; 37};
@@ -80,7 +80,7 @@ free:
80 80
81static void render_state_free(struct i915_render_state *so) 81static void render_state_free(struct i915_render_state *so)
82{ 82{
83 kunmap(so->batch); 83 kunmap(kmap_to_page(so->batch));
84 i915_gem_object_ggtt_unpin(so->obj); 84 i915_gem_object_ggtt_unpin(so->obj);
85 drm_gem_object_unreference(&so->obj->base); 85 drm_gem_object_unreference(&so->obj->base);
86 kfree(so); 86 kfree(so);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 267f069765ad..c05c84f3f091 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2845,7 +2845,7 @@ static int semaphore_passed(struct intel_engine_cs *ring)
2845{ 2845{
2846 struct drm_i915_private *dev_priv = ring->dev->dev_private; 2846 struct drm_i915_private *dev_priv = ring->dev->dev_private;
2847 struct intel_engine_cs *signaller; 2847 struct intel_engine_cs *signaller;
2848 u32 seqno, ctl; 2848 u32 seqno;
2849 2849
2850 ring->hangcheck.deadlock++; 2850 ring->hangcheck.deadlock++;
2851 2851
@@ -2857,15 +2857,12 @@ static int semaphore_passed(struct intel_engine_cs *ring)
2857 if (signaller->hangcheck.deadlock >= I915_NUM_RINGS) 2857 if (signaller->hangcheck.deadlock >= I915_NUM_RINGS)
2858 return -1; 2858 return -1;
2859 2859
2860 /* cursory check for an unkickable deadlock */
2861 ctl = I915_READ_CTL(signaller);
2862 if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0)
2863 return -1;
2864
2865 if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno)) 2860 if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno))
2866 return 1; 2861 return 1;
2867 2862
2868 if (signaller->hangcheck.deadlock) 2863 /* cursory check for an unkickable deadlock */
2864 if (I915_READ_CTL(signaller) & RING_WAIT_SEMAPHORE &&
2865 semaphore_passed(signaller) < 0)
2869 return -1; 2866 return -1;
2870 2867
2871 return 0; 2868 return 0;