intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tina Zhang <tina.zhang@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	intel-gvt-dev@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Return -EPERM when i915_gem_mmap_ioctl handling prime objects
Date: Tue, 15 Aug 2017 16:37:02 +0300	[thread overview]
Message-ID: <1502804222.4217.4.camel@linux.intel.com> (raw)
In-Reply-To: <1502786527-8958-1-git-send-email-tina.zhang@intel.com>

On Tue, 2017-08-15 at 16:42 +0800, Tina Zhang wrote:
> Prime objects have no backing filp to GEM mmap pages from. So, for Prime
> objects, such operation is not permitted.
> 
> v1:
> - Separate this patch from dma-buf patch set. (Joonas)
> 
> Signed-off-by: Tina Zhang <tina.zhang@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 0628fb1..bb9d5ed 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1704,7 +1704,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
>  	 */
>  	if (!obj->base.filp) {
>  		i915_gem_object_put(obj);
> -		return -EINVAL;
> +		return -EPERM;

+ Daniel (in case he wants to explain in more detail)

The existing usecases in the driver for -EPERM are all conditional to
not being privileged user or DRM master, so we should rather stick to
"-EINVAL" and augment with DRM_DEBUG_DRIVER in case the developer may
want to know read more about the -EINVAL.

Lets stick to that convention here and in the GVT dma-buf patches.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2017-08-15 13:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15  8:42 [PATCH] drm/i915: Return -EPERM when i915_gem_mmap_ioctl handling prime objects Tina Zhang
2017-08-15 10:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-15 10:49 ` [PATCH] " Daniel Vetter
2017-08-15 13:18   ` Chris Wilson
2017-08-15 14:25     ` Daniel Vetter
2017-08-15 14:32       ` Chris Wilson
2017-08-15 14:35         ` Chris Wilson
2017-08-15 14:48           ` Daniel Vetter
2017-08-15 15:01             ` Chris Wilson
2017-08-16  3:26               ` Zhang, Tina
2017-08-18  8:03                 ` Daniel Vetter
2017-08-18  8:40                   ` Joonas Lahtinen
2017-08-15 13:37 ` Joonas Lahtinen [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=1502804222.4217.4.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=tina.zhang@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;
as well as URLs for NNTP newsgroup(s).