]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/pm: Add PMFW message and capability flags
authorLijo Lazar <lijo.lazar@amd.com>
Thu, 21 Mar 2024 13:22:39 +0000 (18:52 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 02:13:43 +0000 (22:13 -0400)
Add flags to categorize messages and PMFW capabilities.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

index 5dd092703b8dcb96da24dd1a3dc6324c382feaa5..0917dec8efe35c780144d6422019253e0ca0dbcb 100644 (file)
@@ -459,7 +459,7 @@ struct smu_umd_pstate_table {
 struct cmn2asic_msg_mapping {
        int     valid_mapping;
        int     map_to;
-       int     valid_in_vf;
+       uint32_t flags;
 };
 
 struct cmn2asic_mapping {
@@ -539,6 +539,7 @@ struct smu_context {
        uint32_t smc_driver_if_version;
        uint32_t smc_fw_if_version;
        uint32_t smc_fw_version;
+       uint32_t smc_fw_caps;
 
        bool uploading_custom_pp_table;
        bool dc_controlled_by_gpio;
@@ -1485,8 +1486,8 @@ enum smu_baco_seq {
        BACO_SEQ_COUNT,
 };
 
-#define MSG_MAP(msg, index, valid_in_vf) \
-       [SMU_MSG_##msg] = {1, (index), (valid_in_vf)}
+#define MSG_MAP(msg, index, flags) \
+       [SMU_MSG_##msg] = {1, (index), (flags)}
 
 #define CLK_MAP(clk, index) \
        [SMU_##clk] = {1, (index)}
index af427cc7dbb8450862484e27010e7d495fa28bb2..c48214e3dc8e42a1faf01f08469b1ec600714adb 100644 (file)
@@ -445,4 +445,11 @@ enum smu_feature_mask {
        SMU_FEATURE_COUNT,
 };
 
+/* Message category flags */
+#define SMU_MSG_VF_FLAG                        (1U << 0)
+#define SMU_MSG_RAS_PRI                        (1U << 1)
+
+/* Firmware capability flags */
+#define SMU_FW_CAP_RAS_PRI             (1U << 0)
+
 #endif
index b8dbd4e2534881e3cba8013d25998e40e1396a1a..3227e514e8ae391e8eeb91ddc8b82ba066ff6b61 100644 (file)
@@ -437,7 +437,7 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu,
                        return -EINVAL;
 
                if (amdgpu_sriov_vf(smu->adev) &&
-                   !msg_mapping.valid_in_vf)
+                   !(msg_mapping.flags & SMU_MSG_VF_FLAG))
                        return -EACCES;
 
                return msg_mapping.map_to;