[Mesa-dev] [PATCH 1/7] winsys/amdgpu: query ME/PFP/CE firmware versions

Nicolai Hähnle nhaehnle at gmail.com
Tue Aug 2 19:41:51 UTC 2016


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

The radeon kernel module doesn't have the firmware query interface, so the
corresponding values will remain 0.
---
 src/gallium/drivers/radeon/r600_pipe_common.c |  3 +++
 src/gallium/drivers/radeon/radeon_winsys.h    |  3 +++
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 22 ++++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index caf2552..edaa0cf 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -1108,6 +1108,9 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
 		printf("gfx_ib_pad_with_type2 = %i\n", rscreen->info.gfx_ib_pad_with_type2);
 		printf("has_sdma = %i\n", rscreen->info.has_sdma);
 		printf("has_uvd = %i\n", rscreen->info.has_uvd);
+		printf("me_fw_version = %i\n", rscreen->info.me_fw_version);
+		printf("pfp_fw_version = %i\n", rscreen->info.pfp_fw_version);
+		printf("ce_fw_version = %i\n", rscreen->info.ce_fw_version);
 		printf("vce_fw_version = %i\n", rscreen->info.vce_fw_version);
 		printf("vce_harvest_config = %i\n", rscreen->info.vce_harvest_config);
 		printf("clock_crystal_freq = %i\n", rscreen->info.clock_crystal_freq);
diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h
index ba56936..50dd92a 100644
--- a/src/gallium/drivers/radeon/radeon_winsys.h
+++ b/src/gallium/drivers/radeon/radeon_winsys.h
@@ -260,6 +260,9 @@ struct radeon_info {
     bool                        has_uvd;
     uint32_t                    uvd_fw_version;
     uint32_t                    vce_fw_version;
+    uint32_t                    me_fw_version;
+    uint32_t                    pfp_fw_version;
+    uint32_t                    ce_fw_version;
     uint32_t                    vce_harvest_config;
     uint32_t                    clock_crystal_freq;
 
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 9a04cbe..1f24fcd 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -99,6 +99,7 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
    struct amdgpu_heap_info vram, gtt;
    struct drm_amdgpu_info_hw_ip dma = {}, uvd = {}, vce = {};
    uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;
+   uint32_t unused_feature;
    int r, i, j;
    drmDevicePtr devinfo;
 
@@ -151,6 +152,27 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
       goto fail;
    }
 
+   r = amdgpu_query_firmware_version(ws->dev, AMDGPU_INFO_FW_GFX_ME, 0, 0,
+				     &ws->info.me_fw_version, &unused_feature);
+   if (r) {
+      fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(me) failed.\n");
+      goto fail;
+   }
+
+   r = amdgpu_query_firmware_version(ws->dev, AMDGPU_INFO_FW_GFX_PFP, 0, 0,
+				     &ws->info.pfp_fw_version, &unused_feature);
+   if (r) {
+      fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(pfp) failed.\n");
+      goto fail;
+   }
+
+   r = amdgpu_query_firmware_version(ws->dev, AMDGPU_INFO_FW_GFX_CE, 0, 0,
+				     &ws->info.ce_fw_version, &unused_feature);
+   if (r) {
+      fprintf(stderr, "amdgpu: amdgpu_query_firmware_version(ce) failed.\n");
+      goto fail;
+   }
+
    r = amdgpu_query_firmware_version(ws->dev, AMDGPU_INFO_FW_UVD, 0, 0,
 				     &uvd_version, &uvd_feature);
    if (r) {
-- 
2.7.4



More information about the mesa-dev mailing list