[Intel-gfx] [PATCH] drm/i915: intel_ring.engine is unused

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Mon Apr 3 08:27:31 UTC 2017


On la, 2017-04-01 at 11:01 +0100, Chris Wilson wrote:
> Or rather it is used only by intel_ring_pin() to extract the
> drm_i915_private which we can easily pass in. As this is a relatively
> rare operation, save the space in the struct, and as such it is even
> break even in the extra code for passing around the parameter:
> 
> add/remove: 0/0 grow/shrink: 2/3 up/down: 15/-15 (0)
> function                                     old     new   delta
> intel_init_ring_buffer                       906     918     +12
> execlists_context_pin                       1308    1311      +3
> mock_engine                                  407     403      -4
> intel_engine_create_ring                     367     363      -4
> intel_ring_pin                               326     319      -7
> Total: Before=1261794, After=1261794, chg +0.00%
> 
> v2: Reorder intel_init_ring_buffer to keep the ring setup together:
> 
> add/remove: 0/0 grow/shrink: 2/3 up/down: 9/-15 (-6)
> function                                     old     new   delta
> intel_init_ring_buffer                       906     912      +6
> execlists_context_pin                       1308    1311      +3
> mock_engine                                  407     403      -4
> intel_engine_create_ring                     367     363      -4
> intel_ring_pin                               326     319      -7
> Total: Before=1261794, After=1261788, chg -0.00%
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>
 
> @@ -1493,13 +1491,7 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine)
>  	if (ret)
>  		goto error;
>  
> -	ring = intel_engine_create_ring(engine, 32 * PAGE_SIZE);
> -	if (IS_ERR(ring)) {
> -		ret = PTR_ERR(ring);
> -		goto error;
> -	}
> -
> -	if (HWS_NEEDS_PHYSICAL(dev_priv)) {
> +	if (HWS_NEEDS_PHYSICAL(engine->i915)) {
>  		WARN_ON(engine->id != RCS);
>  		ret = init_phys_status_page(engine);
>  		if (ret)

Onion teardown would be great while you move the code around.

With that,

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list