Skip to contentSkip to conversation

drm/amdgpu: save VCN instances init info before jpeg init

PATCH In review Lin.Cao 2 participants 2 messages Oct 10, 2023

Subsystems (2)
lore
Share & tools
lore

Lin.Cao

author
#0 lore raw

PATCH 1/1 drm/amdgpu: save VCN instances init info before jpeg init

JPEG init header will overwirte vcn init header info which will loss some debug information

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +4 -0
index a3768aefb6b6..bc38b90f8cf8 100644
@@ -431,6 +431,10 @@ static int jpeg_v4_0_start_sriov(struct amdgpu_device *adev)
 	end.cmd_header.command_type =
 		MMSCH_COMMAND__END;
 
+	size = sizeof(struct mmsch_v4_0_init_header);
+	table_loc = (uint32_t *)table->cpu_addr;
+	memcpy(&header, (void *)table_loc, size);
+
 	header.version = MMSCH_VERSION;
 	header.total_size = RREG32_SOC15(VCN, 0, regMMSCH_VF_CTX_SIZE);
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Best Regards,
JingWen Chen

Quoted 23 lines · Lin.Cao

JPEG init header will overwirte vcn init header info which will loss some debug information

---
  drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +4 -0
index a3768aefb6b6..bc38b90f8cf8 100644
@@ -431,6 +431,10 @@ static int jpeg_v4_0_start_sriov(struct amdgpu_device *adev)
  	end.cmd_header.command_type =
  		MMSCH_COMMAND__END;
 
+	size = sizeof(struct mmsch_v4_0_init_header);
+	table_loc = (uint32_t *)table->cpu_addr;
+	memcpy(&header, (void *)table_loc, size);
+
  	header.version = MMSCH_VERSION;
  	header.total_size = RREG32_SOC15(VCN, 0, regMMSCH_VF_CTX_SIZE);