summaryrefslogtreecommitdiff
path: root/lib/igt_fb.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-08-18 13:56:18 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-08-18 14:09:03 +0100
commitd28050605d0d8a4757c2ab3239a50de4f4557241 (patch)
treeeb742dfe596b3f800f24c20c78ca51d50cfe45e5 /lib/igt_fb.c
parent39b019dda75b069273ec00689667344627de97c0 (diff)
lib: Preallocate framebuffers
So for reasons unfathomable CRC appear to be miscalculated when the plane is not in the mappable aperture. Worrisome, but for now preallocate space in the mappable region for the new framebuffer and design some specific tests to explore the issue further. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r--lib/igt_fb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 61205f34..47472f43 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -203,10 +203,16 @@ static int create_bo_for_fb(int fd, int width, int height, uint32_t format,
*is_dumb = false;
if (is_i915_device(fd)) {
+ uint32_t *ptr;
bo = gem_create(fd, size);
gem_set_tiling(fd, bo, tiling, stride);
+ /* Ensure the framebuffer is preallocated */
+ ptr = gem_mmap__gtt(fd, bo, size, PROT_READ);
+ igt_assert(*ptr == 0);
+ munmap(ptr, size);
+
if (size_ret)
*size_ret = size;