public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 11/12] drm/i915: Clarify the semantics of tiling-changed by renaming it
Date: Wed, 18 Apr 2012 14:05:02 +0200	[thread overview]
Message-ID: <20120418120502.GP5315@phenom.ffwll.local> (raw)
In-Reply-To: <1334673095-11771-12-git-send-email-chris@chris-wilson.co.uk>

On Tue, Apr 17, 2012 at 03:31:34PM +0100, Chris Wilson wrote:
> Rename obj->tiling_changed to obj->fence_change so that it is clear that
> it flags when the parameters for an active fence (including the
> no-fence) register are changed.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

I've picked up all the patches for -next up to this one. Thanks a lot for
cleaning out the cruft here. For this patch I've got a bit confused about
fence_changed. Chris suggested fence_dirty on irc and I like it.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.h        |    7 ++++++-
>  drivers/gpu/drm/i915/i915_gem.c        |    8 ++++----
>  drivers/gpu/drm/i915/i915_gem_tiling.c |    5 ++++-
>  3 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 8c32ada..3d7ad9b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -869,7 +869,12 @@ struct drm_i915_gem_object {
>  	 * Current tiling mode for the object.
>  	 */
>  	unsigned int tiling_mode:2;
> -	unsigned int tiling_changed:1;
> +	/**
> +	 * Whether the tiling parameters for the currently associated fence
> +	 * register have changed. Note that for the purposes of tracking
> +	 * tiling changes we also treat the unfenced register as a "fence".
> +	 */
> +	unsigned int fence_changed:1;
>  
>  	/** How many users have pinned this object in GTT space. The following
>  	 * users can each hold at most one reference: pwrite/pread, pin_ioctl
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 7bc4a40..5edab3f 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -66,7 +66,7 @@ static inline void i915_gem_object_fence_lost(struct drm_i915_gem_object *obj)
>  	/* As we do not have an associated fence register, we will force
>  	 * a tiling change if we ever need to acquire one.
>  	 */
> -	obj->tiling_changed = false;
> +	obj->fence_changed = false;
>  	obj->fence_reg = I915_FENCE_REG_NONE;
>  }
>  
> @@ -2456,7 +2456,7 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj)
>  	/* Have we updated the tiling parameters upon the object and so
>  	 * will need to serialise the write to the associated fence register?
>  	 */
> -	if (obj->tiling_changed) {
> +	if (obj->fence_changed) {
>  		ret = i915_gem_object_flush_fence(obj);
>  		if (ret)
>  			return ret;
> @@ -2465,7 +2465,7 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj)
>  	/* Just update our place in the LRU if our fence is getting reused. */
>  	if (obj->fence_reg != I915_FENCE_REG_NONE) {
>  		reg = &dev_priv->fence_regs[obj->fence_reg];
> -		if (!obj->tiling_changed) {
> +		if (!obj->fence_changed) {
>  			list_move_tail(&reg->lru_list,
>  				       &dev_priv->mm.fence_list);
>  			return 0;
> @@ -2488,7 +2488,7 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj)
>  		return 0;
>  
>  	i915_gem_object_update_fence(obj, reg, enable);
> -	obj->tiling_changed = false;
> +	obj->fence_changed = false;
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
> index 1a93066..e51d892 100644
> --- a/drivers/gpu/drm/i915/i915_gem_tiling.c
> +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
> @@ -374,7 +374,10 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
>  		}
>  
>  		if (ret == 0) {
> -			obj->tiling_changed = true;
> +			obj->fence_changed =
> +				obj->fenced_gpu_access ||
> +				obj->fence_reg != I915_FENCE_REG_NONE;
> +
>  			obj->tiling_mode = args->tiling_mode;
>  			obj->stride = args->stride;
>  		}
> -- 
> 1.7.10
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2012-04-18 12:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 14:31 Kill unused fence pipelining Chris Wilson
2012-04-17 14:31 ` [PATCH 01/12] drm/i915: Remove the pipelined parameter from get_fence() Chris Wilson
2012-04-17 14:31 ` [PATCH 02/12] drm/i915: Remove fence pipelining Chris Wilson
2012-04-17 14:31 ` [PATCH 03/12] drm/i915: Remove unused ring->setup_seqno Chris Wilson
2012-04-17 14:31 ` [PATCH 04/12] drm/i915: Discard the unused obj->last_fenced_ring Chris Wilson
2012-04-17 14:31 ` [PATCH 05/12] drm/i915: Simplify fence finding Chris Wilson
2012-04-17 14:31 ` [PATCH 06/12] drm/i915: Remove the unsightly "optimisation" from flush_fence() Chris Wilson
2012-04-17 14:31 ` [PATCH 07/12] drm/i915: Prepare to consolidate fence writing Chris Wilson
2012-04-17 14:31 ` [PATCH 08/12] drm/i915: Refactor put_fence() to use the common fence writing routine Chris Wilson
2012-04-17 14:31 ` [PATCH 09/12] drm/i915: Refactor fence clearing " Chris Wilson
2012-04-17 14:31 ` [PATCH 10/12] drm/i915: Refactor get_fence() " Chris Wilson
2012-04-17 14:31 ` [PATCH 11/12] drm/i915: Clarify the semantics of tiling-changed by renaming it Chris Wilson
2012-04-18 12:05   ` Daniel Vetter [this message]
2012-04-18 12:12     ` Chris Wilson
2012-04-17 14:31 ` [PATCH 12/12] drm/i915: Only the zap the VMA after updating the tiling parameters Chris Wilson

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=20120418120502.GP5315@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --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