public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: "Maíra Canal" <mcanal@igalia.com>
Cc: igt-dev@lists.freedesktop.org, Maxime Ripard <maxime@cerno.tech>,
	Emma Anholt <emma@anholt.net>
Subject: Re: [igt-dev] [PATCH i-g-t v3 4/5] tests/vc4: Skip VC4 tests if they are running on BCM2711/RaspberryPi4
Date: Mon, 19 Dec 2022 11:21:35 +0200	[thread overview]
Message-ID: <Y6AtH+ipeYLubDBc@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20221216162854.294042-5-mcanal@igalia.com>

On Fri, Dec 16, 2022 at 01:28:54PM -0300, Maíra Canal wrote:
> Currently, if the VC4 tests are run on BCM2711/Raspberry Pi 4, they will
> fail with no warning. So, add igt_require to the VC4 tests to check if
> VC4 has rendering capabilities before running the tests.
> 
> In order to check if VC4 is running on BCM2711/Raspberry Pi 4, create a
> function that checks if the vc4 driver has syncobj capabilities. If not so,
> it means that the tests are being run on BCM2711/Raspberry Pi 4, as vc5
> doesn't have syncobj capabilities.
> 
> Signed-off-by: Maíra Canal <mcanal@igalia.com>

Acked-by: Petri Latvala <petri.latvala@intel.com>

