[PATCH 2/3] drm/amdgpu/gfx9: Refactor cleaner shader initialization for GFX9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This commit modifies the initialization only if the cleaner shader
object has been allocated. This is done by adding checks for
adev->gfx.cleaner_shader_obj before calling
amdgpu_gfx_cleaner_shader_init

The changes are made in the gfx_v9_0_hw_init functions These functions
are responsible for initializing software components of the GFX v9.0.

This change prevents unnecessary function calls and makes the control
flow of the program clearer. It also ensures that the cleaner shader is
only initialized when it has been properly allocated.

Fixes: 776ad43d4170 ("drm/amdgpu/gfx9: Implement cleaner shader support for GFX9 hardware")
Cc: Christian König <christian.koenig@xxxxxxx>
Cc: Alex Deucher <alexander.deucher@xxxxxxx>
Suggested-by: Christian König <christian.koenig@xxxxxxx>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 23f0573ae47b..d6d07cfd279e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3975,8 +3975,8 @@ static int gfx_v9_0_hw_init(void *handle)
 	int r;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-	amdgpu_gfx_cleaner_shader_init(adev, adev->gfx.cleaner_shader_size,
-				       adev->gfx.cleaner_shader_ptr);
+	if (adev->gfx.cleaner_shader_obj)
+		amdgpu_gfx_cleaner_shader_init(adev);
 
 	if (!amdgpu_sriov_vf(adev))
 		gfx_v9_0_init_golden_registers(adev);
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux