ring->init(ring);
i915_gem_context_init(dev);
- if (dev_priv->mm.aliasing_ppgtt)
- dev_priv->mm.aliasing_ppgtt->enable(dev);
+ if (dev_priv->mm.aliasing_ppgtt) {
+ ret = dev_priv->mm.aliasing_ppgtt->enable(dev);
+ if (ret)
+ i915_gem_cleanup_aliasing_ppgtt(dev);
+ }
/*
* It would make sense to re-init all the other hw state, at
struct sg_table *st,
unsigned int pg_start,
enum i915_cache_level cache_level);
- void (*enable)(struct drm_device *dev);
+ int (*enable)(struct drm_device *dev);
void (*cleanup)(struct i915_hw_ppgtt *ppgtt);
};
* contexts before PPGTT.
*/
i915_gem_context_init(dev);
- if (dev_priv->mm.aliasing_ppgtt)
- dev_priv->mm.aliasing_ppgtt->enable(dev);
+ if (dev_priv->mm.aliasing_ppgtt) {
+ ret = dev_priv->mm.aliasing_ppgtt->enable(dev);
+ if (ret) {
+ i915_gem_cleanup_aliasing_ppgtt(dev);
+ DRM_INFO("PPGTT enable failed. This is not fatal, but unexpected\n");
+ }
+ }
return 0;
}
return pte;
}
-static void gen6_ppgtt_enable(struct drm_device *dev)
+static int gen6_ppgtt_enable(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
uint32_t pd_offset;
I915_WRITE(RING_PP_DIR_DCLV(ring), PP_DIR_DCLV_2G);
I915_WRITE(RING_PP_DIR_BASE(ring), pd_offset);
}
+ return 0;
}
/* PPGTT support for Sandybdrige/Gen6 and later */