Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jason Ekstrand <jason@jlekstrand.net>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 3/5] drm/i915: Disable pread/pwrite ioctl's for future platforms (v3)
Date: Thu, 18 Mar 2021 14:27:52 +0100	[thread overview]
Message-ID: <YFNVWJsX6Yq0+/Zx@phenom.ffwll.local> (raw)
In-Reply-To: <20210317234014.2271006-4-jason@jlekstrand.net>

On Wed, Mar 17, 2021 at 06:40:12PM -0500, Jason Ekstrand wrote:
> From: Ashutosh Dixit <ashutosh.dixit@intel.com>
> 
> The rationale for this change is roughly as follows:
> 
>  1. The functionality can be done entirely in userspace with a
>     combination of mmap + memcpy
> 
>  2. The only reason anyone in userspace is still using it is because
>     someone implemented bo_subdata that way in libdrm ages ago and
>     they're all too lazy to write the 5 lines of code to do a map.
> 
>  3. This falls cleanly into the category of things which will only get
>     more painful with local memory support.
> 
> These ioctls aren't used much anymore by "real" userspace drivers.
> Vulkan has never used them and neither has the iris GL driver.  The old
> i965 GL driver does use PWRITE for glBufferSubData but it only supports
> up through Gen11; Gen12 was never enabled in i965.  The compute driver
> has never used PREAD/PWRITE.  The only remaining user is the media
> driver which uses it exactly twice and they're easily removed [1] so
> expecting them to drop it going forward is reasonable.
> 
> IGT changes which handle this kernel change have also been submitted [2].
> 
> [1] https://github.com/intel/media-driver/pull/1160
> [2] https://patchwork.freedesktop.org/series/81384/
> 
> v2 (Jason Ekstrand):
>  - Improved commit message with the status of all usermode drivers
>  - A more future-proof platform check
> 
> v3 (Jason Ekstrand):
>  - Drop the HAS_LMEM checks as they're already covered by the version
>    checks
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

Merged the first three here. For the scheduler/context stuff I think we
should go back to normal due process with kernel patch + igt patches
tested together, then land igt first, then kernel, just to avoid hiccups
in CI.

Thanks, Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index b2e3b5cfccb4a..80915467e0d84 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -374,10 +374,17 @@ int
>  i915_gem_pread_ioctl(struct drm_device *dev, void *data,
>  		     struct drm_file *file)
>  {
> +	struct drm_i915_private *i915 = to_i915(dev);
>  	struct drm_i915_gem_pread *args = data;
>  	struct drm_i915_gem_object *obj;
>  	int ret;
>  
> +	/* PREAD is disallowed for all platforms after TGL-LP.  This also
> +	 * covers all platforms with local memory.
> +	 */
> +	if (INTEL_GEN(i915) >= 12 && !IS_TIGERLAKE(i915))
> +		return -EOPNOTSUPP;
> +
>  	if (args->size == 0)
>  		return 0;
>  
> @@ -675,10 +682,17 @@ int
>  i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
>  		      struct drm_file *file)
>  {
> +	struct drm_i915_private *i915 = to_i915(dev);
>  	struct drm_i915_gem_pwrite *args = data;
>  	struct drm_i915_gem_object *obj;
>  	int ret;
>  
> +	/* PWRITE is disallowed for all platforms after TGL-LP.  This also
> +	 * covers all platforms with local memory.
> +	 */
> +	if (INTEL_GEN(i915) >= 12 && !IS_TIGERLAKE(i915))
> +		return -EOPNOTSUPP;
> +
>  	if (args->size == 0)
>  		return 0;
>  
> -- 
> 2.29.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-03-18 13:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 14:34 [Intel-gfx] [PATCH 0/3] drm/i915: Drop legacy IOCTLs on new HW Jason Ekstrand
2021-03-15 14:34 ` [Intel-gfx] [PATCH 1/3] drm/i915/gem: Drop legacy execbuffer support (v2) Jason Ekstrand
2021-03-15 14:34 ` [Intel-gfx] [PATCH 2/3] drm/i915/gem: Drop relocation support on all new hardware (v5) Jason Ekstrand
2021-03-17 14:39   ` [Intel-gfx] [PATCH] drm/i915/gem: Drop relocation support on all new hardware (v6) Jason Ekstrand
2021-03-17 14:41     ` Jason Ekstrand
2021-03-17 15:06       ` Zbigniew Kempczyński
2021-03-15 14:34 ` [Intel-gfx] [PATCH 3/3] drm/i915: Disable pread/pwrite ioctl's for future platforms (v3) Jason Ekstrand
2021-03-15 15:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Drop legacy IOCTLs on new HW Patchwork
2021-03-15 15:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-16  5:31 ` [Intel-gfx] [PATCH 0/3] " Dixit, Ashutosh
2021-03-17 23:40 ` [Intel-gfx] [PATCH 0/5] drm/i915: Clean up some of the i915 uAPI (v6) Jason Ekstrand
2021-03-17 23:40   ` [Intel-gfx] [PATCH 1/5] drm/i915/gem: Drop legacy execbuffer support (v2) Jason Ekstrand
2021-03-17 23:40   ` [Intel-gfx] [PATCH 2/5] drm/i915/gem: Drop relocation support on all new hardware (v6) Jason Ekstrand
2021-03-17 23:40   ` [Intel-gfx] [PATCH 3/5] drm/i915: Disable pread/pwrite ioctl's for future platforms (v3) Jason Ekstrand
2021-03-18 13:27     ` Daniel Vetter [this message]
2021-03-17 23:40   ` [Intel-gfx] [PATCH 4/5] drm/i915: Drop the CONTEXT_CLONE API Jason Ekstrand
2021-03-18 10:19     ` Tvrtko Ursulin
2021-03-17 23:40   ` [Intel-gfx] [PATCH 5/5] drm/i915: Drop I915_CONTEXT_PARAM_RINGSIZE Jason Ekstrand
2021-03-22  7:30     ` [Intel-gfx] [drm/i915] 3ef784da89: drm:add_taint_for_CI[i915]] kernel test robot

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=YFNVWJsX6Yq0+/Zx@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    /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