[PATCH i-g-t 2/2] lib: restore FLAG_SCANOUT usage for Xe

Matthew Auld matthew.auld at intel.com
Mon Dec 11 10:58:44 UTC 2023


Looks to have been accidentally removed in all the various uapi
refactoring and cleanup. Selecting SCANOUT here is needed to ensure that
WC is also selected for the cpu_caching.

Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Francois Dugast <francois.dugast at intel.com>
---
 lib/igt_draw.c | 3 ++-
 lib/igt_fb.c   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 6d0bcb997..637b9ba76 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -802,7 +802,8 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 		tmp.handle = xe_bo_create(fd, 0,
 					  ALIGN(tmp.size, xe_get_default_alignment(fd)),
 					  vram_if_possible(fd, 0),
-					  DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM);
+					  DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM |
+					  DRM_XE_GEM_CREATE_FLAG_SCANOUT);
 
 	tmp.stride = rect->w * pixel_size;
 	tmp.bpp = buf->bpp;
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 907464273..0446cefc9 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1208,7 +1208,8 @@ static int create_bo_for_fb(struct igt_fb *fb, bool prefer_sysmem)
 		} else if (is_xe_device(fd)) {
 			fb->gem_handle = xe_bo_create(fd, 0, fb->size,
 						      vram_if_possible(fd, 0),
-						      DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM);
+						      DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM |
+						      DRM_XE_GEM_CREATE_FLAG_SCANOUT);
 		} else if (is_vc4_device(fd)) {
 			fb->gem_handle = igt_vc4_create_bo(fd, fb->size);
 
-- 
2.43.0



More information about the igt-dev mailing list