Skip to contentSkip to conversation

drm/amd/powerplay: Fix enum mismatch

PATCH Applied Matthias Kaehlcke 3 participants 3 messages Feb 7, 2018

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

PATCH 1/1 drm/amd/powerplay: Fix enum mismatch

In several locations the driver uses AMD_CG_STATE_UNGATE (type enum amd_clockgating_state) instead of AMD_PG_STATE_UNGATE (type enum amd_powergating_stat) and vice versa. Both constants have the same value, so this doesn't cause any problems, but we still want to pass the correct type.

Fixing the mismatch resolves multiple warnings like this when building with clang:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:169:7:
error: implicit conversion from enumeration type 'enum amd_powergating_state' to different enumeration type 'enum amd_clockgating_state' [-Werror,-Wenum-conversion]

    AMD_PG_STATE_UNGATE);
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c   | 8 ++++----
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +4 -4
index 44de0874629f..416abebb8b86 100644
@@ -166,10 +166,10 @@ void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
 		cz_dpm_powerup_uvd(hwmgr);
 		cgs_set_clockgating_state(hwmgr->device,
 						AMD_IP_BLOCK_TYPE_UVD,
-						AMD_PG_STATE_UNGATE);
+						AMD_CG_STATE_UNGATE);
 		cgs_set_powergating_state(hwmgr->device,
 						AMD_IP_BLOCK_TYPE_UVD,
-						AMD_CG_STATE_UNGATE);
+						AMD_PG_STATE_UNGATE);
 		cz_dpm_update_uvd_dpm(hwmgr, false);
 	}
 
@@ -197,11 +197,11 @@ void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
 		cgs_set_clockgating_state(
 					hwmgr->device,
 					AMD_IP_BLOCK_TYPE_VCE,
-					AMD_PG_STATE_UNGATE);
+					AMD_CG_STATE_UNGATE);
 		cgs_set_powergating_state(
 					hwmgr->device,
 					AMD_IP_BLOCK_TYPE_VCE,
-					AMD_CG_STATE_UNGATE);
+					AMD_PG_STATE_UNGATE);
 		cz_dpm_update_vce_dpm(hwmgr);
 		cz_enable_disable_vce_dpm(hwmgr, true);
 	}
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +1 -1
index 69a0678ace98..402aa9cb1f78 100644
@@ -162,7 +162,7 @@ void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
 				AMD_CG_STATE_UNGATE);
 		cgs_set_powergating_state(hwmgr->device,
 						AMD_IP_BLOCK_TYPE_UVD,
-						AMD_CG_STATE_UNGATE);
+						AMD_PG_STATE_UNGATE);
 		smu7_update_uvd_dpm(hwmgr, false);
 	}
 
Signature · 6 lines
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Matthias Kaehlcke

In several locations the driver uses AMD_CG_STATE_UNGATE (type enum amd_clockgating_state) instead of AMD_PG_STATE_UNGATE (type enum amd_powergating_stat) and vice versa. Both constants have the same value, so this doesn't cause any problems, but we still want to pass the correct type.

Fixing the mismatch resolves multiple warnings like this when building with clang:

Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:169:7:
error: implicit conversion from enumeration type 'enum amd_powergating_state' to different enumeration type 'enum amd_clockgating_state' [-Werror,-Wenum-conversion]

    AMD_PG_STATE_UNGATE);
Quoted 52 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c   | 8 ++++----
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +4 -4
index 44de0874629f..416abebb8b86 100644
@@ -166,10 +166,10 @@ void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
                cz_dpm_powerup_uvd(hwmgr);
                cgs_set_clockgating_state(hwmgr->device,
                                                AMD_IP_BLOCK_TYPE_UVD,
-                                               AMD_PG_STATE_UNGATE);
+                                               AMD_CG_STATE_UNGATE);
                cgs_set_powergating_state(hwmgr->device,
                                                AMD_IP_BLOCK_TYPE_UVD,
-                                               AMD_CG_STATE_UNGATE);
+                                               AMD_PG_STATE_UNGATE);
                cz_dpm_update_uvd_dpm(hwmgr, false);
        }
 
