[i-g-t,v2,08/13] igt: fb: Clear YUV dumb buffers

Submitted by Maxime Ripard on Jan. 8, 2019, 3:19 p.m.

Details

Message ID 20190108152001.5367-8-maxime.ripard@bootlin.com
State New
Series "igt: chamelium: Test YUV buffers using the Chamelium"
Headers show

Commit Message

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

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 96d56d0e63be..263a889dbaa3 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -565,6 +565,9 @@  static int create_bo_for_fb(struct igt_fb *fb)
 	fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height,
 					     bpp, &fb->strides[0], &fb->size);
 
+	if (igt_format_is_yuv(fb->drm_format))
+		clear_yuv_buffer(fb);
+
 	return fb->gem_handle;
 }
 

Comments

Paul Kocialkowski Jan. 10, 2019, 10:27 a.m.
Hi,

On Tue, 2019-01-08 at 16:19 +0100, Maxime Ripard wrote:
> YUV dumb buffers, just like i915 GEM buffers also need to be cleared once
> allocated. Make sure it happens.

As I mentionned in the patch refactoring the function, I don't see why
it's a good thing to clear YUV buffers. Can't we just keep that for
the i915 path (assuming it had a reason to be there in the first
place)?

Cheers,

Paul

> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  lib/igt_fb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 96d56d0e63be..263a889dbaa3 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -565,6 +565,9 @@ static int create_bo_for_fb(struct igt_fb *fb)
>  	fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height,
>  					     bpp, &fb->strides[0], &fb->size);
>  
> +	if (igt_format_is_yuv(fb->drm_format))
> +		clear_yuv_buffer(fb);
> +
>  	return fb->gem_handle;
>  }
>