> ---
>  lib/igt_vc4.c               | 12 ++++++++++++
>  lib/igt_vc4.h               |  1 +
>  tests/vc4/vc4_create_bo.c   |  1 +
>  tests/vc4/vc4_dmabuf_poll.c |  4 +++-
>  tests/vc4/vc4_label_bo.c    |  4 +++-
>  tests/vc4/vc4_tiling.c      |  4 +++-
>  tests/vc4/vc4_wait_bo.c     |  1 +
>  tests/vc4/vc4_wait_seqno.c  |  4 +++-
>  8 files changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_vc4.c b/lib/igt_vc4.c
> index 54718cee..2c86bd93 100644
> --- a/lib/igt_vc4.c
> +++ b/lib/igt_vc4.c
> @@ -59,6 +59,18 @@ bool igt_vc4_is_tiled(uint64_t modifier)
>  	}
>  }
>  
> +bool igt_vc4_is_v3d(int fd)
> +{
> +	uint64_t value;
> +
> +	/*
> +	 * vc5 doesn't have syncobj capabilities, only vc4.
> +	 */
> +	if (drmGetCap(fd, DRM_CAP_SYNCOBJ, &value))
> +		return false;
> +	return value;
> +}
> +
>  /**
>   * igt_vc4_get_cleared_bo:
>   * @fd: device file descriptor
> diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h
> index ddce90da..79a6ab7d 100644
> --- a/lib/igt_vc4.h
> +++ b/lib/igt_vc4.h
> @@ -34,6 +34,7 @@ void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
>  int igt_vc4_get_param(int fd, uint32_t param, uint64_t *val);
>  bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable);
>  bool igt_vc4_is_tiled(uint64_t modifier);
> +bool igt_vc4_is_v3d(int fd);
>  
>  void igt_vc4_set_tiling(int fd, uint32_t handle, uint64_t modifier);
>  uint64_t igt_vc4_get_tiling(int fd, uint32_t handle);
> diff --git a/tests/vc4/vc4_create_bo.c b/tests/vc4/vc4_create_bo.c
> index c4909b49..c17f25b0 100644
> --- a/tests/vc4/vc4_create_bo.c
> +++ b/tests/vc4/vc4_create_bo.c
> @@ -30,6 +30,7 @@ igt_main
>  
>  	igt_fixture {
>  		fd = drm_open_driver(DRIVER_VC4);
> +		igt_require(igt_vc4_is_v3d(fd));
>  	}
>  
>  	igt_subtest("create-bo-4096") {
> diff --git a/tests/vc4/vc4_dmabuf_poll.c b/tests/vc4/vc4_dmabuf_poll.c
> index da99964b..c76d4950 100644
> --- a/tests/vc4/vc4_dmabuf_poll.c
> +++ b/tests/vc4/vc4_dmabuf_poll.c
> @@ -59,8 +59,10 @@ igt_main
>  {
>  	int fd;
>  
> -	igt_fixture
> +	igt_fixture {
>  		fd = drm_open_driver(DRIVER_VC4);
> +		igt_require(igt_vc4_is_v3d(fd));
> +	}
>  
>  	igt_subtest("poll-write-waits-until-write-done") {
>  		poll_write_bo_test(fd, POLLOUT);
> diff --git a/tests/vc4/vc4_label_bo.c b/tests/vc4/vc4_label_bo.c
> index dd8b5f9a..252bd1ed 100644
> --- a/tests/vc4/vc4_label_bo.c
> +++ b/tests/vc4/vc4_label_bo.c
> @@ -43,8 +43,10 @@ igt_main
>  {
>  	int fd;
>  
> -	igt_fixture
> +	igt_fixture {
>  		fd = drm_open_driver(DRIVER_VC4);
> +		igt_require(igt_vc4_is_v3d(fd));
> +	}
>  
>  	igt_subtest("set-label") {
>  		int handle = igt_vc4_create_bo(fd, PAGE_SIZE);
> diff --git a/tests/vc4/vc4_tiling.c b/tests/vc4/vc4_tiling.c
> index 372b1fed..f5bf31f5 100644
> --- a/tests/vc4/vc4_tiling.c
> +++ b/tests/vc4/vc4_tiling.c
> @@ -28,8 +28,10 @@ igt_main
>  {
>  	int fd;
>  
> -	igt_fixture
> +	igt_fixture {
>  		fd = drm_open_driver(DRIVER_VC4);
> +		igt_require(igt_vc4_is_v3d(fd));
> +	}
>  
>  	igt_subtest("get-bad-handle") {
>  		struct drm_vc4_get_tiling get = {
> diff --git a/tests/vc4/vc4_wait_bo.c b/tests/vc4/vc4_wait_bo.c
> index 386642b9..c88a4ac4 100644
> --- a/tests/vc4/vc4_wait_bo.c
> +++ b/tests/vc4/vc4_wait_bo.c
> @@ -64,6 +64,7 @@ igt_main
>  
>  	igt_fixture {
>  		fd = drm_open_driver(DRIVER_VC4);
> +		igt_require(igt_vc4_is_v3d(fd));
>  		bo_handle = igt_vc4_create_bo(fd, PAGE_SIZE);
>  	}
>  
> diff --git a/tests/vc4/vc4_wait_seqno.c b/tests/vc4/vc4_wait_seqno.c
> index 61485bbf..78984fa3 100644
> --- a/tests/vc4/vc4_wait_seqno.c
> +++ b/tests/vc4/vc4_wait_seqno.c
> @@ -28,8 +28,10 @@ igt_main
>  {
>  	int fd;
>  
> -	igt_fixture
> +	igt_fixture {
>  		fd = drm_open_driver(DRIVER_VC4);
> +		igt_require(igt_vc4_is_v3d(fd));
> +	}
>  
>  	/* A 64-bit seqno should never hit the maximum value over the
>  	 * lifetime of the system.  (A submit per 1000 cycles at 1Ghz
> -- 
> 2.38.1
> 

  reply	other threads:[~2022-12-19  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 16:28 [igt-dev] [PATCH i-g-t v3 0/5] VC4 IGT Tests Updates Maíra Canal
2022-12-16 16:28 ` [igt-dev] [PATCH i-g-t v3 1/5] tests/vc4: Move VC4 tests to their own folder Maíra Canal
2022-12-16 16:28 ` [igt-dev] [PATCH i-g-t v3 2/5] tests/vc4: Remove unused or redundant includes Maíra Canal
2022-12-16 16:28 ` [igt-dev] [PATCH i-g-t v3 3/5] lib/igt_vc4: Add PAGE_SIZE macro to VC4 Maíra Canal
2022-12-16 16:28 ` [igt-dev] [PATCH i-g-t v3 4/5] tests/vc4: Skip VC4 tests if they are running on BCM2711/RaspberryPi4 Maíra Canal
2022-12-19  9:21   ` Petri Latvala [this message]
2022-12-16 16:28 ` [igt-dev] [PATCH i-g-t v3 5/5] tests/vc4_perfmon: Create test for VC4's Perfmon IOCTLs Maíra Canal
2022-12-18 21:39 ` [igt-dev] ✓ Fi.CI.BAT: success for VC4 IGT Tests Updates (rev3) Patchwork
2022-12-18 23:11 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-12-19  9:30 ` [igt-dev] [PATCH i-g-t v3 0/5] VC4 IGT Tests Updates Melissa Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y6AtH+ipeYLubDBc@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=emma@anholt.net \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=maxime@cerno.tech \
    --cc=mcanal@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox