aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1f441f5c2405..4c65c639f772 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1472,16 +1472,19 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
1472 list_move_tail(&obj->ring_list, &ring->active_list); 1472 list_move_tail(&obj->ring_list, &ring->active_list);
1473 1473
1474 obj->last_rendering_seqno = seqno; 1474 obj->last_rendering_seqno = seqno;
1475 if (obj->fenced_gpu_access) {
1476 struct drm_i915_fence_reg *reg;
1477
1478 BUG_ON(obj->fence_reg == I915_FENCE_REG_NONE);
1479 1475
1476 if (obj->fenced_gpu_access) {
1480 obj->last_fenced_seqno = seqno; 1477 obj->last_fenced_seqno = seqno;
1481 obj->last_fenced_ring = ring; 1478 obj->last_fenced_ring = ring;
1482 1479
1483 reg = &dev_priv->fence_regs[obj->fence_reg]; 1480 /* Bump MRU to take account of the delayed flush */
1484 list_move_tail(&reg->lru_list, &dev_priv->mm.fence_list); 1481 if (obj->fence_reg != I915_FENCE_REG_NONE) {
1482 struct drm_i915_fence_reg *reg;
1483
1484 reg = &dev_priv->fence_regs[obj->fence_reg];
1485 list_move_tail(&reg->lru_list,
1486 &dev_priv->mm.fence_list);
1487 }
1485 } 1488 }
1486} 1489}
1487 1490
@@ -3754,12 +3757,32 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
3754 drm_i915_private_t *dev_priv = dev->dev_private; 3757 drm_i915_private_t *dev_priv = dev->dev_private;
3755 uint32_t pd_offset; 3758 uint32_t pd_offset;
3756 struct intel_ring_buffer *ring; 3759 struct intel_ring_buffer *ring;
3760 struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
3761 uint32_t __iomem *pd_addr;
3762 uint32_t pd_entry;
3757 int i; 3763 int i;
3758 3764
3759 if (!dev_priv->mm.aliasing_ppgtt) 3765 if (!dev_priv->mm.aliasing_ppgtt)
3760 return; 3766 return;
3761 3767
3762 pd_offset = dev_priv->mm.aliasing_ppgtt->pd_offset; 3768
3769 pd_addr = dev_priv->mm.gtt->gtt + ppgtt->pd_offset/sizeof(uint32_t);
3770 for (i = 0; i < ppgtt->num_pd_entries; i++) {
3771 dma_addr_t pt_addr;
3772
3773 if (dev_priv->mm.gtt->needs_dmar)
3774 pt_addr = ppgtt->pt_dma_addr[i];
3775 else
3776 pt_addr = page_to_phys(ppgtt->pt_pages[i]);
3777
3778 pd_entry = GEN6_PDE_ADDR_ENCODE(pt_addr);
3779 pd_entry |= GEN6_PDE_VALID;
3780
3781 writel(pd_entry, pd_addr + i);
3782 }
3783 readl(pd_addr);
3784
3785 pd_offset = ppgtt->pd_offset;
3763 pd_offset /= 64; /* in cachelines, */ 3786 pd_offset /= 64; /* in cachelines, */
3764 pd_offset <<= 16; 3787 pd_offset <<= 16;
3765 3788