@@ -1901,6 +1901,8 @@ struct drm_i915_private {
/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
struct {
+ int (*alloc_request)(struct intel_engine_cs *ring,
+ struct intel_context *ctx);
int (*do_execbuf)(struct i915_execbuffer_params *params,
struct drm_i915_gem_execbuffer2 *args,
struct list_head *vmas);
@@ -4855,11 +4855,13 @@ int i915_gem_init(struct drm_device *dev)
}
if (!i915.enable_execlists) {
+ dev_priv->gt.alloc_request = intel_ring_alloc_request;
dev_priv->gt.do_execbuf = i915_gem_ringbuffer_submission;
dev_priv->gt.init_rings = i915_gem_init_rings;
dev_priv->gt.cleanup_ring = intel_cleanup_ring_buffer;
dev_priv->gt.stop_ring = intel_stop_ring_buffer;
} else {
+ dev_priv->gt.alloc_request = intel_logical_ring_alloc_request;
dev_priv->gt.do_execbuf = intel_execlists_submission;
dev_priv->gt.init_rings = intel_logical_rings_init;
dev_priv->gt.cleanup_ring = intel_logical_ring_cleanup;
@@ -846,8 +846,8 @@ void intel_lr_context_unpin(struct intel_engine_cs *ring,
}
}
-static int logical_ring_alloc_request(struct intel_engine_cs *ring,
- struct intel_context *ctx)
+int intel_logical_ring_alloc_request(struct intel_engine_cs *ring,
+ struct intel_context *ctx)
{
struct drm_i915_gem_request *request;
struct drm_i915_private *dev_private = ring->dev->dev_private;
@@ -1056,7 +1056,7 @@ int intel_logical_ring_begin(struct intel_ringbuffer *ringbuf,
return ret;
/* Preallocate the olr before touching the ring */
- ret = logical_ring_alloc_request(ring, ctx);
+ ret = intel_logical_ring_alloc_request(ring, ctx);
if (ret)
return ret;
@@ -34,6 +34,8 @@
#define RING_CONTEXT_STATUS_PTR(ring) ((ring)->mmio_base+0x3a0)
/* Logical Rings */
+int __must_check intel_logical_ring_alloc_request(struct intel_engine_cs *ring,
+ struct intel_context *ctx);
void intel_logical_ring_stop(struct intel_engine_cs *ring);
void intel_logical_ring_cleanup(struct intel_engine_cs *ring);
int intel_logical_rings_init(struct drm_device *dev);
@@ -2084,8 +2084,8 @@ int intel_ring_idle(struct intel_engine_cs *ring)
return i915_wait_request(req);
}
-static int
-intel_ring_alloc_request(struct intel_engine_cs *ring)
+int
+intel_ring_alloc_request(struct intel_engine_cs *ring, struct intel_context *ctx)
{
int ret;
struct drm_i915_gem_request *request;
@@ -2150,7 +2150,7 @@ int intel_ring_begin(struct intel_engine_cs *ring,
return ret;
/* Preallocate the olr before touching the ring */
- ret = intel_ring_alloc_request(ring);
+ ret = intel_ring_alloc_request(ring, NULL);
if (ret)
return ret;
@@ -392,6 +392,8 @@ void intel_cleanup_ring_buffer(struct intel_engine_cs *ring);
int __must_check intel_ring_begin(struct intel_engine_cs *ring, int n);
int __must_check intel_ring_cacheline_align(struct intel_engine_cs *ring);
+int __must_check intel_ring_alloc_request(struct intel_engine_cs *ring,
+ struct intel_context *ctx);
static inline void intel_ring_emit(struct intel_engine_cs *ring,
u32 data)
{