Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>
Cc: IGT dev <igt-dev@lists.freedesktop.org>,
	Fei Yang <fei.yang@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH v2 1/1] test/gem_create: limit set_pat to GEN12+ platforms
Date: Tue, 6 Jun 2023 19:44:15 +0200	[thread overview]
Message-ID: <ZH9wb0wNTcCHWDb7@ashyti-mobl2.lan> (raw)
In-Reply-To: <ZH9vhh+LkFY7SQgP@ashyti-mobl2.lan>

Hi Kamil,

> > > >  tests/i915/gem_create.c | 8 +++++++-
> > > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
> > > > index e9e8216d2b..a3428e5890 100644
> > > > --- a/tests/i915/gem_create.c
> > > > +++ b/tests/i915/gem_create.c
> > > > @@ -657,6 +657,7 @@ static void create_ext_set_pat(int fd)
> > > >  		.base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
> > > >  		.pat_index = 65,
> > > >  	};
> > > > +	uint32_t devid = intel_get_drm_devid(fd);
> > > >  	struct drm_i915_gem_caching arg;
> > > >  	uint64_t size;
> > > >  	uint32_t handle;
> > > > @@ -670,8 +671,13 @@ static void create_ext_set_pat(int fd)
> > > >  	 * With a valid PAT index specified, returning -EINVAL here
> > > >  	 * indicates set_pat extension is not supported
> > > >  	 */
> > > > -	if (ret == -EINVAL)
> > > > +	if (!IS_METEORLAKE(devid)) {
> > 
> > Put here
> > 		if (ret == -EINVAL)
> > 			igt_skip("EXT_SET_PAT unsupported\n");
> > 
> > > > +		igt_assert(ret == -ENODEV);
> > -------------------------^ ------- ^
> > On unsupported or older driver this returns -22 (-EINVAL),
> > I tested on Skylake gen9 iGPU. Btw better use:
> 
> It's not merged yet. Once the patch will be merged then we will
> have -ENODEV.

In the kernel this will be:

+	/* Limiting the extension only to Meteor Lake */
+	if (!IS_METEORLAKE(i915))
+		return -ENODEV;

But it's not merged yet.

Andi

> -EINVAL comes from future old kernels that don't have this api
> merged.
> 
> Anyway, makes sense to check for -EINVAL first.
> 
> Thanks for the review, will send v3 soon.
> 
> Andi

  reply	other threads:[~2023-06-06 17:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06  9:51 [igt-dev] [PATCH v2 0/1] test/gem_create: limit set_pat to GEN12+ platforms Andi Shyti
2023-06-06  9:51 ` [igt-dev] [PATCH v2 1/1] " Andi Shyti
2023-06-06 11:59   ` Andi Shyti
2023-06-06 16:09     ` Kamil Konieczny
2023-06-06 17:40       ` Andi Shyti
2023-06-06 17:44         ` Andi Shyti [this message]
2023-06-06 11:53 ` [igt-dev] ✓ Fi.CI.BAT: success for test/gem_create: limit set_pat to GEN12+ platforms (rev2) Patchwork
2023-06-07  2:14 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=ZH9wb0wNTcCHWDb7@ashyti-mobl2.lan \
    --to=andi.shyti@linux.intel.com \
    --cc=fei.yang@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.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