Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: stop checking for NULL vma->obj
Date: Fri, 04 Mar 2022 18:47:09 +0100	[thread overview]
Message-ID: <5c0043cbf8debcda7cd16b5fcc5f5e8b358795ba.camel@linux.intel.com> (raw)
In-Reply-To: <20220304174252.1000238-1-matthew.auld@intel.com>

On Fri, 2022-03-04 at 17:42 +0000, Matthew Auld wrote:
> This is no longer possible since e6e1a304d759 ("drm/i915: vma is
> always
> backed by an object.").
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>

LGTM. 
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_vma.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_vma.c
> b/drivers/gpu/drm/i915/i915_vma.c
> index 94fcdb7bd21d..7acfbbc63d17 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -515,21 +515,18 @@ int i915_vma_bind(struct i915_vma *vma,
>                 if (!work->vma_res->bi.pages_rsgt)
>                         work->pinned = i915_gem_object_get(vma->obj);
>         } else {
> -               if (vma->obj) {
> -                       ret = i915_gem_object_wait_moving_fence(vma-
> >obj, true);
> -                       if (ret) {
> -                               i915_vma_resource_free(vma-
> >resource);
> -                               vma->resource = NULL;
> +               ret = i915_gem_object_wait_moving_fence(vma->obj,
> true);
> +               if (ret) {
> +                       i915_vma_resource_free(vma->resource);
> +                       vma->resource = NULL;
>  
> -                               return ret;
> -                       }
> +                       return ret;
>                 }
>                 vma->ops->bind_vma(vma->vm, NULL, vma->resource,
> cache_level,
>                                    bind_flags);
>         }
>  
> -       if (vma->obj)
> -               set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
> +       set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);
>  
>         atomic_or(bind_flags, &vma->flags);
>         return 0;
> @@ -1360,7 +1357,7 @@ int i915_vma_pin_ww(struct i915_vma *vma,
> struct i915_gem_ww_ctx *ww,
>         if (flags & PIN_GLOBAL)
>                 wakeref = intel_runtime_pm_get(&vma->vm->i915-
> >runtime_pm);
>  
> -       moving = vma->obj ? i915_gem_object_get_moving_fence(vma-
> >obj) : NULL;
> +       moving = i915_gem_object_get_moving_fence(vma->obj);
>         if (flags & vma->vm->bind_async_flags || moving) {
>                 /* lock VM */
>                 err = i915_vm_lock_objects(vma->vm, ww);



  reply	other threads:[~2022-03-04 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 17:42 [Intel-gfx] [PATCH] drm/i915: stop checking for NULL vma->obj Matthew Auld
2022-03-04 17:47 ` Thomas Hellström [this message]
2022-03-04 19:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-03-04 20:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-05  6:57 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=5c0043cbf8debcda7cd16b5fcc5f5e8b358795ba.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@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