[PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue

Xu, Feifei Feifei.Xu at amd.com
Mon May 22 02:02:46 UTC 2023


[AMD Official Use Only - General]

Reviewed-by: Feifei Xu <Feifei.Xu at amd.com>



-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Gao, Likun
Sent: Friday, May 19, 2023 7:17 PM
To: amd-gfx list <amd-gfx at lists.freedesktop.org>
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: FW: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue

[AMD Official Use Only - General]

[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