[i-g-t,v6,05/10] igt: fb: Clear YUV dumb buffers

Submitted by Maxime Ripard on Feb. 8, 2019, 1:18 p.m.

Details

Message ID 20190208131901.1400-6-maxime.ripard@bootlin.com
State New
Headers show
Series "igt: chamelium: Test YUV buffers using the Chamelium" ( rev: 8 ) in IGT

Not browsing as part of any series.

Commit Message

Maxime Ripard Feb. 8, 2019, 1:18 p.m.
YUV dumb buffers, just like i915 GEM buffers also need to be cleared once
allocated. Make sure it happens.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index dea390b062de..6fe0d0847aef 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -596,6 +596,9 @@  static int create_bo_for_fb(struct igt_fb *fb)
 	fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height,
 					     bpp, strides, &fb->size);
 
+	if (igt_format_is_yuv(fb->drm_format))
+		clear_yuv_buffer(fb);
+
 	return fb->gem_handle;
 }