drm/sched: Store the drm client_id in drm_sched_fence

This will be used in a later commit to trace the drm client_id in
some of the gpu_scheduler trace events.

This requires changing all the users of drm_sched_job_init to
add an extra parameter.

The newly added drm_client_id field in the drm_sched_fence is a bit
of a duplicate of the owner one. One suggestion I received was to
merge those 2 fields - this can't be done right now as amdgpu uses
some special values (AMDGPU_FENCE_OWNER_*) that can't really be
translated into a client id. Christian is working on getting rid of
those; when it's done we should be able to squash owner/drm_client_id
together.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250526125505.2360-3-pierre-eric.pelloux-prayer@amd.com
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2025-05-26 14:54:44 +02:00
committed by Philipp Stanner
parent 18c44fb647
commit 2956554823
26 changed files with 64 additions and 34 deletions

View File

@@ -204,7 +204,8 @@ exit:
int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm,
struct drm_sched_entity *entity, void *owner,
unsigned int num_ibs, struct amdgpu_job **job)
unsigned int num_ibs, struct amdgpu_job **job,
u64 drm_client_id)
{
if (num_ibs == 0)
return -EINVAL;
@@ -222,7 +223,8 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm,
if (!entity)
return 0;
return drm_sched_job_init(&(*job)->base, entity, 1, owner);
return drm_sched_job_init(&(*job)->base, entity, 1, owner,
drm_client_id);
}
int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev,
@@ -232,7 +234,7 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev,
{
int r;
r = amdgpu_job_alloc(adev, NULL, entity, owner, 1, job);
r = amdgpu_job_alloc(adev, NULL, entity, owner, 1, job, 0);
if (r)
return r;