summaryrefslogtreecommitdiff
path: root/lib/igt_fb.c
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-02-05 14:16:11 +0100
committerPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-02-05 14:31:03 +0100
commit1f89f1a04016cef20aa278ad05508cafdb9976f5 (patch)
tree84c662aebdc52a62d25c0c84b4045607224cfd25 /lib/igt_fb.c
parent49e44e8093d51c8ac020b441cdcca767a50db48b (diff)
lib/igt_fb: Fix merge of preliminary patches for clearing YUV
Preliminary patches for the YUV testing series were broken without subsequent patches that fix them when moving things around. The argument provided to clear_yuv_buffer should be the framebuffer, not the DRM file descriptor (fb vs fd). Also, an assert was added to clear_yuv_buffer to ensure that it's only called for YUV formats, which has to be reflected in the calling function. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r--lib/igt_fb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index d69c3fb2..5d8c187a 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -548,7 +548,9 @@ static int create_bo_for_fb(struct igt_fb *fb)
gem_set_tiling(fd, fb->gem_handle,
igt_fb_mod_to_tiling(fb->tiling),
fb->strides[0]);
- clear_yuv_buffer(fd);
+
+ if (igt_format_is_yuv(fb->drm_format))
+ clear_yuv_buffer(fb);
return fb->gem_handle;
} else {