drm/amdgpu: use a dummy owner for sysfs triggered cleaner shaders v4
[ Upstream commit 447fab30955cf7dba7dd563f42b67c02284860c8 ] 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 8b2ae7d492675e8af8902f103364bef59382b935) Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
387461fba3
commit
0fd149c262
@@ -1426,9 +1426,11 @@ static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
|
|||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
struct drm_gpu_scheduler *sched = &ring->sched;
|
struct drm_gpu_scheduler *sched = &ring->sched;
|
||||||
struct drm_sched_entity entity;
|
struct drm_sched_entity entity;
|
||||||
|
static atomic_t counter;
|
||||||
struct dma_fence *f;
|
struct dma_fence *f;
|
||||||
struct amdgpu_job *job;
|
struct amdgpu_job *job;
|
||||||
struct amdgpu_ib *ib;
|
struct amdgpu_ib *ib;
|
||||||
|
void *owner;
|
||||||
int i, r;
|
int i, r;
|
||||||
|
|
||||||
/* Initialize the scheduler entity */
|
/* Initialize the scheduler entity */
|
||||||
@@ -1439,9 +1441,15 @@ static int amdgpu_gfx_run_cleaner_shader_job(struct amdgpu_ring *ring)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_job_alloc_with_ib(ring->adev, &entity, NULL,
|
/*
|
||||||
64, 0,
|
* Use some unique dummy value as the owner to make sure we execute
|
||||||
&job);
|
* the cleaner shader on each submission. The value just need to change
|
||||||
|
* for each submission and is otherwise meaningless.
|
||||||
|
*/
|
||||||
|
owner = (void *)(unsigned long)atomic_inc_return(&counter);
|
||||||
|
|
||||||
|
r = amdgpu_job_alloc_with_ib(ring->adev, &entity, owner,
|
||||||
|
64, 0, &job);
|
||||||
if (r)
|
if (r)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user