[PATCH i-g-t 2/2] lib/igt_fb: Calculate fb size according to display requirement

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Jul 11 11:02:10 UTC 2024


Minimum page alignment may vary from display alignment so lets pick
maximum of those to satisfy its need.

Note for scanout Battlemage requires bo allocation in 64K contigues
pages alignment whereas normal objects might be allocated in 4K page
increments.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Matthew Auld <matthew.auld at intel.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 lib/igt_fb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ab162a5b74..030b4db84d 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -956,7 +956,9 @@ static uint64_t calc_fb_size(struct igt_fb *fb)
 	}
 
 	if (is_xe_device(fb->fd))
-		size = ALIGN(size, xe_get_default_alignment(fb->fd));
+		size = ALIGN(size, max_t(uint32_t,
+					 xe_get_default_alignment(fb->fd),
+					 xe_get_display_alignment(fb->fd)));
 
 	return size;
 }
-- 
2.34.1



More information about the igt-dev mailing list