@@ -1306,16 +1306,21 @@ i915_dispatch_execbuffer(struct intel_engine *ring,
static void cleanup_status_page(struct intel_engine *ring)
{
+ struct drm_i915_private *dev_priv = ring->dev->dev_private;
struct drm_i915_gem_object *obj;
obj = ring->status_page.obj;
if (obj == NULL)
return;
+ ring->status_page.obj = NULL;
kunmap(sg_page(obj->pages->sgl));
+
+ if (dev_priv->lrc_enabled)
+ return;
+
i915_gem_object_ggtt_unpin(obj);
drm_gem_object_unreference(&obj->base);
- ring->status_page.obj = NULL;
}
static int init_status_page(struct intel_engine *ring)
@@ -1444,7 +1449,14 @@ static int intel_init_ring(struct drm_device *dev,
init_waitqueue_head(&ring->irq_queue);
- if (I915_NEED_GFX_HWS(dev)) {
+ if (dev_priv->lrc_enabled) {
+ obj = ring->default_context->obj;
+ ring->status_page.gfx_addr = i915_gem_obj_ggtt_offset(obj);
+ ring->status_page.page_addr = kmap(sg_page(obj->pages->sgl));
+ if (ring->status_page.page_addr == NULL)
+ return -ENOMEM;
+ ring->status_page.obj = obj;
+ } else if (I915_NEED_GFX_HWS(dev)) {
ret = init_status_page(ring);
if (ret)
return ret;