All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Steven Price <steven.price@arm.com>,
	igt-dev@lists.freedesktop.org, Rob Herring <robh+dt@kernel.org>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [igt-dev] [PATCH 1/7] tests/panfrost: Make sure we open a DUMB capable node for prime tests
Date: Mon, 21 Jun 2021 20:00:33 +0300	[thread overview]
Message-ID: <YNDFsW3JsJCmYuXA@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20210621125724.1592104-2-boris.brezillon@collabora.com>

On Mon, Jun 21, 2021 at 02:57:18PM +0200, Boris Brezillon wrote:
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  tests/panfrost_prime.c | 26 +++++++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/panfrost_prime.c b/tests/panfrost_prime.c
> index 351d46f2f7e6..f9818108a662 100644
> --- a/tests/panfrost_prime.c
> +++ b/tests/panfrost_prime.c
> @@ -35,12 +35,36 @@
>  #include <sys/ioctl.h>
>  #include "panfrost_drm.h"
>  
> +static int igt_panfrost_open_kms_driver(void)
> +{
> +	for (unsigned i = 0; i < 2; i++) {
> +		uint64_t cap_dumb_buf = 0, cap_prime = 0;
> +		char path[32];
> +		int fd;
> +
> +		snprintf(path, sizeof(path), "/dev/dri/card%d", i);
> +
> +		fd = open(path, O_RDWR);
> +		if (fd < 0)
> +			continue;
> +
> +		drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &cap_dumb_buf);
> +		drmGetCap(fd, DRM_CAP_PRIME, &cap_prime);
> +		if (cap_dumb_buf && (cap_prime & DRM_PRIME_CAP_EXPORT))
> +			return fd;
> +
> +		close(fd);
> +	}
> +
> +	return -1;
> +}
> +
>  igt_main
>  {
>  	int fd, kms_fd;
>  
>  	igt_fixture {
> -		kms_fd = drm_open_driver_master(DRIVER_ANY);
> +		kms_fd = igt_panfrost_open_kms_driver();


How we've done this kind of thing elsewhere is

1) use drm_open_driver_another(0, DRIVER_foobar) +
drm_open_driver_another(1, DRIVER_something) to open the two driver
fds. The _another variants make sure the fds are from different
devices. Then, check that the fds meet the requirements for testing
with igt_require et al, don't go looking for additional devices. Let
the test produce a 'skip' result if requirements are not met.

2) use device filters when executing the tests to control what devices
get chosen. Docs at
https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Device-selection.html


That way someone who has, say, vkms + vgem + panfrost drivers present
is able to run tests and specify that they don't want you to touch
vkms.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-06-21 16:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 12:57 [igt-dev] [PATCH 0/7] tests/panfrost: Misc fixes/improvements Boris Brezillon
2021-06-21 12:57 ` [igt-dev] [PATCH 1/7] tests/panfrost: Make sure we open a DUMB capable node for prime tests Boris Brezillon
2021-06-21 17:00   ` Petri Latvala [this message]
2021-06-22  6:52     ` Boris Brezillon
2021-06-21 12:57 ` [igt-dev] [PATCH 2/7] lib/panfrost: Handle the NULL case in igt_panfrost_free_bo() Boris Brezillon
2021-06-21 12:57 ` [igt-dev] [PATCH 3/7] lib/panfrost: Add a helper to create a job loop Boris Brezillon
2021-06-21 13:35   ` Alyssa Rosenzweig
2021-06-21 14:09     ` Steven Price
2021-06-21 14:29       ` Boris Brezillon
2021-06-21 14:18     ` Boris Brezillon
2021-06-21 16:02       ` Alyssa Rosenzweig
2021-06-21 12:57 ` [igt-dev] [PATCH 4/7] lib/panfrost: Add a helper to create a NULL job Boris Brezillon
2021-06-21 12:57 ` [igt-dev] [PATCH 5/7] tests/panfrost: Simplify submit tests Boris Brezillon
2021-06-21 13:36   ` Alyssa Rosenzweig
2021-06-21 12:57 ` [igt-dev] [PATCH 6/7] lib/panfrost: Get rid of igt_panfrost_trivial_job() Boris Brezillon
2021-06-21 13:37   ` Alyssa Rosenzweig
2021-06-21 12:57 ` [igt-dev] [PATCH 7/7] tests/panfrost: Test FD-close while jobs are still in-flight Boris Brezillon
2021-06-21 13:37   ` Alyssa Rosenzweig
2021-06-21 13:49 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/panfrost: Misc fixes/improvements Patchwork
2021-06-21 15:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=YNDFsW3JsJCmYuXA@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=steven.price@arm.com \
    --cc=tomeu.vizoso@collabora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.