[8/8] test/kms_addfb_basic: tolerate absence of 8-bit format

Submitted by Ulrich Hecht on March 15, 2018, 2:45 p.m.

Details

Message ID 1521125144-28614-9-git-send-email-ulrich.hecht+renesas@gmail.com
State New
Series "Non-Intel test suite fixes"
Headers show

Commit Message

Ulrich Hecht March 15, 2018, 2:45 p.m.
Ignores failure to add DRM_FORMAT_C8 frame buffer; some devices do not
support any 8-bit format.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 tests/kms_addfb_basic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index d1da718..db79827 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -273,8 +273,8 @@  static void size_tests(int fd)
 		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_16) == 0);
 		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_16.fb_id) == 0);
 		f.fb_id = 0;
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_8) == 0);
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_8.fb_id) == 0);
+		if (drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_8) == 0)
+			igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_8.fb_id) == 0);
 		f.fb_id = 0;
 	}
 

Comments

Daniel Vetter March 16, 2018, 8:49 a.m.
On Thu, Mar 15, 2018 at 03:45:44PM +0100, Ulrich Hecht wrote:
> Ignores failure to add DRM_FORMAT_C8 frame buffer; some devices do not
> support any 8-bit format.
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

I think the proper fix for this would be to split it out into a new
subtest, and then check that you have universal planes (all modern planes
have that) and skip the test if no plane advertises C8.
-Daniel

> ---
>  tests/kms_addfb_basic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
> index d1da718..db79827 100644
> --- a/tests/kms_addfb_basic.c
> +++ b/tests/kms_addfb_basic.c
> @@ -273,8 +273,8 @@ static void size_tests(int fd)
>  		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_16) == 0);
>  		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_16.fb_id) == 0);
>  		f.fb_id = 0;
> -		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_8) == 0);
> -		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_8.fb_id) == 0);
> +		if (drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f_8) == 0)
> +			igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f_8.fb_id) == 0);
>  		f.fb_id = 0;
>  	}
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx