aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2024-09-17 01:05:31 +1000
committerDave Airlie <airlied@redhat.com>2024-09-17 01:06:10 +1000
commit26df39de93bb8763bb3088db6c76eb98d4cd7213 (patch)
tree834991400838b64bcd6583fdc00deacf477c715f /drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
parentbf05aeac230e390a5aee4bd3dc978b0c4d7e745f (diff)
parent0c8c5bdd7eaf291b6f727e98506fb68acee3a4cc (diff)
Merge tag 'amd-drm-next-6.12-2024-09-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.12-2024-09-13: amdgpu: - GPUVM sync fixes - kdoc fixes - Misc spelling mistakes - Add some raven GFXOFF quirks - Use clamp helper - DC fixes - JPEG fixes - Process isolation fix - Queue reset fix - W=1 cleanup - SMU14 fixes - JPEG fixes amdkfd: - Fetch cacheline info from IP discovery - Queue reset fix - RAS fix - Document SVM events - CRIU fixes - Race fix in dma-buf handling drm: - dma-buf fd race fixes Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240913134139.2861073-1-alexander.deucher@amd.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index b779d47a546a..83e54697f0ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -1397,14 +1397,23 @@ static ssize_t amdgpu_gfx_get_available_compute_partition(struct device *dev,
static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
- long timeout = msecs_to_jiffies(1000);
- struct dma_fence *f = NULL;
+ struct drm_gpu_scheduler *sched = &ring->sched;
+ struct drm_sched_entity entity;
+ struct dma_fence *f;
struct amdgpu_job *job;
struct amdgpu_ib *ib;
int i, r;
- r = amdgpu_job_alloc_with_ib(adev, NULL, NULL,
- 64, AMDGPU_IB_POOL_DIRECT,
+ /* Initialize the scheduler entity */
+ r = drm_sched_entity_init(&entity, DRM_SCHED_PRIORITY_NORMAL,
+ &sched, 1, NULL);
+ if (r) {
+ dev_err(adev->dev, "Failed setting up GFX kernel entity.\n");
+ goto err;
+ }
+
+ r = amdgpu_job_alloc_with_ib(ring->adev, &entity, NULL,
+ 64, 0,
&job);
if (r)
goto err;
@@ -1416,24 +1425,18 @@ static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
ib->ptr[i] = ring->funcs->nop;
ib->length_dw = ring->funcs->align_mask + 1;
- r = amdgpu_job_submit_direct(job, ring, &f);
- if (r)
- goto err_free;
+ f = amdgpu_job_submit(job);
- r = dma_fence_wait_timeout(f, false, timeout);
- if (r == 0)
- r = -ETIMEDOUT;
- else if (r > 0)
- r = 0;
+ r = dma_fence_wait(f, false);
+ if (r)
+ goto err;
- amdgpu_ib_free(adev, ib, f);
dma_fence_put(f);
+ /* Clean up the scheduler entity */
+ drm_sched_entity_destroy(&entity);
return 0;
-err_free:
- amdgpu_job_free(job);
- amdgpu_ib_free(adev, ib, f);
err:
return r;
}