drm/amd/display: Move the memory allocation out of dcn20_validate_bandwidth_fp().
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 21 Sep 2023 14:15:16 +0000 (16:15 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2023 20:48:08 +0000 (16:48 -0400)
commit2091ac690301fd7b4f64b08f16c251fbb0d95042
treee9871a2a1e8799e9c69ceb616d45c1db758da247
parent941e8036a450bc7ae8517ceb6dbd9135046f4ad8
drm/amd/display: Move the memory allocation out of dcn20_validate_bandwidth_fp().

dcn20_validate_bandwidth_fp() is invoked while FPU access has been
enabled. FPU access requires disabling preemption even on PREEMPT_RT.
It is not possible to allocate memory with disabled preemption even with
GFP_ATOMIC on PREEMPT_RT.

Move the memory allocation before FPU access is enabled.
To preserve previous "clean" state of "pipes" add a memset() before the
second invocation of dcn20_validate_bandwidth_internal() where the
variable is used.

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>
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h