Skip to contentSkip to conversation

drm/amdgpu/powerplay: FEATURE_MASK is 64 bit so use ULL

PATCH In review Alex Deucher 4 participants 6 messages Jun 25, 2019 – Jun 26, 2019 2 messages not in the archive

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

PATCH 1/2 drm/amdgpu/powerplay: FEATURE_MASK is 64 bit so use ULL

ULL is needed for 32 bit arches.

---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +-
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1 -1
index 99b20fed347a..2d43e3dc79f6 100644
@@ -37,7 +37,7 @@
 
 #include "asic_reg/mp/mp_11_0_sh_mask.h"
 
-#define FEATURE_MASK(feature) (1UL << feature)
+#define FEATURE_MASK(feature) (1ULL << feature)
 #define SMC_DPM_FEATURE ( \
 	FEATURE_MASK(FEATURE_DPM_PREFETCHER_BIT) | \
 	FEATURE_MASK(FEATURE_DPM_GFXCLK_BIT)	 | \
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
index 2fc4e2a6fd82..0f14fe14ecd8 100644
@@ -576,7 +576,7 @@ static int vega20_run_btc_afll(struct smu_context *smu)
 	return smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc);
 }
 
-#define FEATURE_MASK(feature) (1UL << feature)
+#define FEATURE_MASK(feature) (1ULL << feature)
 static int
 vega20_get_allowed_feature_mask(struct smu_context *smu,
 				  uint32_t *feature_mask, uint32_t num)
Signature · 6 lines
2.20.1

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

A message that is not in the archive (sent off-list or not yet received): 20190625135830.26173-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu/display: switch udelay to msleep

We may need to sleep for up to 80ms:

/* First DPCD read after VDD ON can fail if the particular board
* does not have HPD pin wired correctly. So if DPCD read fails,
* which it should never happen, retry a few times. Target worst
* case scenario of 80 ms.
*/

Switch udelay to msleep to avoid limits on arm.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index d6f8be654c2e..c17db5c144aa 100644
@@ -550,7 +550,7 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link)
 			break;
 		}
 
-		udelay(8000);
+		msleep(8);
 	}
 
 	ASSERT(status == DC_OK);
Signature · 6 lines
2.20.1

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

A message that is not in the archive (sent off-list or not yet received): 20190625135830.26173-2-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Nicholas Kazlauskas
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu/display: switch udelay to msleep

Quoted 11 lines · Alex Deucher

We may need to sleep for up to 80ms:

/* First DPCD read after VDD ON can fail if the particular board
* does not have HPD pin wired correctly. So if DPCD read fails,
* which it should never happen, retry a few times. Target worst
* case scenario of 80 ms.
*/

Switch udelay to msleep to avoid limits on arm.

Technically this still mismatches what the comment says above the block, but this retains the same behavior as before.

Nicholas Kazlauskas

Quoted 10 lines
---
  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index d6f8be654c2e..c17db5c144aa 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c static void read_edp_current_link_settings_on_detect(struct dc_link *link) · line 556

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
@@ -550,7 +550,7 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link)
  			break;
  		}
 
-		udelay(8000);
+		msleep(8);
  	}
 
  	ASSERT(status == DC_OK);

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

#5 lore raw

RE: [PATCH 2/2] drm/amdgpu/display: switch udelay to msleep

In reply to a message not in the archive

Series is Reviewed-by: Hawking Zhang <[email protected]>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: 2019年6月25日 21:59
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/display: switch udelay to msleep

We may need to sleep for up to 80ms:

/* First DPCD read after VDD ON can fail if the particular board
* does not have HPD pin wired correctly. So if DPCD read fails,
* which it should never happen, retry a few times. Target worst
* case scenario of 80 ms.
*/

Switch udelay to msleep to avoid limits on arm.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index d6f8be654c2e..c17db5c144aa 100644
@@ -550,7 +550,7 @@ static void read_edp_current_link_settings_on_detect(struct dc_link *link)
 			break;
 		}
 
-		udelay(8000);
+		msleep(8);
 	}
 
 	ASSERT(status == DC_OK);
Signature · 10 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Nicholas Kazlauskas
#6 lore raw
In reply to a message not in the archive
Quoted 3 lines · Alex Deucher

ULL is needed for 32 bit arches.

Quoted 24 lines
---
  drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +-
  drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1 -1
index 99b20fed347a..2d43e3dc79f6 100644
@@ -37,7 +37,7 @@
 
  #include "asic_reg/mp/mp_11_0_sh_mask.h"
 
-#define FEATURE_MASK(feature) (1UL << feature)
+#define FEATURE_MASK(feature) (1ULL << feature)
  #define SMC_DPM_FEATURE ( \
  	FEATURE_MASK(FEATURE_DPM_PREFETCHER_BIT) | \
  	FEATURE_MASK(FEATURE_DPM_GFXCLK_BIT)	 | \
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +0 -0
index 2fc4e2a6fd82..0f14fe14ecd8 100644

drivers/gpu/drm/amd/powerplay/vega20_ppt.c static int vega20_run_btc_afll(struct smu_context *smu) · line 582

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
@@ -576,7 +576,7 @@ static int vega20_run_btc_afll(struct smu_context *smu)
  	return smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc);
  }
 
-#define FEATURE_MASK(feature) (1UL << feature)
+#define FEATURE_MASK(feature) (1ULL << feature)
  static int
  vega20_get_allowed_feature_mask(struct smu_context *smu,
  				  uint32_t *feature_mask, uint32_t num)

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

Reviewed-by
#7 lore raw
In reply to a message not in the archive

Best Regards,
Kevin

Quoted 26 lines · Alex Deucher

ULL is needed for 32 bit arches.

---
  drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +-
  drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1 -1
index 99b20fed347a..2d43e3dc79f6 100644
@@ -37,7 +37,7 @@
 
  #include "asic_reg/mp/mp_11_0_sh_mask.h"
 
-#define FEATURE_MASK(feature) (1UL << feature)
+#define FEATURE_MASK(feature) (1ULL << feature)
  #define SMC_DPM_FEATURE ( \
  	FEATURE_MASK(FEATURE_DPM_PREFETCHER_BIT) | \
  	FEATURE_MASK(FEATURE_DPM_GFXCLK_BIT)	 | \
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +0 -0
index 2fc4e2a6fd82..0f14fe14ecd8 100644

drivers/gpu/drm/amd/powerplay/vega20_ppt.c static int vega20_run_btc_afll(struct smu_context *smu) · line 582

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
@@ -576,7 +576,7 @@ static int vega20_run_btc_afll(struct smu_context *smu)
  	return smu_send_smc_msg(smu, SMU_MSG_RunAfllBtc);
  }
 
-#define FEATURE_MASK(feature) (1UL << feature)
+#define FEATURE_MASK(feature) (1ULL << feature)
  static int
  vega20_get_allowed_feature_mask(struct smu_context *smu,
  				  uint32_t *feature_mask, uint32_t num)

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