]> git.itanic.dy.fi Git - linux-stable/commit
drm/amd/pm: parse pp_handle under appropriate conditions
authorGuchun Chen <guchun.chen@amd.com>
Fri, 5 May 2023 05:20:11 +0000 (13:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:34:20 +0000 (09:34 -0400)
commit9d7a348d368ccd940242d4aa68292cf665f6d474
treeb7e7e9126e52f9c80ca20cdb02b0684dcb992c79
parent187916e6ed9d0c3b3abc27429f7a5f8c936bd1f0
drm/amd/pm: parse pp_handle under appropriate conditions

amdgpu_dpm_is_overdrive_supported is a common API across all
asics, so we should cast pp_handle into correct structure
under different power frameworks.

v2: using return directly to simplify code
v3: SI asic does not carry od_enabled member in pp_handle, and update Fixes tag

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2541
Fixes: eb4900aa4c49 ("drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions")
Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_dpm.c