[igt-dev] [PATCH i-g-t v4 14/23] lib/igt_fb: Initialize intel_buf with same size as fb

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Oct 26 13:42:40 UTC 2020


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 43f8c475..207a8393 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2172,11 +2172,11 @@ static struct intel_buf *create_buf(struct fb_blit_upload *blit,
 	bo_name = gem_flink(blit->fd, fb->gem_handle);
 	handle = gem_open(blit->fd, bo_name);
 
-	buf = intel_buf_create_using_handle(blit->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(blit->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