]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Fix invalid context error in dml helper
authorRoman Li <Roman.Li@amd.com>
Mon, 14 Apr 2025 16:56:48 +0000 (12:56 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 May 2025 22:07:44 +0000 (18:07 -0400)
commit9984db63742099ee3f3cff35cf71306d10e64356
tree5fa7b0d945299b913940682627c8f2408233f019
parent92a09c47464d040866cf2b4cd052bc60555185fb
drm/amd/display: Fix invalid context error in dml helper

[Why]
"BUG: sleeping function called from invalid context" error.
after:
"drm/amd/display: Protect FPU in dml2_validate()/dml21_validate()"

The populate_dml_plane_cfg_from_plane_state() uses the GFP_KERNEL flag
for memory allocation, which shouldn't be used in atomic contexts.

The allocation is needed only for using another helper function
get_scaler_data_for_plane().

[How]
Modify helpers to pass a pointer to scaler_data within existing context,
eliminating the need for dynamic memory allocation/deallocation
and copying.

Fixes: 366e77cd4923 ("drm/amd/display: Protect FPU in dml2_validate()/dml21_validate()")
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bd3e84bc98f81b44f2c43936bdadc3241d654259)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c