diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2023-09-21 16:15:13 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-10-05 17:50:50 -0400 |
commit | de5e73dc6baf4a2969493a2f16aed3fe222eb363 (patch) | |
tree | a176ea28a474993ffefda660ed9151e9e412b6c7 /drivers/gpu/drm/tests | |
parent | 9c77dcf6a5b179a9574b2f9633c6e2cdf52fafec (diff) |
drm/amd/display: Simplify the per-CPU usage.
The fpu_recursion_depth counter is used to ensure that dc_fpu_begin()
can be invoked multiple times while the FPU-disable function itself is
only invoked once. Also the counter part (dc_fpu_end()) is ballanced
properly.
Instead of using the get_cpu_ptr() dance around the inc it is simpler to
increment the per-CPU variable directly. Also the per-CPU variable has
to be incremented and decremented on the same CPU. This is ensured by
the inner-part which disables preemption. This is kind of not obvious,
works and the preempt-counter is touched a few times for no reason.
Disable preemption before incrementing fpu_recursion_depth for the first
time. Keep preemption disabled until dc_fpu_end() where the counter is
decremented making it obvious that the preemption has to stay disabled
while the counter is non-zero.
Use simple inc/dec functions.
Remove the nested preempt_disable/enable functions which are now not
needed.
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/tests')
0 files changed, 0 insertions, 0 deletions