FW: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue
Gao, Likun
Likun.Gao at amd.com
Fri May 19 11:16:54 UTC 2023
[AMD Official Use Only - General]
From: Likun Gao <Likun.Gao at amd.com>
Fix NULL pointer issue for vga_set_state function as not all the ASIC need this operation.
Signed-off-by: Likun Gao <Likun.Gao at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ce196badf42d..5af954abd5ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1260,7 +1260,8 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
/*
* ASICs macro.
*/
-#define amdgpu_asic_set_vga_state(adev, state) (adev)->asic_funcs->set_vga_state((adev), (state))
+#define amdgpu_asic_set_vga_state(adev, state) \
+ ((adev)->asic_funcs->set_vga_state ?
+(adev)->asic_funcs->set_vga_state((adev), (state)) : 0)
#define amdgpu_asic_reset(adev) (adev)->asic_funcs->reset((adev)) #define amdgpu_asic_reset_method(adev) (adev)->asic_funcs->reset_method((adev))
#define amdgpu_asic_get_xclk(adev) (adev)->asic_funcs->get_xclk((adev))
--
2.34.1
More information about the amd-gfx
mailing list