Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Das, Nirmoy" <nirmoy.das@intel.com>
To: <intel-gfx@lists.freedesktop.org>
Cc: thomas.hellstrom@intel.com, matthew.auld@intel.com,
	chris.p.wilson@intel.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915: individualize fences before adding
Date: Mon, 16 May 2022 18:30:28 +0200	[thread overview]
Message-ID: <01eb6ed2-ed55-d0f0-d6ec-42ae41cc1a47@intel.com> (raw)
In-Reply-To: <20220516155108.2103-1-nirmoy.das@intel.com>

Please ignore this revision. I will send another one tomorrow.


Nirmoy

On 5/16/2022 5:51 PM, Nirmoy Das wrote:
> _i915_vma_move_to_active() can receive > 1 fence for
> multiple batch buffer submission so make sure to
> individualize fences before adding to dma_resv obj
>
> v2: make sure to reserve fence slots before adding.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5614
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_vma.c | 44 +++++++++++++++++++++------------
>   1 file changed, 28 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 4f6db539571a..b622e51bf132 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -23,6 +23,7 @@
>    */
>   
>   #include <linux/sched/mm.h>
> +#include <linux/dma-fence-array.h>
>   #include <drm/drm_gem.h>
>   
>   #include "display/intel_frontbuffer.h"
> @@ -1833,28 +1834,39 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
>   			intel_frontbuffer_put(front);
>   		}
>   
> -		if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
> -			err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
> -			if (unlikely(err))
> -				return err;
> -		}
> -
>   		if (fence) {
> -			dma_resv_add_fence(vma->obj->base.resv, fence,
> -					   DMA_RESV_USAGE_WRITE);
> +			int idx;
> +			struct dma_fence *curr;
> +
> +			dma_fence_array_for_each(curr, idx, fence) {
> +				if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
> +					err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
> +					if (unlikely(err))
> +						return err;
> +				}
> +
> +				dma_resv_add_fence(vma->obj->base.resv, curr,
> +						   DMA_RESV_USAGE_WRITE);
> +			}
>   			obj->write_domain = I915_GEM_DOMAIN_RENDER;
>   			obj->read_domains = 0;
>   		}
>   	} else {
> -		if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
> -			err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
> -			if (unlikely(err))
> -				return err;
> -		}
> -
>   		if (fence) {
> -			dma_resv_add_fence(vma->obj->base.resv, fence,
> -					   DMA_RESV_USAGE_READ);
> +			int idx;
> +			struct dma_fence *curr;
> +
> +			dma_fence_array_for_each(curr, idx, fence) {
> +				if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
> +					err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
> +					if (unlikely(err))
> +						return err;
> +				}
> +
> +
> +				dma_resv_add_fence(vma->obj->base.resv, curr,
> +						DMA_RESV_USAGE_READ);
> +			}
>   			obj->write_domain = 0;
>   		}
>   	}

  reply	other threads:[~2022-05-16 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 15:51 [Intel-gfx] [PATCH] drm/i915: individualize fences before adding Nirmoy Das
2022-05-16 16:30 ` Das, Nirmoy [this message]
2022-05-16 19:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: individualize fences before adding (rev2) Patchwork
2022-05-16 23:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-05-13 11:37 [Intel-gfx] [PATCH] drm/i915: individualize fences before adding Nirmoy Das
2022-05-16  9:38 ` Hellstrom, Thomas

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=01eb6ed2-ed55-d0f0-d6ec-42ae41cc1a47@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=thomas.hellstrom@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