Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add begin/end_use ring callbacks

For manual UVD/VCE power and clock gating.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
f06505b8 7c23ace2

+13
+3
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 313 313 void (*pad_ib)(struct amdgpu_ring *ring, struct amdgpu_ib *ib); 314 314 unsigned (*init_cond_exec)(struct amdgpu_ring *ring); 315 315 void (*patch_cond_exec)(struct amdgpu_ring *ring, unsigned offset); 316 + /* note usage for clock and power gating */ 317 + void (*begin_use)(struct amdgpu_ring *ring); 318 + void (*end_use)(struct amdgpu_ring *ring); 316 319 }; 317 320 318 321 /*
+10
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
··· 75 75 76 76 ring->count_dw = ndw; 77 77 ring->wptr_old = ring->wptr; 78 + 79 + if (ring->funcs->begin_use) 80 + ring->funcs->begin_use(ring); 81 + 78 82 return 0; 79 83 } 80 84 ··· 131 127 132 128 mb(); 133 129 amdgpu_ring_set_wptr(ring); 130 + 131 + if (ring->funcs->end_use) 132 + ring->funcs->end_use(ring); 134 133 } 135 134 136 135 /** ··· 146 139 void amdgpu_ring_undo(struct amdgpu_ring *ring) 147 140 { 148 141 ring->wptr = ring->wptr_old; 142 + 143 + if (ring->funcs->end_use) 144 + ring->funcs->end_use(ring); 149 145 } 150 146 151 147 /**