From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/11] drm/i915: Remove pinned check from madvise_ioctl
Date: Wed, 28 Jan 2015 10:52:06 +0100 [thread overview]
Message-ID: <20150128095206.GS4764@phenom.ffwll.local> (raw)
In-Reply-To: <1422276205-8532-4-git-send-email-rodrigo.vivi@intel.com>
On Mon, Jan 26, 2015 at 04:43:17AM -0800, Rodrigo Vivi wrote:
> From: Chris Wilson <chris@chris-wilson.co.uk>
>
> We don't need to incur the overhead of checking whether the object is
> pinned prior to changing its madvise. If the object is pinned, the
> madvise will not take effect until it is unpinned and so we cannot free
> the pages being pointed at by hardware. Marking a pinned object with
> allocated pages as DONTNEED will not trigger any undue warnings. The check
> is therefore superfluous, and by removing it we can remove a linear walk
> over all the vma the object has.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
I'd still would like to see some igt testcase which marks a pinned scanout
buffer asl DONTNEED. Just to make sure we don't accidentally create a gap
somewhere for a CVE to sneak through.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_gem.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 6c40365..123ce34 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4365,11 +4365,6 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
> goto unlock;
> }
>
> - if (i915_gem_obj_is_pinned(obj)) {
> - ret = -EINVAL;
> - goto out;
> - }
> -
> if (obj->pages &&
> obj->tiling_mode != I915_TILING_NONE &&
> dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES) {
> @@ -4388,7 +4383,6 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
>
> args->retained = obj->madv != __I915_MADV_PURGED;
>
> -out:
> drm_gem_object_unreference(&obj->base);
> unlock:
> mutex_unlock(&dev->struct_mutex);
> --
> 1.9.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-01-28 9:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 12:43 [PATCH 00/11] drm-intel-collector - update Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 01/11] drm/i915: Put logical pipe_control emission into a helper Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 02/11] drm/i915: Add WaCsStallBeforeStateCacheInvalidate:bdw, chv to logical ring Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 03/11] drm/i915: Remove pinned check from madvise_ioctl Rodrigo Vivi
2015-01-28 9:52 ` Daniel Vetter [this message]
2015-01-26 12:43 ` [PATCH 04/11] drm/i915: Extend GET_APERTURE ioctl to report available map space Rodrigo Vivi
2015-01-28 9:59 ` Daniel Vetter
2015-04-29 10:24 ` Chris Wilson
2015-04-29 10:27 ` Chris Wilson
2015-04-30 10:17 ` Joonas Lahtinen
2015-01-26 12:43 ` [PATCH 05/11] drm/i915: Display current hangcheck status in debugfs Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 06/11] drm/i915/vlv: check port in infoframe_enabled v2 Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 07/11] drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 08/11] Revert "drm/i915: Fix mutex->owner inspection race under DEBUG_MUTEXES" Rodrigo Vivi
2015-01-28 9:53 ` Daniel Vetter
2015-01-26 12:43 ` [PATCH 09/11] drm/i915: FIFO space query code refactor Rodrigo Vivi
2015-01-26 12:43 ` [PATCH 10/11] drm/i915: add irq_barrier operation for synchronising reads Rodrigo Vivi
2015-01-28 9:55 ` Daniel Vetter
2015-01-28 10:02 ` Chris Wilson
2015-01-26 12:43 ` [PATCH 11/11] drm/i915: use effective_size for ringbuffer calculations Rodrigo Vivi
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=20150128095206.GS4764@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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