[PATCH v2] drm/xe: Create a helper function to init job's user fence
Nirmoy Das
nirmoy.das at intel.com
Wed Mar 27 16:48:40 UTC 2024
On 3/26/2024 11:56 PM, Lucas De Marchi wrote:
> On Mon, Mar 25, 2024 at 09:54:31PM +0100, Nirmoy Das wrote:
>> Hi Lucas,
>>
>> On 3/22/2024 5:11 PM, Lucas De Marchi wrote:
>>> On Thu, Mar 21, 2024 at 05:11:42PM +0100, Nirmoy Das wrote:
>>>> Refactor xe_sync_entry_signal so it doesn't have to
>>>> modify xe_sched_job struct instead create a new helper function
>>>> to set user fence values for a job.
>>>>
>>>> v2: Move the sync type check to xe_sched_job_init_user_fence(Lucas)
>>>>
>>>> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
>>>> Cc: Matthew Auld <matthew.auld at intel.com>
>>>> Cc: Matthew Brost <matthew.brost at intel.com>
>>>> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
>>>> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
>>>> ---
>>>> drivers/gpu/drm/xe/xe_exec.c | 9 +++++----
>>>> drivers/gpu/drm/xe/xe_sched_job.c | 18 ++++++++++++++++++
>>>> drivers/gpu/drm/xe/xe_sched_job.h | 3 +++
>>>> drivers/gpu/drm/xe/xe_sync.c | 7 +------
>>>> drivers/gpu/drm/xe/xe_sync.h | 1 -
>>>> drivers/gpu/drm/xe/xe_vm.c | 10 +++++-----
>>>> 6 files changed, 32 insertions(+), 16 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/xe/xe_exec.c
>>>> b/drivers/gpu/drm/xe/xe_exec.c
>>>> index 7692ebfe7d47..9d53ef8c49cc 100644
>>>> --- a/drivers/gpu/drm/xe/xe_exec.c
>>>> +++ b/drivers/gpu/drm/xe/xe_exec.c
>>>> @@ -249,7 +249,7 @@ int xe_exec_ioctl(struct drm_device *dev, void
>>>> *data, struct drm_file *file)
>>>> goto err_unlock_list;
>>>> }
>>>> for (i = 0; i < num_syncs; i++)
>>>> - xe_sync_entry_signal(&syncs[i], NULL, fence);
>>>> + xe_sync_entry_signal(&syncs[i], fence);
>>>> xe_exec_queue_last_fence_set(q, vm, fence);
>>>> dma_fence_put(fence);
>>>> }
>>>> @@ -359,9 +359,10 @@ int xe_exec_ioctl(struct drm_device *dev, void
>>>> *data, struct drm_file *file)
>>>> drm_gpuvm_resv_add_fence(&vm->gpuvm, exec,
>>>> &job->drm.s_fence->finished,
>>>> DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
>>>>
>>>> - for (i = 0; i < num_syncs; i++)
>>>> - xe_sync_entry_signal(&syncs[i], job,
>>>> - &job->drm.s_fence->finished);
>>>> + for (i = 0; i < num_syncs; i++) {
>>>> + xe_sync_entry_signal(&syncs[i], &job->drm.s_fence->finished);
>>>> + xe_sched_job_init_user_fence(job, &syncs[i]);
>>>> + }
>>>>
>>>> if (xe_exec_queue_is_lr(q))
>>>> q->ring_ops->emit_job(job);
>>>> diff --git a/drivers/gpu/drm/xe/xe_sched_job.c
>>>> b/drivers/gpu/drm/xe/xe_sched_job.c
>>>> index 8151ddafb940..bfbce9b69087 100644
>>>> --- a/drivers/gpu/drm/xe/xe_sched_job.c
>>>> +++ b/drivers/gpu/drm/xe/xe_sched_job.c
>>>> @@ -5,6 +5,7 @@
>>>>
>>>> #include "xe_sched_job.h"
>>>>
>>>> +#include <drm/xe_drm.h>
>>>> #include <linux/dma-fence-array.h>
>>>> #include <linux/slab.h>
>>>>
>>>> @@ -17,6 +18,7 @@
>>>> #include "xe_macros.h"
>>>> #include "xe_trace.h"
>>>> #include "xe_vm.h"
>>>> +#include "xe_sync_types.h"
>>>
>>> wrong placement, otherwise lgtm
>>>
>>> Feel free to carry by Reviewed-by: Lucas De Marchi
>>> <lucas.demarchi at intel.com>
>>> with that fixed.
>>
>> Could you please help me merge this patch. I am having issue with my
>> dev machine which I use to merge patches.
>
> Applied to drm-xe-next, thanks!
>
> [1/1] drm/xe: Create a helper function to init job's user fence
> commit: 5dffaa1bb94a6bc75393476fbe3c8a704ff4fcf8
Thanks a lot!
Nirmoy
>
> Best regards,
More information about the Intel-xe
mailing list