[igt-dev] [PATCH 1/2] tests/intel/i915_pipe_stress: Fix create_buf function

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Sep 11 13:25:46 UTC 2023


On Mon, Sep 11, 2023 at 03:22:55PM +0300, Stanislav Lisovskiy wrote:
> create_buf currently does wrong assumption what it gets
> width in bytes, however reality is that it gets width
> in pixels, so "width/4" must be "width * 4" for bpp 32.
> 
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>
> ---
>  tests/intel/i915_pipe_stress.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/intel/i915_pipe_stress.c b/tests/intel/i915_pipe_stress.c
> index 9ceb056a09..007d3a1159 100644
> --- a/tests/intel/i915_pipe_stress.c
> +++ b/tests/intel/i915_pipe_stress.c
> @@ -201,9 +201,9 @@ create_buf(struct data *data, int width, int height, uint32_t region)
>  	 * Legacy code uses 32 bpp after buffer creation.
>  	 * Let's do the same due to keep shader intact.
>  	 */
> -	handle = gem_create_in_memory_regions(data->drm_fd, width * height, region);
> +	handle = gem_create_in_memory_regions(data->drm_fd, width * 4 * height, region);

If screen display is 32bpp width * 4 * height is ok.

>  	intel_buf_init_using_handle(data->bops, handle, buf,
> -				    width/4, height, 32, 0,
> +				    width * 4, height, 32, 0,

This one is too big, should be:

width, height, 32

--
Zbigniew

>  				    I915_TILING_NONE, 0);
>  
>  	return buf;
> -- 
> 2.37.3
> 


More information about the igt-dev mailing list