aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2024-04-19 22:03:32 +0000
committerAlex Deucher <[email protected]>2024-04-26 21:22:40 +0000
commit497d7cee24572db59cbfc4875d0c9270cee01e7f (patch)
treeade9390283896387d36cf46a31e5077309f9f70f /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parentdrm/amdgpu: update fw_share for VCN5 (diff)
downloadkernel-497d7cee24572db59cbfc4875d0c9270cee01e7f.tar.gz
kernel-497d7cee24572db59cbfc4875d0c9270cee01e7f.zip
drm/amdgpu: add a spinlock to wb allocation
As we use wb slots more dynamically, we need to lock access to avoid racing on allocation or free. Reviewed-by: Shaoyun.liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index cac0ca64367b..f87d53e183c3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -502,6 +502,7 @@ struct amdgpu_wb {
uint64_t gpu_addr;
u32 num_wb; /* Number of wb slots actually reserved for amdgpu. */
unsigned long used[DIV_ROUND_UP(AMDGPU_MAX_WB, BITS_PER_LONG)];
+ spinlock_t lock;
};
int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb);