Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Petri Latvala <petri.latvala@intel.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 v2 1/8] tests/panfrost: Make sure we open a DUMB capable node for prime tests
Date: Thu, 24 Jun 2021 16:29:43 +0200	[thread overview]
Message-ID: <20210624162943.5fa8d8d2@collabora.com> (raw)
In-Reply-To: <YNGwaY6ZzcRVKOw9@platvala-desk.ger.corp.intel.com>

Hi Petri,

On Tue, 22 Jun 2021 12:42:01 +0300
Petri Latvala <petri.latvala@intel.com> wrote:

> On Tue, Jun 22, 2021 at 11:02:14AM +0200, Boris Brezillon wrote:
> > v2:
> > * Use __drm_open_driver_another()
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > ---
> >  tests/panfrost_prime.c | 25 ++++++++++++++++++++++++-
> >  1 file changed, 24 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/panfrost_prime.c b/tests/panfrost_prime.c
> > index 351d46f2f7e6..dbc741a9eacb 100644
> > --- a/tests/panfrost_prime.c
> > +++ b/tests/panfrost_prime.c
> > @@ -35,13 +35,33 @@
> >  #include <sys/ioctl.h>
> >  #include "panfrost_drm.h"
> >  
> > +static bool igt_has_dumb(int fd)
> > +{
> > +	uint64_t value = 0;
> > +	int ret;
> > +
> > +	ret = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &value);
> > +	igt_assert(ret == 0 || errno == EINVAL || errno == EOPNOTSUPP);
> > +	return value == 1;
> > +}
> > +
> > +static bool igt_has_prime(int fd, uint64_t flags)
> > +{
> > +	uint64_t value = 0;
> > +	int ret;
> > +
> > +	ret = drmGetCap(fd, DRM_CAP_PRIME, &value);
> > +	igt_assert(ret == 0 || errno == EINVAL || errno == EOPNOTSUPP);
> > +	return (value & flags) == flags;
> > +}
> > +
> >  igt_main
> >  {
> >  	int fd, kms_fd;
> >  
> >  	igt_fixture {
> > -		kms_fd = drm_open_driver_master(DRIVER_ANY);
> >  		fd = drm_open_driver(DRIVER_PANFROST);
> > +		kms_fd = __drm_open_driver_another(1, DRIVER_ANY);
> >  	}
> >  
> >  	igt_subtest("gem-prime-import") {
> > @@ -50,6 +70,9 @@ igt_main
> >  	        struct drm_panfrost_get_bo_offset get_bo_offset = {0,};
> >  		int dmabuf_fd;
> >  
> > +		igt_skip_on(!igt_has_dumb(kms_fd) ||
> > +			    !igt_has_prime(kms_fd, DRM_PRIME_CAP_EXPORT));  
> 
> For better logs in case any of these trigger, use separate clauses:
> 
> igt_require(igt_has_dumb(kms_fd));
> igt_require(igt_has_prime(kms_fd, DRM_PRIME_CAP_EXPORT));
> 
> 
> Either way, LGTM
> Acked-by: Petri Latvala <petri.latvala@intel.com>

Thanks for this ack. I haven't contributed to igt in a while, and I
don't remember the process to push patches once they've received
acks/reviews. Should I push directly to the igt/master on gitlab (in
which case I'd need to be added to the project), or should I let
someone else push things for me.

Regards,

Boris

> 
> > +
> >  		/* Just to be sure that when we import the dumb buffer it has
> >  		 * a non-NULL address.
> >  		 */
> > -- 
> > 2.31.1
> >   

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

  reply	other threads:[~2021-06-24 14:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  9:02 [igt-dev] [PATCH v2 0/8] tests/panfrost: Misc fixes/improvements Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 1/8] tests/panfrost: Make sure we open a DUMB capable node for prime tests Boris Brezillon
2021-06-22  9:42   ` Petri Latvala
2021-06-24 14:29     ` Boris Brezillon [this message]
2021-06-28  8:00       ` Petri Latvala
2021-06-22  9:02 ` [igt-dev] [PATCH v2 2/8] lib/panfrost: Handle the NULL case in igt_panfrost_free_bo() Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 3/8] lib/panfrost: Add a helper to create a job loop Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 4/8] lib/panfrost: Add a helper to create a NULL job Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 5/8] tests/panfrost: Simplify submit tests Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 6/8] tests/panfrost: Extend the pan-reset test Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 7/8] lib/panfrost: Get rid of igt_panfrost_trivial_job() Boris Brezillon
2021-06-22  9:02 ` [igt-dev] [PATCH v2 8/8] tests/panfrost: Test FD-close while jobs are still in-flight Boris Brezillon
2021-06-22 13:56 ` [igt-dev] [PATCH v2 0/8] tests/panfrost: Misc fixes/improvements Alyssa Rosenzweig

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=20210624162943.5fa8d8d2@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox