drm/i915: Update ppgtt_init_ring() & context_enable() to take requests
authorJohn Harrison <John.C.Harrison@Intel.com>
Fri, 29 May 2015 16:43:40 +0000 (17:43 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 23 Jun 2015 12:02:09 +0000 (14:02 +0200)
The final step in removing the OLR from i915_gem_init_hw() is to pass the newly
allocated request structure in to each step rather than passing a ring
structure. This patch updates both i915_ppgtt_init_ring() and
i915_gem_context_enable() to take request pointers.

For: VIZ-5115
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Tomas Elf <tomas.elf@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_context.c
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_gtt.h

index 75255392e1f455c135612ebe56cf3ebd2f4a5318..714caed86cdc30a72c8d04155730a2ff3e322941 100644 (file)
@@ -3040,7 +3040,7 @@ int __must_check i915_gem_context_init(struct drm_device *dev);
 void i915_gem_context_fini(struct drm_device *dev);
 void i915_gem_context_reset(struct drm_device *dev);
 int i915_gem_context_open(struct drm_device *dev, struct drm_file *file);
-int i915_gem_context_enable(struct intel_engine_cs *ring);
+int i915_gem_context_enable(struct drm_i915_gem_request *req);
 void i915_gem_context_close(struct drm_device *dev, struct drm_file *file);
 int i915_switch_context(struct intel_engine_cs *ring,
                        struct intel_context *to);
index 1872c985f8e54de7bd3735cfcabe3d8c6d395520..8fbdfc3e971c325180e4cead3e47e68271cf8d45 100644 (file)
@@ -5084,7 +5084,7 @@ i915_gem_init_hw(struct drm_device *dev)
                                i915_gem_l3_remap(ring, j);
                }
 
-               ret = i915_ppgtt_init_ring(ring);
+               ret = i915_ppgtt_init_ring(req);
                if (ret && ret != -EIO) {
                        DRM_ERROR("PPGTT enable ring #%d failed %d\n", i, ret);
                        i915_gem_request_cancel(req);
@@ -5092,7 +5092,7 @@ i915_gem_init_hw(struct drm_device *dev)
                        goto out;
                }
 
-               ret = i915_gem_context_enable(ring);
+               ret = i915_gem_context_enable(req);
                if (ret && ret != -EIO) {
                        DRM_ERROR("Context enable ring #%d failed %d\n", i, ret);
                        i915_gem_request_cancel(req);
index 9687d00c4b920d64773e00a0c43fda9bd7003765..4514d5aa5a93302451bfdac44ca885042e6bc503 100644 (file)
@@ -409,8 +409,9 @@ void i915_gem_context_fini(struct drm_device *dev)
        i915_gem_context_unreference(dctx);
 }
 
-int i915_gem_context_enable(struct intel_engine_cs *ring)
+int i915_gem_context_enable(struct drm_i915_gem_request *req)
 {
+       struct intel_engine_cs *ring = req->ring;
        int ret;
 
        if (i915.enable_execlists) {
index f8ecea22748a9b6cebf5048b017bfc597e64b9c2..81ffd70c335e7a99ec4b9db56ef2ce39d2de9fb0 100644 (file)
@@ -1571,9 +1571,9 @@ int i915_ppgtt_init_hw(struct drm_device *dev)
        return 0;
 }
 
-int i915_ppgtt_init_ring(struct intel_engine_cs *ring)
+int i915_ppgtt_init_ring(struct drm_i915_gem_request *req)
 {
-       struct drm_i915_private *dev_priv = ring->dev->dev_private;
+       struct drm_i915_private *dev_priv = req->ring->dev->dev_private;
        struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
 
        if (i915.enable_execlists)
@@ -1582,7 +1582,7 @@ int i915_ppgtt_init_ring(struct intel_engine_cs *ring)
        if (!ppgtt)
                return 0;
 
-       return ppgtt->switch_mm(ppgtt, ring);
+       return ppgtt->switch_mm(ppgtt, req->ring);
 }
 
 struct i915_hw_ppgtt *
index 0caa9ebb615b0f5339c7a1e3270015f1cded5f68..75dfa05d610dcb26fd0172ad1e9d62bc7abe3c2b 100644 (file)
@@ -475,7 +475,7 @@ void i915_global_gtt_cleanup(struct drm_device *dev);
 
 int i915_ppgtt_init(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt);
 int i915_ppgtt_init_hw(struct drm_device *dev);
-int i915_ppgtt_init_ring(struct intel_engine_cs *ring);
+int i915_ppgtt_init_ring(struct drm_i915_gem_request *req);
 void i915_ppgtt_release(struct kref *kref);
 struct i915_hw_ppgtt *i915_ppgtt_create(struct drm_device *dev,
                                        struct drm_i915_file_private *fpriv);