Skip to contentSkip to conversation

DMCU firmware version storing and access

PATCH In review David Francis 2 participants 4 messages Sep 13, 2018 – Sep 14, 2018 1 message not in the archive

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

cover DMCU firmware version storing and access

David Francis (2):
drm/amd/display: Add DMCU firmware version drm/amdgpu: Add DMCU to firmware query interface

 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c           | 12 ++++++++++++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  1 +
 include/uapi/drm/amdgpu_drm.h                     |  2 ++
 4 files changed, 17 insertions(+)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180913194514.23224-1-David.Francis-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/2 drm/amd/display: Add DMCU firmware version

Read the version number from the common firmware header and store it in the dm struct

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 +
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index f0ae11802e9a..d21d738c8356 100644
@@ -589,6 +589,8 @@ static int load_dmcu_fw(struct amdgpu_device *adev)
 	adev->firmware.fw_size +=
 		ALIGN(le32_to_cpu(hdr->intv_size_bytes), PAGE_SIZE);
 
+	adev->dm.dmcu_fw_version = le32_to_cpu(hdr->header.ucode_version);
+
 	DRM_DEBUG_KMS("PSP loading DMCU firmware\n");
 
 	return 0;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -0
index 9a57c654943a..b6fe9adf4b93 100644
@@ -131,6 +131,7 @@ struct amdgpu_display_manager {
 	struct dm_comressor_info compressor;
 
 	const struct firmware *fw_dmcu;
+	uint32_t dmcu_fw_version;
 };
 
 struct amdgpu_dm_connector {
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 2/2 drm/amdgpu: Add DMCU to firmware query interface

In reply to a message not in the archive

DMCU firmware version can be read using the AMDGPU_INFO ioctl or the amdgpu_firmware_info debugfs entry

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 12 ++++++++++++
 include/uapi/drm/amdgpu_drm.h           |  2 ++
 2 files changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +12 -0
index 29ac3873eeb0..f5caf873f008 100644
@@ -257,6 +257,10 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info,
 		fw_info->ver = adev->psp.asd_fw_version;
 		fw_info->feature = adev->psp.asd_feature_version;
 		break;
+	case AMDGPU_INFO_FW_DMCU:
+		fw_info->ver = adev->dm.dmcu_fw_version;
+		fw_info->feature = 0;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -1296,6 +1300,14 @@ static int amdgpu_debugfs_firmware_info(struct seq_file *m, void *data)
 	seq_printf(m, "VCN feature version: %u, firmware version: 0x%08x\n",
 		   fw_info.feature, fw_info.ver);
 
+	/* DMCU */
+	query_fw.fw_type = AMDGPU_INFO_FW_DMCU;
+	ret = amdgpu_firmware_info(&fw_info, &query_fw, adev);
+	if (ret)
+		return ret;
+	seq_printf(m, "DMCU feature version: %u, firmware version: 0x%08x\n",
+		   fw_info.feature, fw_info.ver);
+
 
 	seq_printf(m, "VBIOS version: %s\n", ctx->vbios_version);
 
include/uapi/drm/amdgpu_drm.h +2 -0
index 94444eeba55b..6a0d77dcfc47 100644
@@ -668,6 +668,8 @@ struct drm_amdgpu_cs_chunk_data {
 	#define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_GPM_MEM 0x10
 	/* Subquery id: Query GFX RLC SRLS firmware version */
 	#define AMDGPU_INFO_FW_GFX_RLC_RESTORE_LIST_SRM_MEM 0x11
+	/* Subquery id: Query DMCU firmware version */
+	#define AMDGPU_INFO_FW_DMCU		0x12
 /* number of bytes moved for TTM migration */
 #define AMDGPU_INFO_NUM_BYTES_MOVED		0x0f
 /* the used VRAM size */
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw
In reply to a message not in the archive
Quoted 3 lines · David Francis

David Francis (2):
drm/amd/display: Add DMCU firmware version drm/amdgpu: Add DMCU to firmware query interface

Thanks David. As these patches, we can also monitor the ucode at amdgpu_firmware_info interface.

Series are Reviewed-by: Huang Rui <[email protected]>

Quoted 14 lines
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c           | 12 ++++++++++++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  1 +
 include/uapi/drm/amdgpu_drm.h                     |  2 ++
 4 files changed, 17 insertions(+)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx