Skip to contentSkip to conversation

drm/radeon: fix MAX_POWER_SHIFT value

PATCH Applied Alexandre Demers 2 participants 3 messages Mar 22, 2025 – Mar 24, 2025

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

PATCH 5/6 drm/radeon: fix MAX_POWER_SHIFT value

While I don't think it is being used anywhere, if it were used, it would be wrong. We can base this assumption on MAX_POWER_MASK, where the shift is by 16 bits.

---
 drivers/gpu/drm/radeon/sid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/sid.h +1 -1
index 65a911ddd509..f9267b026f8d 100644
@@ -1109,7 +1109,7 @@
 #define		MIN_POWER_SHIFT				0
 #define		MAX_POWER(x)				((x) << 16)
 #define		MAX_POWER_MASK				(0x3fff << 16)
-#define		MAX_POWER_SHIFT				0
+#define		MAX_POWER_SHIFT				16
 #define SQ_POWER_THROTTLE2                              0x8e5c
 #define		MAX_POWER_DELTA(x)			((x) << 0)
 #define		MAX_POWER_DELTA_MASK			(0x3fff << 0)
Signature · 1 line
2.49.0
#1 lore raw

The title's prefix should only indicate [PATCH]. It was part of the series just sent a moment ago, but it was removed from it because it concerned drm/radeon.
Alexandre

Quoted 26 lines · Alexandre Demers

While I don't think it is being used anywhere, if it were used, it would be wrong. We can base this assumption on MAX_POWER_MASK, where the shift is by 16 bits.

---
 drivers/gpu/drm/radeon/sid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/sid.h +1 -2
index 65a911ddd509..f9267b026f8d 100644
@@ -1109,7 +1109,7 @@
 #define                MIN_POWER_SHIFT                         0
 #define                MAX_POWER(x)                            ((x) << 16)
 #define                MAX_POWER_MASK                          (0x3fff << 16)
-#define                MAX_POWER_SHIFT                         0
+#define                MAX_POWER_SHIFT                         16
 #define SQ_POWER_THROTTLE2                              0x8e5c
 #define                MAX_POWER_DELTA(x)                      ((x) << 0)
 #define                MAX_POWER_DELTA_MASK                    (0x3fff << 0)
--

2.49.0

Applied
#2 lore raw
In reply to Alexandre Demers

Applied. Thanks.

Alex

Quoted 26 lines · Alexandre Demers

While I don't think it is being used anywhere, if it were used, it would be wrong. We can base this assumption on MAX_POWER_MASK, where the shift is by 16 bits.

---
 drivers/gpu/drm/radeon/sid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/sid.h +1 -2
index 65a911ddd509..f9267b026f8d 100644
@@ -1109,7 +1109,7 @@
 #define                MIN_POWER_SHIFT                         0
 #define                MAX_POWER(x)                            ((x) << 16)
 #define                MAX_POWER_MASK                          (0x3fff << 16)
-#define                MAX_POWER_SHIFT                         0
+#define                MAX_POWER_SHIFT                         16
 #define SQ_POWER_THROTTLE2                              0x8e5c
 #define                MAX_POWER_DELTA(x)                      ((x) << 0)
 #define                MAX_POWER_DELTA_MASK                    (0x3fff << 0)
--

2.49.0