mirror_ubuntu-kernels/drivers/gpu/drm/amd
Uros Bizjak 9e761bff03 drm/amdgpu: Use local64_try_cmpxchg in amdgpu_perf_read
Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old
in amdgpu_perf_read.  x86 CMPXCHG instruction returns success in ZF flag,
so this change saves a compare after cmpxchg (and related move instruction
in front of cmpxchg).

Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg
fails. There is no need to re-read the value in the loop.

No functional change intended.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-08-09 18:08:51 -04:00
..
acp
amdgpu drm/amdgpu: Use local64_try_cmpxchg in amdgpu_perf_read 2023-08-09 18:08:51 -04:00
amdkfd drm/amdgpu: remove unused functions and variables 2023-08-07 17:14:07 -04:00
amdxcp drm/amdxcp: fix Makefile to build amdxcp module 2023-06-09 12:32:53 -04:00
display drm/amd/display: Get replay info from VSDB 2023-08-09 09:46:04 -04:00
include drm/amdgpu: Add pci usage to nbio v7.9 2023-08-09 09:46:05 -04:00
pm drm/amd/pm: Clean up errors in smu73_discrete.h 2023-08-09 09:44:02 -04:00