Skip to content

Commit 447fab3

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: use a dummy owner for sysfs triggered cleaner shaders v4
Otherwise triggering sysfs multiple times without other submissions in between only runs the shader once. v2: add some comment v3: re-add missing cast v4: squash in semicolon fix Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 8b2ae7d)
1 parent 8ffd015 commit 447fab3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,9 +1438,11 @@ static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
14381438
struct amdgpu_device *adev = ring->adev;
14391439
struct drm_gpu_scheduler *sched = &ring->sched;
14401440
struct drm_sched_entity entity;
1441+
static atomic_t counter;
14411442
struct dma_fence *f;
14421443
struct amdgpu_job *job;
14431444
struct amdgpu_ib *ib;
1445+
void *owner;
14441446
int i, r;
14451447

14461448
/* Initialize the scheduler entity */
@@ -1451,9 +1453,15 @@ static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
14511453
goto err;
14521454
}
14531455

1454-
r = amdgpu_job_alloc_with_ib(ring->adev, &entity, NULL,
1455-
64, 0,
1456-
&job);
1456+
/*
1457+
* Use some unique dummy value as the owner to make sure we execute
1458+
* the cleaner shader on each submission. The value just need to change
1459+
* for each submission and is otherwise meaningless.
1460+
*/
1461+
owner = (void *)(unsigned long)atomic_inc_return(&counter);
1462+
1463+
r = amdgpu_job_alloc_with_ib(ring->adev, &entity, owner,
1464+
64, 0, &job);
14571465
if (r)
14581466
goto err;
14591467

0 commit comments

Comments
 (0)