public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: bradley.d.volkin@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 6/7] drm/i915: Mark shadow batch buffers as purgeable
Date: Wed, 12 Nov 2014 09:46:49 +0100	[thread overview]
Message-ID: <20141112084649.GJ25711@phenom.ffwll.local> (raw)
In-Reply-To: <1415398927-16572-7-git-send-email-bradley.d.volkin@intel.com>

On Fri, Nov 07, 2014 at 02:22:06PM -0800, bradley.d.volkin@intel.com wrote:
> From: Brad Volkin <bradley.d.volkin@intel.com>
> 
> By adding a new exec_entry flag, we cleanly mark the shadow objects
> as purgeable after they are on the active list.
> 
> Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 20835b8..a271bc0 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -37,6 +37,7 @@
>  #define  __EXEC_OBJECT_HAS_FENCE (1<<30)
>  #define  __EXEC_OBJECT_NEEDS_MAP (1<<29)
>  #define  __EXEC_OBJECT_NEEDS_BIAS (1<<28)
> +#define  __EXEC_OBJECT_PURGEABLE (1<<27)
>  
>  #define BATCH_OFFSET_BIAS (256*1024)
>  
> @@ -223,7 +224,12 @@ i915_gem_execbuffer_unreserve_vma(struct i915_vma *vma)
>  	if (entry->flags & __EXEC_OBJECT_HAS_PIN)
>  		vma->pin_count--;
>  
> -	entry->flags &= ~(__EXEC_OBJECT_HAS_FENCE | __EXEC_OBJECT_HAS_PIN);
> +	if (entry->flags & __EXEC_OBJECT_PURGEABLE)
> +		obj->madv = I915_MADV_DONTNEED;
> +
> +	entry->flags &= ~(__EXEC_OBJECT_HAS_FENCE |
> +			  __EXEC_OBJECT_HAS_PIN |
> +			  __EXEC_OBJECT_PURGEABLE);
>  }
>  
>  static void eb_destroy(struct eb_vmas *eb)
> @@ -1373,6 +1379,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
>  			goto err;
>  		}
>  
> +		shadow_batch_obj->madv = I915_MADV_WILLNEED;
> +

Imo this hunk should be int the pool _get function so that all the
purgeable/willneed handling is in one place.
-Daniel

>  		ret = i915_gem_obj_ggtt_pin(shadow_batch_obj, 4096, 0);
>  		if (ret)
>  			goto err;
> @@ -1396,6 +1404,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
>  
>  			vma = i915_gem_obj_to_ggtt(shadow_batch_obj);
>  			vma->exec_entry = &shadow_exec_entry;
> +			vma->exec_entry->flags = __EXEC_OBJECT_PURGEABLE;
>  			drm_gem_object_reference(&shadow_batch_obj->base);
>  			list_add_tail(&vma->exec_list, &eb->vmas);
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> 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

  reply	other threads:[~2014-11-12  8:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 22:22 [PATCH v4 0/7] Command parser batch buffer copy bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 1/7] drm/i915: Implement a framework for batch buffer pools bradley.d.volkin
2014-11-12  8:44   ` Daniel Vetter
2014-11-12  9:46     ` Chris Wilson
2014-11-12 16:33       ` Daniel Vetter
2014-11-12 16:38         ` Chris Wilson
2014-11-22  1:28           ` Michael H. Nguyen
2014-11-24  9:18             ` Daniel Vetter
2014-11-12  9:42   ` Chris Wilson
2014-11-07 22:22 ` [PATCH v4 2/7] drm/i915: Use batch pools with the command parser bradley.d.volkin
2014-11-12  9:49   ` Chris Wilson
2014-11-07 22:22 ` [PATCH v4 3/7] drm/i915: Add a batch pool debugfs file bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 4/7] drm/i915: Add batch pool details to i915_gem_objects debugfs bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 5/7] drm/i915: Use batch length instead of object size in command parser bradley.d.volkin
2014-11-07 22:22 ` [PATCH v4 6/7] drm/i915: Mark shadow batch buffers as purgeable bradley.d.volkin
2014-11-12  8:46   ` Daniel Vetter [this message]
2014-11-07 22:22 ` [PATCH v4 7/7] drm/i915: Tidy up execbuffer command parsing code bradley.d.volkin
2014-11-07 22:25   ` [PATCH v4 7/7] drm/i915: Tidy up execbuffer command shuang.he
2014-11-12  9:37   ` [PATCH v4 7/7] drm/i915: Tidy up execbuffer command parsing code Chris Wilson
2014-11-22  1:17     ` Michael H. Nguyen
2014-11-24  9:20       ` Daniel Vetter
2014-11-12  8:51 ` [PATCH v4 0/7] Command parser batch buffer copy Daniel Vetter

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=20141112084649.GJ25711@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=bradley.d.volkin@intel.com \
    --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