Skip to content

Commit

Permalink
drm/i915: Remove obsolete seqno parameter from 'i915_add_request'
Browse files Browse the repository at this point in the history
There is no longer any need to retrieve a seqno value from an i915_add_request()
call. The calling code already knows which request structure is being processed
(it can only be ring->OLR). And as the request itself is now used in preference
to the basic seqno value, the latter is now redundant in this situation.

For: VIZ-4377
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Thomas Daniel <Thomas.Daniel@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
John Harrison authored and Daniel Vetter committed Dec 3, 2014
1 parent 9c65481 commit 9400ae5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2621,10 +2621,9 @@ int __must_check i915_gpu_idle(struct drm_device *dev);
int __must_check i915_gem_suspend(struct drm_device *dev);
int __i915_add_request(struct intel_engine_cs *ring,
struct drm_file *file,
struct drm_i915_gem_object *batch_obj,
u32 *seqno);
#define i915_add_request(ring, seqno) \
__i915_add_request(ring, NULL, NULL, seqno)
struct drm_i915_gem_object *batch_obj);
#define i915_add_request(ring) \
__i915_add_request(ring, NULL, NULL)
int __i915_wait_request(struct drm_i915_gem_request *req,
unsigned reset_counter,
bool interruptible,
Expand Down
7 changes: 2 additions & 5 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ i915_gem_check_olr(struct drm_i915_gem_request *req)

ret = 0;
if (req == req->ring->outstanding_lazy_request)
ret = i915_add_request(req->ring, NULL);
ret = i915_add_request(req->ring);

return ret;
}
Expand Down Expand Up @@ -2412,8 +2412,7 @@ i915_gem_get_seqno(struct drm_device *dev, u32 *seqno)

int __i915_add_request(struct intel_engine_cs *ring,
struct drm_file *file,
struct drm_i915_gem_object *obj,
u32 *out_seqno)
struct drm_i915_gem_object *obj)
{
struct drm_i915_private *dev_priv = ring->dev->dev_private;
struct drm_i915_gem_request *request;
Expand Down Expand Up @@ -2512,8 +2511,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
round_jiffies_up_relative(HZ));
intel_mark_busy(dev_priv->dev);

if (out_seqno)
*out_seqno = request->seqno;
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ i915_gem_execbuffer_retire_commands(struct drm_device *dev,
ring->gpu_caches_dirty = true;

/* Add a breadcrumb for the completion of the batch buffer */
(void)__i915_add_request(ring, file, obj, NULL);
(void)__i915_add_request(ring, file, obj);
}

static int
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_gem_render_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int i915_gem_render_state_init(struct intel_engine_cs *ring)

i915_vma_move_to_active(i915_gem_obj_to_ggtt(so.obj), ring);

ret = __i915_add_request(ring, NULL, so.obj, NULL);
ret = __i915_add_request(ring, NULL, so.obj);
/* __i915_add_request moves object to inactive if it fails */
out:
i915_gem_render_state_fini(&so);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ int intel_lr_context_render_state_init(struct intel_engine_cs *ring,

i915_vma_move_to_active(i915_gem_obj_to_ggtt(so.obj), ring);

ret = __i915_add_request(ring, file, so.obj, NULL);
ret = __i915_add_request(ring, file, so.obj);
/* intel_logical_ring_add_request moves object to inactive if it
* fails */
out:
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/intel_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay,
BUG_ON(overlay->last_flip_req);
i915_gem_request_assign(&overlay->last_flip_req,
ring->outstanding_lazy_request);
ret = i915_add_request(ring, NULL);
ret = i915_add_request(ring);
if (ret)
return ret;

Expand Down Expand Up @@ -291,7 +291,7 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
WARN_ON(overlay->last_flip_req);
i915_gem_request_assign(&overlay->last_flip_req,
ring->outstanding_lazy_request);
return i915_add_request(ring, NULL);
return i915_add_request(ring);
}

static void intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,7 @@ int intel_ring_idle(struct intel_engine_cs *ring)

/* We need to add any requests required to flush the objects and ring */
if (ring->outstanding_lazy_request) {
ret = i915_add_request(ring, NULL);
ret = i915_add_request(ring);
if (ret)
return ret;
}
Expand Down

0 comments on commit 9400ae5

Please sign in to comment.