Commit a3d67d23 authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter

drm/i915: PPGTT vfuncs should take a ppgtt argument

Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a45d0f6a
...@@ -671,7 +671,8 @@ struct i915_hw_ppgtt { ...@@ -671,7 +671,8 @@ struct i915_hw_ppgtt {
dma_addr_t *pt_dma_addr; dma_addr_t *pt_dma_addr;
dma_addr_t *gen8_pt_dma_addr[4]; dma_addr_t *gen8_pt_dma_addr[4];
}; };
int (*enable)(struct drm_device *dev);
int (*enable)(struct i915_hw_ppgtt *ppgtt);
}; };
struct i915_ctx_hang_stats { struct i915_ctx_hang_stats {
......
...@@ -4404,6 +4404,7 @@ int ...@@ -4404,6 +4404,7 @@ int
i915_gem_init_hw(struct drm_device *dev) i915_gem_init_hw(struct drm_device *dev)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
struct i915_hw_ppgtt *ppgtt;
int ret, i; int ret, i;
if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt()) if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt())
...@@ -4446,7 +4447,8 @@ i915_gem_init_hw(struct drm_device *dev) ...@@ -4446,7 +4447,8 @@ i915_gem_init_hw(struct drm_device *dev)
} }
if (dev_priv->mm.aliasing_ppgtt) { if (dev_priv->mm.aliasing_ppgtt) {
ret = dev_priv->mm.aliasing_ppgtt->enable(dev); ppgtt = dev_priv->mm.aliasing_ppgtt;
ret = ppgtt->enable(ppgtt);
if (ret) { if (ret) {
i915_gem_cleanup_aliasing_ppgtt(dev); i915_gem_cleanup_aliasing_ppgtt(dev);
DRM_INFO("PPGTT enable failed. This is not fatal, but unexpected\n"); DRM_INFO("PPGTT enable failed. This is not fatal, but unexpected\n");
......
...@@ -230,11 +230,11 @@ static int gen8_write_pdp(struct intel_ring_buffer *ring, unsigned entry, ...@@ -230,11 +230,11 @@ static int gen8_write_pdp(struct intel_ring_buffer *ring, unsigned entry,
return 0; return 0;
} }
static int gen8_ppgtt_enable(struct drm_device *dev) static int gen8_ppgtt_enable(struct i915_hw_ppgtt *ppgtt)
{ {
struct drm_device *dev = ppgtt->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring; struct intel_ring_buffer *ring;
struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
int i, j, ret; int i, j, ret;
/* bit of a hack to find the actual last used pd */ /* bit of a hack to find the actual last used pd */
...@@ -491,12 +491,12 @@ static void gen6_write_pdes(struct i915_hw_ppgtt *ppgtt) ...@@ -491,12 +491,12 @@ static void gen6_write_pdes(struct i915_hw_ppgtt *ppgtt)
readl(pd_addr); readl(pd_addr);
} }
static int gen6_ppgtt_enable(struct drm_device *dev) static int gen6_ppgtt_enable(struct i915_hw_ppgtt *ppgtt)
{ {
struct drm_device *dev = ppgtt->base.dev;
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
uint32_t pd_offset; uint32_t pd_offset;
struct intel_ring_buffer *ring; struct intel_ring_buffer *ring;
struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
int i; int i;
BUG_ON(ppgtt->pd_offset & 0x3f); BUG_ON(ppgtt->pd_offset & 0x3f);
......
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