diff options
author | 2022-03-01 09:57:41 +0100 | |
---|---|---|
committer | 2022-03-04 13:03:30 -0500 | |
commit | 6103b2f24e4a9716ca3f5de654964f2a083086be (patch) | |
tree | 2e287c2edf51e35ac36d8eceeb1dbe7270e28cba /drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | |
parent | drm/amdgpu: use job and ib structures directly in CS parsers (diff) | |
download | linux-6103b2f24e4a9716ca3f5de654964f2a083086be.tar.gz linux-6103b2f24e4a9716ca3f5de654964f2a083086be.tar.bz2 linux-6103b2f24e4a9716ca3f5de654964f2a083086be.zip |
drm/amdgpu: properly embed the IBs into the job
We now have standard macros for that.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_job.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index d970336d2261..67f66f2f1809 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -81,14 +81,10 @@ exit: int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, struct amdgpu_job **job, struct amdgpu_vm *vm) { - size_t size = sizeof(struct amdgpu_job); - if (num_ibs == 0) return -EINVAL; - size += sizeof(struct amdgpu_ib) * num_ibs; - - *job = kzalloc(size, GFP_KERNEL); + *job = kzalloc(struct_size(*job, ibs, num_ibs), GFP_KERNEL); if (!*job) return -ENOMEM; @@ -98,7 +94,6 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, */ (*job)->base.sched = &adev->rings[0]->sched; (*job)->vm = vm; - (*job)->ibs = (void *)&(*job)[1]; (*job)->num_ibs = num_ibs; amdgpu_sync_create(&(*job)->sync); |