[Intel-gfx] [PATCH 066/190] drm/i915: Simplify request_alloc by returning the allocated request

Dave Gordon david.s.gordon at intel.com
Tue Jan 12 09:11:05 PST 2016


On 11/01/16 09:17, Chris Wilson wrote:
> If is simpler and leads to more readable code through the callstack if
> the allocation returns the allocated struct through the return value.
>
> The importance of this is that it no longer looks like we accidentally
> allocate requests as side-effect of calling certain functions.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_drv.h            |  3 +-
>   drivers/gpu/drm/i915/i915_gem.c            | 82 ++++++++++--------------------
>   drivers/gpu/drm/i915/i915_gem_execbuffer.c |  8 +--
>   drivers/gpu/drm/i915/i915_gem_request.c    | 22 +++-----
>   drivers/gpu/drm/i915/i915_gem_request.h    |  6 +--
>   drivers/gpu/drm/i915/i915_trace.h          | 15 +++---
>   drivers/gpu/drm/i915/intel_display.c       | 25 +++++----
>   drivers/gpu/drm/i915/intel_lrc.c           |  6 +--
>   drivers/gpu/drm/i915/intel_overlay.c       | 24 ++++-----
>   9 files changed, 77 insertions(+), 114 deletions(-)

I would quite like to have reviewed this, since I think simplifying 
{i915_gem_}request_alloc() is a really good idea, and have submitted a 
patch to do just that. But I can't review it because it doesn't apply, 
even if I start from nightly and try to apply the whole series of 190 
patches (it fails at patch 018/190, Separate out the seqno-barrier from 
engine->get_seqno).

Actually, it looks like the request_alloc() changes *would* apply 
cleanly without any of the rest of the pile of patches, except that this 
patch does more than it admits; in addition to the improvement to 
request_alloc() it also rewrites i915_gem_object_sync(), and *those* 
changes don't apply to nightly.

So this should be two separate patches, one to improve request_alloc() 
and then a separate one to update i915_gem_object_sync().

.Dave.



More information about the Intel-gfx mailing list