From d63413771fc9bc77e89dacecbc1bae6192444000 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Thu, 5 Nov 2015 16:39:00 -0200 Subject: lib/igt_fb: also pass the stride to igt_create_fb_with_bo_size() If the caller is going to specify a custom size, it's likely that he will also specify a custom stride. The automatic stride picked by create_bo_for_fb() is too huge for tiled buffers, so if the caller wants smaller buffers, then he'll need a smaller stride too, otherwise the Kernel will reject the addfb IOCTL due to stride * height being bigger than the size. I want to make tests/kms_frontbuffer_tracking use igt_create_fb_with_bo_size() so I can provide smaller buffers that will fit into the CFB. I'm also planning to make all frontbuffers with the same width/height/format have the same stride and size regardless of tiling method so I can exercise specific code paths. Signed-off-by: Paulo Zanoni --- lib/igt_fb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/igt_fb.h') diff --git a/lib/igt_fb.h b/lib/igt_fb.h index a07acd24..37892b50 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -72,7 +72,8 @@ enum igt_text_align { unsigned int igt_create_fb_with_bo_size(int fd, int width, int height, uint32_t format, uint64_t tiling, - struct igt_fb *fb, unsigned bo_size); + struct igt_fb *fb, unsigned bo_size, + unsigned bo_stride); unsigned int igt_create_fb(int fd, int width, int height, uint32_t format, uint64_t tiling, struct igt_fb *fb); unsigned int igt_create_color_fb(int fd, int width, int height, -- cgit v1.2.3