[igt-dev] [PATCH i-g-t v2 3/3] lib/igt_draw: Use intel_display_ver() for drawing with blits

Andrzej Hajda andrzej.hajda at intel.com
Wed Jun 21 10:43:45 UTC 2023



On 21.06.2023 11:00, Swati Sharma wrote:
> From: Matt Roper <matthew.d.roper at intel.com>
>
> Display code should check the display version of the platform
> rather than the graphics version; on some platforms these
> versions won't be the same.
>
> v2: -fixed subject (Kamil)
>
> Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>

Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>

Regards
Andrzej
> ---
>   lib/igt_draw.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> index 6f362994..1f814bfc 100644
> --- a/lib/igt_draw.c
> +++ b/lib/igt_draw.c
> @@ -674,7 +674,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
>   	struct intel_buf *dst;
>   	int blt_cmd_len, blt_cmd_tiling, blt_cmd_depth;
>   	uint32_t devid = intel_get_drm_devid(fd);
> -	int gen = intel_gen(devid);
> +	int ver = intel_display_ver(devid);
>   	int pitch;
>   
>   	if (tiling)
> @@ -751,9 +751,9 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
>   			igt_assert(false);
>   		}
>   
> -		blt_cmd_len = (gen >= 8) ?  0x5 : 0x4;
> +		blt_cmd_len = (ver >= 8) ?  0x5 : 0x4;
>   		blt_cmd_tiling = (tiling) ? XY_COLOR_BLT_TILED : 0;
> -		pitch = (gen >= 4 && tiling) ? buf->stride / 4 : buf->stride;
> +		pitch = (ver >= 4 && tiling) ? buf->stride / 4 : buf->stride;
>   
>   		switch_blt_tiling(ibb, tiling, true);
>   



More information about the igt-dev mailing list