summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_render_state.c
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2014-05-21 19:01:06 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-05-22 14:10:37 +0200
commit46470fc932ac8a0e8317a220b3f4ea4ed903338e (patch)
tree08b7023d82f37eda8865c7276f4ace1d24b8d191 /drivers/gpu/drm/i915/i915_gem_render_state.c
parentd3eaf8843da6c3aa0d6b5b480820382c7bd1a89d (diff)
drm/i915: Add null state batch to active list
for proper refcounting to take place as we use i915_add_request() for it. i915_add_request() also takes the context for the request from ring->last_context so move the null state batch submission after the ring context has been set. v2: we need to check for correct ring now (Ville Syrjälä) v3: no need to expose i915_gem_move_object_to_active (Chris Wilson) v4: cargoculted vma/active/inactive error handling removed (Chris Wilson) Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_render_state.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_render_state.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_render_state.c b/drivers/gpu/drm/i915/i915_gem_render_state.c
index 392aa7b34ee9..cfbf6fc02a9e 100644
--- a/drivers/gpu/drm/i915/i915_gem_render_state.c
+++ b/drivers/gpu/drm/i915/i915_gem_render_state.c
@@ -164,9 +164,11 @@ int i915_gem_render_state_init(struct intel_ring_buffer *ring)
const int gen = INTEL_INFO(ring->dev)->gen;
struct i915_render_state *so;
const struct intel_renderstate_rodata *rodata;
- u32 seqno;
int ret;
+ if (WARN_ON(ring->id != RCS))
+ return -ENOENT;
+
rodata = render_state_get_rodata(ring->dev, gen);
if (rodata == NULL)
return 0;
@@ -186,8 +188,10 @@ int i915_gem_render_state_init(struct intel_ring_buffer *ring)
if (ret)
goto out;
- ret = i915_add_request(ring, &seqno);
+ i915_vma_move_to_active(i915_gem_obj_to_ggtt(so->obj), ring);
+ ret = __i915_add_request(ring, NULL, so->obj, NULL);
+ /* __i915_add_request moves object to inactive if it fails */
out:
render_state_free(so);
return ret;