@@ -533,7 +533,7 @@ struct i915_hw_ppgtt {
gen6_gtt_pte_t (*pte_encode)(dma_addr_t addr,
enum i915_cache_level level);
- int (*enable)(struct drm_device *dev);
+ int (*enable)(struct i915_hw_ppgtt *ppgtt);
void (*cleanup)(struct i915_hw_ppgtt *ppgtt);
};
@@ -4328,6 +4328,7 @@ int
i915_gem_init_hw(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
+ struct i915_hw_ppgtt *ppgtt;
int ret;
if (INTEL_INFO(dev)->gen < 6 && !intel_enable_gtt())
@@ -4361,7 +4362,8 @@ i915_gem_init_hw(struct drm_device *dev)
if (ret || !dev_priv->gtt.aliasing_ppgtt)
goto disable_ctx_out;
- ret = dev_priv->gtt.aliasing_ppgtt->enable(dev);
+ ppgtt = dev_priv->gtt.aliasing_ppgtt;
+ ret = ppgtt->enable(ppgtt);
if (ret)
goto disable_ctx_out;
@@ -122,12 +122,12 @@ static void gen6_write_pdes(struct i915_hw_ppgtt *ppgtt)
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;
uint32_t pd_offset;
struct intel_ring_buffer *ring;
- struct i915_hw_ppgtt *ppgtt = dev_priv->gtt.aliasing_ppgtt;
int i;
BUG_ON(ppgtt->pd_offset & 0x3f);
At one time I was planning to call enable for all PPGTTs. I dropped this, however I kept around this change because it looks better to me. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> --- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem.c | 4 +++- drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-)