public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kenneth Graunke <kenneth@whitecape.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Drop support for I915_EXEC_CONSTANTS_* execbuf parameters.
Date: Wed, 15 Feb 2017 01:33:06 -0800	[thread overview]
Message-ID: <3497501.vkApMHG6fz@eiger> (raw)
In-Reply-To: <20170215081250.GR18048@nuc-i3427.alporthouse.com>


[-- Attachment #1.1: Type: text/plain, Size: 3173 bytes --]

On Wednesday, February 15, 2017 12:12:50 AM PST Chris Wilson wrote:
> On Tue, Feb 14, 2017 at 08:17:51PM -0800, Kenneth Graunke wrote:
> > This patch makes the I915_PARAM_HAS_EXEC_CONSTANTS getparam return 0
> > (indicating the optional feature is not supported), and makes execbuf
> > always return -EINVAL if the flags are used.
> > 
> > Apparently, no userspace ever shipped which used this optional feature:
> > I checked the git history of Mesa, xf86-video-intel, libva, and Beignet,
> > and there were zero commits showing a use of these flags.  Kernel commit
> > 72bfa19c8deb4 apparently introduced the feature prematurely.
> 
> It was actually cairo where we had patches to use it first. And we then
> realised the use was broken for gen6.

Ahhh, that makes sense.  I knew I was forgetting about some userspace.
Thanks for reminding me about cairo-drm.

> > 'relative_constants_mode' has always been tracked per-device, but this
> > has actually been wrong ever since hardware contexts were introduced, as
> > the INSTPM register is saved (and automatically restored) as part of the
> > render ring context. The software per-device value could therefore get
> > out of sync with the hardware per-context value.  This meant that using
> > them is actually unsafe: a client which tried to use them could damage
> > the state of other clients, causing the GPU to interpret their BO
> > offsets as absolute pointers, leading to bogus memory reads.
> > 
> > These flags were also never ported to execlist mode, making them no-ops
> > on Gen9+ (which requires execlists), and Gen8 in the default mode.
> > 
> > On Gen8+, userspace can write these registers directly, achieving the
> > same effect.  On Gen6-7.5, it likely makes sense to extend the command
> > parser to support them.  I don't think anyone wants this on Gen4-5.
> > 
> > Based on a patch by Dave Gordon.
> > 
> > Cc: Dave Gordon <david.s.gordon@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: stable@vger.kernel.org
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92448
> > Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c            |  2 +-
> >  drivers/gpu/drm/i915/i915_drv.h            |  2 --
> >  drivers/gpu/drm/i915/i915_gem.c            |  2 --
> >  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 50 ++----------------------------
> >  4 files changed, 3 insertions(+), 53 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 309c29c84c54..1a53a4bb09c8 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -276,7 +276,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
> >  		value = !!dev_priv->engine[VCS2];
> >  		break;
> >  	case I915_PARAM_HAS_EXEC_CONSTANTS:
> > -		value = INTEL_GEN(dev_priv) >= 4;
> > +		value = 0;
> 
> The style for obsolete param is to return -ENODEV. If that makes sense
> we can move this to the start of this block with the other dead params.
> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris

Thanks, I missed that!  I'll change this and send a v3.

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-02-15  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  4:17 [PATCH v2] drm/i915: Drop support for I915_EXEC_CONSTANTS_* execbuf parameters Kenneth Graunke
2017-02-15  4:52 ` ✓ Fi.CI.BAT: success for drm/i915: Drop support for I915_EXEC_CONSTANTS_* execbuf parameters. (rev2) Patchwork
2017-02-15  7:38 ` [PATCH v2] drm/i915: Drop support for I915_EXEC_CONSTANTS_* execbuf parameters Joonas Lahtinen
2017-02-15  8:12 ` Chris Wilson
2017-02-15  9:33   ` Kenneth Graunke [this message]

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=3497501.vkApMHG6fz@eiger \
    --to=kenneth@whitecape.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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