[igt-dev] [PATCH i-g-t 3/4] lib/media_spin: Remove gen8lp_media_spin function

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Thu Apr 26 16:35:46 UTC 2018



On 25/04/18 06:26, Katarzyna Dec wrote:
> Gen8lp function are duplicates of Gen8 with difference in
> emit_media_objects - we cannot perform media_state_flush on CHT.
> Similar changes were done previously for gpgpu_fill and media_fill.
> 
> Signed-off-by: Katarzyna Dec <katarzyna.dec at intel.com>
> Cc: Lukasz Kalamarz <lukasz.kalamarz at intel.com>
> Cc: Antonio Argenziano <antonio.argenziano at intel.com>
> ---
>   lib/gpu_fill.c          | 24 ++----------------------
>   lib/intel_batchbuffer.c |  4 +---
>   lib/media_spin.c        | 38 --------------------------------------
>   lib/media_spin.h        |  3 ---
>   4 files changed, 3 insertions(+), 66 deletions(-)
> 
> diff --git a/lib/gpu_fill.c b/lib/gpu_fill.c
> index f5fc61bb..8dab39df 100644
> --- a/lib/gpu_fill.c
> +++ b/lib/gpu_fill.c
> @@ -642,28 +642,8 @@ gen8_emit_media_objects_spin(struct intel_batchbuffer *batch)
>   	/* inline data (xoffset, yoffset) */
>   	OUT_BATCH(0);
>   	OUT_BATCH(0);
> -	gen8_emit_media_state_flush(batch);
> -}
> -
> -void
> -gen8lp_emit_media_objects_spin(struct intel_batchbuffer *batch)
> -{
> -	OUT_BATCH(GEN8_MEDIA_OBJECT | (8 - 2));
> -
> -	/* interface descriptor offset */
> -	OUT_BATCH(0);
> -
> -	/* without indirect data */
> -	OUT_BATCH(0);
> -	OUT_BATCH(0);
> -
> -	/* scoreboard */
> -	OUT_BATCH(0);
> -	OUT_BATCH(0);
> -
> -	/* inline data (xoffset, yoffset) */
> -	OUT_BATCH(0);
> -	OUT_BATCH(0);
> +	if (AT_LEAST_GEN(batch->devid, 8) && !IS_CHERRYVIEW(batch->devid))
> +		gen8_emit_media_state_flush(batch);
>   }
>   
>   void
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index f87e6bed..ef070d1a 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -906,10 +906,8 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid)
>   
>   	if (IS_GEN9(devid))
>   		spin = gen9_media_spinfunc;
> -	else if (IS_BROADWELL(devid))
> +	else if (IS_BROADWELL(devid) || IS_CHERRYVIEW(devid))

You can use IS_GEN8(devid) here

Daniele

>   		spin = gen8_media_spinfunc;
> -	else if (IS_CHERRYVIEW(devid))
> -		spin = gen8lp_media_spinfunc;
>   
>   	return spin;
>   }
> diff --git a/lib/media_spin.c b/lib/media_spin.c
> index 16ea8483..b4414bee 100644
> --- a/lib/media_spin.c
> +++ b/lib/media_spin.c
> @@ -106,44 +106,6 @@ gen8_media_spinfunc(struct intel_batchbuffer *batch,
>   	intel_batchbuffer_reset(batch);
>   }
>   
> -void
> -gen8lp_media_spinfunc(struct intel_batchbuffer *batch,
> -		      struct igt_buf *dst, uint32_t spins)
> -{
> -	uint32_t curbe_buffer, interface_descriptor;
> -	uint32_t batch_end;
> -
> -	intel_batchbuffer_flush_with_context(batch, NULL);
> -
> -	/* setup states */
> -	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
> -
> -	curbe_buffer = gen8_spin_curbe_buffer_data(batch, spins);
> -	interface_descriptor = gen8_fill_interface_descriptor(batch, dst, spin_kernel, sizeof(spin_kernel));
> -	igt_assert(batch->ptr < &batch->buffer[4095]);
> -
> -	/* media pipeline */
> -	batch->ptr = batch->buffer;
> -	OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
> -	gen8_emit_state_base_address(batch);
> -
> -	gen8_emit_vfe_state_spin(batch);
> -
> -	gen7_emit_curbe_load(batch, curbe_buffer);
> -
> -	gen7_emit_interface_descriptor_load(batch, interface_descriptor);
> -
> -	gen8lp_emit_media_objects_spin(batch);
> -
> -	OUT_BATCH(MI_BATCH_BUFFER_END);
> -
> -	batch_end = intel_batchbuffer_align(batch, 8);
> -	igt_assert(batch_end < BATCH_STATE_SPLIT);
> -
> -	gen7_render_flush(batch, batch_end);
> -	intel_batchbuffer_reset(batch);
> -}
> -
>   void
>   gen9_media_spinfunc(struct intel_batchbuffer *batch,
>   		    struct igt_buf *dst, uint32_t spins)
> diff --git a/lib/media_spin.h b/lib/media_spin.h
> index 8bc48291..57d8c2e2 100644
> --- a/lib/media_spin.h
> +++ b/lib/media_spin.h
> @@ -30,9 +30,6 @@
>   void gen8_media_spinfunc(struct intel_batchbuffer *batch,
>   			 struct igt_buf *dst, uint32_t spins);
>   
> -void gen8lp_media_spinfunc(struct intel_batchbuffer *batch,
> -			   struct igt_buf *dst, uint32_t spins);
> -
>   void gen9_media_spinfunc(struct intel_batchbuffer *batch,
>   			 struct igt_buf *dst, uint32_t spins);
>   
> 


More information about the igt-dev mailing list