@@ -197,11 +197,11 @@ void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
                cgs_set_clockgating_state(
                                        hwmgr->device,
                                        AMD_IP_BLOCK_TYPE_VCE,
-                                       AMD_PG_STATE_UNGATE);
+                                       AMD_CG_STATE_UNGATE);
                cgs_set_powergating_state(
                                        hwmgr->device,
                                        AMD_IP_BLOCK_TYPE_VCE,
-                                       AMD_CG_STATE_UNGATE);
+                                       AMD_PG_STATE_UNGATE);
                cz_dpm_update_vce_dpm(hwmgr);
                cz_enable_disable_vce_dpm(hwmgr, true);
        }
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +1 -2
index 69a0678ace98..402aa9cb1f78 100644
@@ -162,7 +162,7 @@ void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
                                AMD_CG_STATE_UNGATE);
                cgs_set_powergating_state(hwmgr->device,
                                                AMD_IP_BLOCK_TYPE_UVD,
-                                               AMD_CG_STATE_UNGATE);
+                                               AMD_PG_STATE_UNGATE);
                smu7_update_uvd_dpm(hwmgr, false);
        }
 
--

2.16.0.rc1.238.g530d649a79-goog

Applied
#2 lore raw
Quoted 16 lines · Guenter Roeck
Quoted 15 lines · Matthias Kaehlcke

In several locations the driver uses AMD_CG_STATE_UNGATE (type enum amd_clockgating_state) instead of AMD_PG_STATE_UNGATE (type enum amd_powergating_stat) and vice versa. Both constants have the same value, so this doesn't cause any problems, but we still want to pass the correct type.

Fixing the mismatch resolves multiple warnings like this when building with clang:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/cz_clockpowergating.c:169:7:
error: implicit conversion from enumeration type 'enum amd_powergating_state' to different enumeration type 'enum amd_clockgating_state' [-Werror,-Wenum-conversion]

    AMD_PG_STATE_UNGATE);
Quoted 3 lines
Quoted 1 line

Applied. thanks!

Alex

Quoted 50 lines
Quoted 50 lines
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c   | 8 ++++----
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +4 -4
index 44de0874629f..416abebb8b86 100644
@@ -166,10 +166,10 @@ void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
                cz_dpm_powerup_uvd(hwmgr);
                cgs_set_clockgating_state(hwmgr->device,
                                                AMD_IP_BLOCK_TYPE_UVD,
-                                               AMD_PG_STATE_UNGATE);
+                                               AMD_CG_STATE_UNGATE);
                cgs_set_powergating_state(hwmgr->device,
                                                AMD_IP_BLOCK_TYPE_UVD,
-                                               AMD_CG_STATE_UNGATE);
+                                               AMD_PG_STATE_UNGATE);
                cz_dpm_update_uvd_dpm(hwmgr, false);
        }
 
@@ -197,11 +197,11 @@ void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
                cgs_set_clockgating_state(
                                        hwmgr->device,
                                        AMD_IP_BLOCK_TYPE_VCE,
-                                       AMD_PG_STATE_UNGATE);
+                                       AMD_CG_STATE_UNGATE);
                cgs_set_powergating_state(
                                        hwmgr->device,
                                        AMD_IP_BLOCK_TYPE_VCE,
-                                       AMD_CG_STATE_UNGATE);
+                                       AMD_PG_STATE_UNGATE);
                cz_dpm_update_vce_dpm(hwmgr);
                cz_enable_disable_vce_dpm(hwmgr, true);
        }
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +1 -1
index 69a0678ace98..402aa9cb1f78 100644
@@ -162,7 +162,7 @@ void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate)
                                AMD_CG_STATE_UNGATE);
                cgs_set_powergating_state(hwmgr->device,
                                                AMD_IP_BLOCK_TYPE_UVD,
-                                               AMD_CG_STATE_UNGATE);
+                                               AMD_PG_STATE_UNGATE);
                smu7_update_uvd_dpm(hwmgr, false);
        }
 
Quoted 7 lines
Quoted 3 lines

--
2.16.0.rc1.238.g530d649a79-goog

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

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