OSDN Git Service

drm/amdgpu: store HW IP versions in the driver structure
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 20 Jul 2021 20:01:41 +0000 (16:01 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Oct 2021 19:22:58 +0000 (15:22 -0400)
So we can check the IP versions directly rather than using
asic type.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index cdb963b..61ef0d8 100644 (file)
@@ -760,6 +760,9 @@ enum amd_hw_ip_block_type {
 
 #define HWIP_MAX_INSTANCE      10
 
+#define HW_ID_MAX              300
+#define IP_VERSION(mj, mn, rv) (((mj) << 16) | ((mn) << 8) | (rv))
+
 struct amd_powerplay {
        void *pp_handle;
        const struct amd_pm_funcs *pp_funcs;
@@ -1090,6 +1093,7 @@ struct amdgpu_device {
        struct pci_saved_state          *pci_state;
 
        struct amdgpu_reset_control     *reset_cntl;
+       uint32_t                        ip_versions[HW_ID_MAX];
 };
 
 static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
index cbe817a..d195b81 100644 (file)
@@ -30,7 +30,6 @@
 #define mmMM_INDEX             0x0
 #define mmMM_INDEX_HI          0x6
 #define mmMM_DATA              0x1
-#define HW_ID_MAX              300
 
 static const char *hw_id_names[HW_ID_MAX] = {
        [MP1_HWID]              = "MP1",