Skip to contentSkip to conversation

drm/amdgpu: Bypass asd if display hw is not available

PATCH In review Hawking Zhang 2 participants 3 messages Mar 29, 2024 – Apr 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Bypass asd if display hw is not available

ASD is not needed by headless GPU.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -0
index 94b310fdb719d..063203865bbe2 100644
@@ -1053,6 +1053,11 @@ static int psp_asd_initialize(struct psp_context *psp)
 	if (amdgpu_sriov_vf(psp->adev) || !psp->asd_context.bin_desc.size_bytes)
 		return 0;
 
+	/* bypass asd if display hardware is not available */
+	if (!amdgpu_device_has_display_hardware(psp->adev) &&
+	    amdgpu_ip_version(adev, MP0_HWIP, 0) >= IP_VERSION(13, 0, 10))
+		return 0;
+
 	psp->asd_context.mem_context.shared_mc_addr  = 0;
 	psp->asd_context.mem_context.shared_mem_size = PSP_ASD_SHARED_MEM_SIZE;
 	psp->asd_context.ta_load_type                = GFX_CMD_ID_LOAD_ASD;
Signature · 1 line
2.17.1
#1 lore raw

[AMD Official Use Only - General]

Please ignore this one. will send v2

Regards,
Hawking

-----Original Message-----
From: Hawking Zhang <[email protected]>
Sent: Friday, March 29, 2024 17:49
To: [email protected]; Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: Bypass asd if display hw is not available

ASD is not needed by headless GPU.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -0
index 94b310fdb719d..063203865bbe2 100644
@@ -1053,6 +1053,11 @@ static int psp_asd_initialize(struct psp_context *psp)
        if (amdgpu_sriov_vf(psp->adev) || !psp->asd_context.bin_desc.size_bytes)
                return 0;
 
+       /* bypass asd if display hardware is not available */
+       if (!amdgpu_device_has_display_hardware(psp->adev) &&
+           amdgpu_ip_version(adev, MP0_HWIP, 0) >= IP_VERSION(13, 0, 10))
+               return 0;
+
        psp->asd_context.mem_context.shared_mc_addr  = 0;
        psp->asd_context.mem_context.shared_mem_size = PSP_ASD_SHARED_MEM_SIZE;
        psp->asd_context.ta_load_type                = GFX_CMD_ID_LOAD_ASD;

--
2.17.1

#2 lore raw
In reply to Hawking Zhang

Am 29.03.24 um 10:49 schrieb Hawking Zhang:

Quoted 1 line

ASD is not needed by headless GPU.

Oh, that's actually not correct.

We have some hw workarounds in the ASD firmware which are necessary even if the actual functionality of the fw isn't needed.

Only when the fw binary isn't provided at all we should skip this.

Regards,
Christian.

Quoted 22 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -0
index 94b310fdb719d..063203865bbe2 100644
@@ -1053,6 +1053,11 @@ static int psp_asd_initialize(struct psp_context *psp)
  	if (amdgpu_sriov_vf(psp->adev) || !psp->asd_context.bin_desc.size_bytes)
  		return 0;
 
+	/* bypass asd if display hardware is not available */
+	if (!amdgpu_device_has_display_hardware(psp->adev) &&
+	    amdgpu_ip_version(adev, MP0_HWIP, 0) >= IP_VERSION(13, 0, 10))
+		return 0;
+
  	psp->asd_context.mem_context.shared_mc_addr  = 0;
  	psp->asd_context.mem_context.shared_mem_size = PSP_ASD_SHARED_MEM_SIZE;
  	psp->asd_context.ta_load_type                = GFX_CMD_ID_LOAD_ASD;