public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Unwind conversion to	i915_gem_phys_ops on failure
Date: Thu, 16 Feb 2017 16:38:55 +0200	[thread overview]
Message-ID: <877f4qnqtc.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170215163900.11606-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> The physical object is treated as permanently pinned. If we fail to take
> this initial pin during i915_gem_object_attach_phys() we need to revert
> it back to an ordinary shmemfs object before reporting the failure.
>
> v2: git-add
>
> Reported-by: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 71297920fdf4..dc799db0446c 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -313,6 +313,8 @@ static const struct drm_i915_gem_object_ops i915_gem_phys_ops = {
>  	.release = i915_gem_object_release_phys,
>  };
>  
> +static const struct drm_i915_gem_object_ops i915_gem_object_ops;
> +
>  int i915_gem_object_unbind(struct drm_i915_gem_object *obj)
>  {
>  	struct i915_vma *vma;
> @@ -586,9 +588,18 @@ i915_gem_object_attach_phys(struct drm_i915_gem_object *obj,
>  	if (obj->mm.pages)
>  		return -EBUSY;
>  
> +	GEM_BUG_ON(obj->ops != &i915_gem_object_ops);
>  	obj->ops = &i915_gem_phys_ops;
>  
> -	return i915_gem_object_pin_pages(obj);
> +	ret = i915_gem_object_pin_pages(obj);
> +	if (ret)
> +		goto err_xfer;
> +
> +	return 0;
> +
> +err_xfer:
> +	obj->ops = &i915_gem_object_ops;
> +	return ret;
>  }
>  
>  static int
> -- 
> 2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-16 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 14:30 [PATCH] drm/i915: Unwind conversion to i915_gem_phys_ops on failure Chris Wilson
2017-02-15 16:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-02-15 16:39 ` [PATCH v2] " Chris Wilson
2017-02-16 14:38   ` Mika Kuoppala [this message]
2017-02-15 19:23 ` ✗ Fi.CI.BAT: failure for drm/i915: Unwind conversion to i915_gem_phys_ops on failure (rev2) Patchwork
2017-02-15 20:45 ` [PATCH] drm/i915: Unwind conversion to i915_gem_phys_ops on failure kbuild test robot
2017-02-16 12:21 ` ✗ Fi.CI.BAT: failure for drm/i915: Unwind conversion to i915_gem_phys_ops on failure (rev2) Patchwork
2017-02-16 15:32 ` 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=877f4qnqtc.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox