[igt-dev] [PATCH i-g-t v19 15/34] lib/igt_fb: Initialize intel_buf with same size as fb

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Tue Feb 2 09:24:24 UTC 2021


We need to have same size when intel_buf is initialized over fb
(with compression) because allocator could be called with smaller
size what could lead to relocation.

Use new intel_buf function which allows initalize with handle and size.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/igt_fb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 4b9be47eb..375d3a35f 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2174,11 +2174,11 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops,
 	bo_name = gem_flink(fd, fb->gem_handle);
 	handle = gem_open(fd, bo_name);
 
-	buf = intel_buf_create_using_handle(bops, handle,
-					    fb->width, fb->height,
-					    fb->plane_bpp[0], 0,
-					    igt_fb_mod_to_tiling(fb->modifier),
-					    compression);
+	buf = intel_buf_create_using_handle_and_size(bops, handle,
+						     fb->width, fb->height,
+						     fb->plane_bpp[0], 0,
+						     igt_fb_mod_to_tiling(fb->modifier),
+						     compression, fb->size);
 	intel_buf_set_name(buf, name);
 
 	/* Make sure we close handle on destroy path */
-- 
2.26.0



More information about the igt-dev mailing list