[Mesa-dev] [PATCH 1/2] amd/common: get ME/PFP/CE firmware feature versions as well

Nicolai Hähnle nhaehnle at gmail.com
Mon Sep 11 15:01:34 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/amd/common/ac_gpu_info.c                  | 10 ++++++----
 src/amd/common/ac_gpu_info.h                  |  3 +++
 src/gallium/drivers/radeon/r600_pipe_common.c |  3 +++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index e55d864187d..d10b0eb0af9 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -93,21 +93,20 @@ static bool has_syncobj(int fd)
 }
 
 bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
 		       struct radeon_info *info,
 		       struct amdgpu_gpu_info *amdinfo)
 {
 	struct amdgpu_buffer_size_alignments alignment_info = {};
 	struct amdgpu_heap_info vram, vram_vis, gtt;
 	struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {}, vcn_dec = {};
 	uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;
-	uint32_t unused_feature;
 	int r, i, j;
 	drmDevicePtr devinfo;
 
 	/* Get PCI info. */
 	r = drmGetDevice2(fd, 0, &devinfo);
 	if (r) {
 		fprintf(stderr, "amdgpu: drmGetDevice2 failed.\n");
 		return false;
 	}
 	info->pci_domain = devinfo->businfo.pci->domain;
@@ -169,35 +168,38 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
 
 	if (info->drm_major == 3 && info->drm_minor >= 17) {
 		r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_VCN_DEC, 0, &vcn_dec);
 		if (r) {
 			fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(vcn_dec) failed.\n");
 			return false;
 		}
 	}
 
 	r = amdgpu_query_firmware_version(dev, AMDGPU_INFO_FW_GFX_ME, 0, 0,
-					&info->me_fw_version, &unused_feature);
+					&info->me_fw_version,
+					&info->me_fw_feature);
 	if (r) {
 		fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(me) failed.\n");
 		return false;
 	}
 
 	r = amdgpu_query_firmware_version(dev, AMDGPU_INFO_FW_GFX_PFP, 0, 0,
-					&info->pfp_fw_version, &unused_feature);
+					&info->pfp_fw_version,
+					&info->pfp_fw_feature);
 	if (r) {
 		fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(pfp) failed.\n");
 		return false;
 	}
 
 	r = amdgpu_query_firmware_version(dev, AMDGPU_INFO_FW_GFX_CE, 0, 0,
-					&info->ce_fw_version, &unused_feature);
+					&info->ce_fw_version,
+					&info->ce_fw_feature);
 	if (r) {
 		fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(ce) failed.\n");
 		return false;
 	}
 
 	r = amdgpu_query_firmware_version(dev, AMDGPU_INFO_FW_UVD, 0, 0,
 					&uvd_version, &uvd_feature);
 	if (r) {
 		fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(uvd) failed.\n");
 		return false;
diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
index 06b0c775466..5722709d24f 100644
--- a/src/amd/common/ac_gpu_info.h
+++ b/src/amd/common/ac_gpu_info.h
@@ -59,22 +59,25 @@ struct radeon_info {
 	uint32_t                    min_alloc_size;
 	bool                        has_dedicated_vram;
 	bool                        has_virtual_memory;
 	bool                        gfx_ib_pad_with_type2;
 	bool                        has_hw_decode;
 	uint32_t                    num_sdma_rings;
 	uint32_t                    num_compute_rings;
 	uint32_t                    uvd_fw_version;
 	uint32_t                    vce_fw_version;
 	uint32_t                    me_fw_version;
+	uint32_t                    me_fw_feature;
 	uint32_t                    pfp_fw_version;
+	uint32_t                    pfp_fw_feature;
 	uint32_t                    ce_fw_version;
+	uint32_t                    ce_fw_feature;
 	uint32_t                    vce_harvest_config;
 	uint32_t                    clock_crystal_freq;
 	uint32_t                    tcc_cache_line_size;
 
 	/* Kernel info. */
 	uint32_t                    drm_major; /* version */
 	uint32_t                    drm_minor;
 	uint32_t                    drm_patchlevel;
 	bool                        has_userptr;
 	bool                        has_syncobj;
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index a5678faf89b..4b3ea327634 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -1499,22 +1499,25 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
 		printf("min_alloc_size = %u\n", rscreen->info.min_alloc_size);
 		printf("has_dedicated_vram = %u\n", rscreen->info.has_dedicated_vram);
 		printf("has_virtual_memory = %i\n", rscreen->info.has_virtual_memory);
 		printf("gfx_ib_pad_with_type2 = %i\n", rscreen->info.gfx_ib_pad_with_type2);
 		printf("has_hw_decode = %u\n", rscreen->info.has_hw_decode);
 		printf("num_sdma_rings = %i\n", rscreen->info.num_sdma_rings);
 		printf("num_compute_rings = %u\n", rscreen->info.num_compute_rings);
 		printf("uvd_fw_version = %u\n", rscreen->info.uvd_fw_version);
 		printf("vce_fw_version = %u\n", rscreen->info.vce_fw_version);
 		printf("me_fw_version = %i\n", rscreen->info.me_fw_version);
+		printf("me_fw_feature = %i\n", rscreen->info.me_fw_feature);
 		printf("pfp_fw_version = %i\n", rscreen->info.pfp_fw_version);
+		printf("pfp_fw_feature = %i\n", rscreen->info.pfp_fw_feature);
 		printf("ce_fw_version = %i\n", rscreen->info.ce_fw_version);
+		printf("ce_fw_feature = %i\n", rscreen->info.ce_fw_feature);
 		printf("vce_harvest_config = %i\n", rscreen->info.vce_harvest_config);
 		printf("clock_crystal_freq = %i\n", rscreen->info.clock_crystal_freq);
 		printf("tcc_cache_line_size = %u\n", rscreen->info.tcc_cache_line_size);
 		printf("drm = %i.%i.%i\n", rscreen->info.drm_major,
 		       rscreen->info.drm_minor, rscreen->info.drm_patchlevel);
 		printf("has_userptr = %i\n", rscreen->info.has_userptr);
 		printf("has_syncobj = %u\n", rscreen->info.has_syncobj);
 
 		printf("r600_max_quad_pipes = %i\n", rscreen->info.r600_max_quad_pipes);
 		printf("max_shader_clock = %i\n", rscreen->info.max_shader_clock);
-- 
2.11.0



More information about the mesa-dev mailing list