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

Swati Sharma swati2.sharma at intel.com
Tue Jun 20 14:57:37 UTC 2023


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>
---
 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);
 
-- 
2.25.1



More information about the igt-dev mailing list