[igt-dev] [PATCH i-g-t v32 19/39] lib/igt_fb: Initialize intel_buf with same size as fb
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Mon Apr 12 11:17:48 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 initialize 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>
Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
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 4ded7e78a..5c1670410 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2253,11 +2253,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