All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Fix pages pin counting around swizzle quirk
Date: Fri, 04 Nov 2016 10:50:44 +0200	[thread overview]
Message-ID: <1478249444.2866.4.camel@linux.intel.com> (raw)
In-Reply-To: <20161102094354.7045-1-chris@chris-wilson.co.uk>

On ke, 2016-11-02 at 09:43 +0000, Chris Wilson wrote:
> @@ -2458,17 +2459,16 @@ int __i915_gem_object_get_pages(struct drm_i915_gem_object *obj)
>  	if (err)
>  		return err;
>  
> -	if (likely(obj->mm.pages)) {
> -		__i915_gem_object_pin_pages(obj);
> -		goto unlock;
> -	}
> -
> -	GEM_BUG_ON(i915_gem_object_has_pinned_pages(obj));
> +	if (unlikely(!obj->mm.pages)) {
> +		GEM_BUG_ON(i915_gem_object_has_pinned_pages(obj));
> +		err = ____i915_gem_object_get_pages(obj);
> +		if (err)
> +			goto unlock;
>  
> -	err = ____i915_gem_object_get_pages(obj);
> -	if (!err)
> -		atomic_set_release(&obj->mm.pages_pin_count, 1);
> +		smp_mb__before_atomic();

This is not cool without atomic in sight. Inline wrap as
__i915_gem_object_pages_mb() or something.

> @@ -3707,6 +3707,7 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma)
>  {
>  	int ret = 0;
>  
> +	GEM_BUG_ON(!i915_gem_object_has_pinned_pages(vma->obj));

Rather confusing, simple mind would think as
__i915_gem_object_pin_pages has GEM_BUG_ON(!obj->mm.pages),
the next branch would never be taken?

>  	if (vma->pages)
>  		return 0;
>  

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:[~2016-11-04  8:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02  9:43 [PATCH] drm/i915: Fix pages pin counting around swizzle quirk Chris Wilson
2016-11-02 11:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-11-03  9:42 ` [PATCH] " Chris Wilson
2016-11-04  8:50 ` Joonas Lahtinen [this message]
2016-11-04  9:36   ` Chris Wilson
2016-11-04 10:26     ` Chris Wilson
2016-11-04 10:29 ` [PATCH v2] get-fences-locked Chris Wilson
2016-11-04 11:31   ` Joonas Lahtinen
2016-11-04 10:30 ` [PATCH v2] drm/i915: Fix pages pin counting around swizzle quirk Chris Wilson
2016-11-04 11:43   ` Joonas Lahtinen
2016-11-04 11:57     ` Chris Wilson
2016-11-04 11:15 ` ✓ Fi.CI.BAT: success for drm/i915: Fix pages pin counting around swizzle quirk (rev3) Patchwork

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=1478249444.2866.4.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.