AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version
@ 2022-10-13  5:46 Tim Huang
  2022-10-13  5:46 ` [PATCH 2/2] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 Tim Huang
  2022-10-13 21:35 ` [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Limonciello, Mario
  0 siblings, 2 replies; 5+ messages in thread
From: Tim Huang @ 2022-10-13  5:46 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Yifan1.zhang, Xiaojian.Du, Tim Huang

Update the SMU driver interface version to V7.

Signed-off-by: Tim Huang <tim.huang@amd.com>
---
 .../swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
index ae2d337158f3..f77401709d83 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
@@ -27,7 +27,7 @@
 // *** IMPORTANT ***
 // SMU TEAM: Always increment the interface version if
 // any structure is changed in this file
-#define PMFW_DRIVER_IF_VERSION 5
+#define PMFW_DRIVER_IF_VERSION 7
 
 typedef struct {
   int32_t value;
@@ -163,8 +163,8 @@ typedef struct {
   uint16_t DclkFrequency;               //[MHz]
   uint16_t MemclkFrequency;             //[MHz]
   uint16_t spare;                       //[centi]
-  uint16_t UvdActivity;                 //[centi]
   uint16_t GfxActivity;                 //[centi]
+  uint16_t UvdActivity;                 //[centi]
 
   uint16_t Voltage[2];                  //[mV] indices: VDDCR_VDD, VDDCR_SOC
   uint16_t Current[2];                  //[mA] indices: VDDCR_VDD, VDDCR_SOC
@@ -199,6 +199,19 @@ typedef struct {
   uint16_t DeviceState;
   uint16_t CurTemp;                     //[centi-Celsius]
   uint16_t spare2;
+
+  uint16_t AverageGfxclkFrequency;
+  uint16_t AverageFclkFrequency;
+  uint16_t AverageGfxActivity;
+  uint16_t AverageSocclkFrequency;
+  uint16_t AverageVclkFrequency;
+  uint16_t AverageVcnActivity;
+  uint16_t AverageDRAMReads;          //Filtered DF Bandwidth::DRAM Reads
+  uint16_t AverageDRAMWrites;         //Filtered DF Bandwidth::DRAM Writes
+  uint16_t AverageSocketPower;        //Filtered value of CurrentSocketPower
+  uint16_t AverageCorePower;          //Filtered of [sum of CorePower[8]])
+  uint16_t AverageCoreC0Residency[8]; //Filtered of [average C0 residency %  per core]
+  uint32_t MetricsCounter;            //Counts the # of metrics table parameter reads per update to the metrics table, i.e. if the metrics table update happens every 1 second, this value could be up to 1000 if the smu collected metrics data every cycle, or as low as 0 if the smu was asleep the whole time. Reset to 0 after writing.
 } SmuMetrics_t;
 
 typedef struct {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7
  2022-10-13  5:46 [PATCH 1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Tim Huang
@ 2022-10-13  5:46 ` Tim Huang
  2022-10-13 21:36   ` [2/2] " Limonciello, Mario
  2022-10-13 21:35 ` [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Limonciello, Mario
  1 sibling, 1 reply; 5+ messages in thread
From: Tim Huang @ 2022-10-13  5:46 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Yifan1.zhang, Xiaojian.Du, Tim Huang

The pmfw has changed the driver interface version, so keep same with the
fw.

Signed-off-by: Tim Huang <tim.huang@amd.com>
---
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
index 9d62ea2af132..8f72202aea8e 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
@@ -28,7 +28,7 @@
 #define SMU13_DRIVER_IF_VERSION_INV 0xFFFFFFFF
 #define SMU13_DRIVER_IF_VERSION_YELLOW_CARP 0x04
 #define SMU13_DRIVER_IF_VERSION_ALDE 0x08
-#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x05
+#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x07
 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04
 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0 0x30
 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x2C
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version
  2022-10-13  5:46 [PATCH 1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Tim Huang
  2022-10-13  5:46 ` [PATCH 2/2] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 Tim Huang
@ 2022-10-13 21:35 ` Limonciello, Mario
  2022-10-14  4:53   ` Huang, Tim
  1 sibling, 1 reply; 5+ messages in thread
From: Limonciello, Mario @ 2022-10-13 21:35 UTC (permalink / raw)
  To: Tim Huang, amd-gfx
  Cc: Alexander.Deucher, Yifan1.zhang, Xiaojian.Du, Richard Gong

On 10/13/2022 00:46, Tim Huang wrote:
> Update the SMU driver interface version to V7.
> 
> Signed-off-by: Tim Huang <tim.huang@amd.com>
> ---
>   .../swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h | 17 +++++++++++++++--
>   1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
> index ae2d337158f3..f77401709d83 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
> +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
> @@ -27,7 +27,7 @@
>   // *** IMPORTANT ***
>   // SMU TEAM: Always increment the interface version if
>   // any structure is changed in this file
> -#define PMFW_DRIVER_IF_VERSION 5
> +#define PMFW_DRIVER_IF_VERSION 7
>   
>   typedef struct {
>     int32_t value;
> @@ -163,8 +163,8 @@ typedef struct {
>     uint16_t DclkFrequency;               //[MHz]
>     uint16_t MemclkFrequency;             //[MHz]
>     uint16_t spare;                       //[centi]
> -  uint16_t UvdActivity;                 //[centi]
>     uint16_t GfxActivity;                 //[centi]
> +  uint16_t UvdActivity;                 //[centi]

This is unfortunate, it means that these two flipped based on PMFW 
driver interface version!

With 13.0.4 in 6.0, this should probably come back.

Cc: stable@vger.kernel.org #6.0
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

>   
>     uint16_t Voltage[2];                  //[mV] indices: VDDCR_VDD, VDDCR_SOC
>     uint16_t Current[2];                  //[mA] indices: VDDCR_VDD, VDDCR_SOC
> @@ -199,6 +199,19 @@ typedef struct {
>     uint16_t DeviceState;
>     uint16_t CurTemp;                     //[centi-Celsius]
>     uint16_t spare2;
> +
> +  uint16_t AverageGfxclkFrequency;
> +  uint16_t AverageFclkFrequency;
> +  uint16_t AverageGfxActivity;
> +  uint16_t AverageSocclkFrequency;
> +  uint16_t AverageVclkFrequency;
> +  uint16_t AverageVcnActivity;
> +  uint16_t AverageDRAMReads;          //Filtered DF Bandwidth::DRAM Reads
> +  uint16_t AverageDRAMWrites;         //Filtered DF Bandwidth::DRAM Writes
> +  uint16_t AverageSocketPower;        //Filtered value of CurrentSocketPower
> +  uint16_t AverageCorePower;          //Filtered of [sum of CorePower[8]])
> +  uint16_t AverageCoreC0Residency[8]; //Filtered of [average C0 residency %  per core]
> +  uint32_t MetricsCounter;            //Counts the # of metrics table parameter reads per update to the metrics table, i.e. if the metrics table update happens every 1 second, this value could be up to 1000 if the smu collected metrics data every cycle, or as low as 0 if the smu was asleep the whole time. Reset to 0 after writing.
>   } SmuMetrics_t;
>   
>   typedef struct {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2/2] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7
  2022-10-13  5:46 ` [PATCH 2/2] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 Tim Huang
@ 2022-10-13 21:36   ` Limonciello, Mario
  0 siblings, 0 replies; 5+ messages in thread
From: Limonciello, Mario @ 2022-10-13 21:36 UTC (permalink / raw)
  To: Tim Huang, amd-gfx
  Cc: Alexander.Deucher, Yifan1.zhang, Xiaojian.Du, Richard Gong

On 10/13/2022 00:46, Tim Huang wrote:
> The pmfw has changed the driver interface version, so keep same with the
> fw.
> 
> Signed-off-by: Tim Huang <tim.huang@amd.com>

Cc: stable@vger.kernel.org #6.0
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
> index 9d62ea2af132..8f72202aea8e 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
> +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
> @@ -28,7 +28,7 @@
>   #define SMU13_DRIVER_IF_VERSION_INV 0xFFFFFFFF
>   #define SMU13_DRIVER_IF_VERSION_YELLOW_CARP 0x04
>   #define SMU13_DRIVER_IF_VERSION_ALDE 0x08
> -#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x05
> +#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x07
>   #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04
>   #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0 0x30
>   #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x2C


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version
  2022-10-13 21:35 ` [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Limonciello, Mario
@ 2022-10-14  4:53   ` Huang, Tim
  0 siblings, 0 replies; 5+ messages in thread
From: Huang, Tim @ 2022-10-14  4:53 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Deucher, Alexander, Zhang, Yifan, amd-gfx@lists.freedesktop.org,
	Du, Xiaojian, Gong, Richard

[Public]

Hi Mario,

Comments inline. Thanks.

Best Regards,
Tim Huang

-----Original Message-----
From: Limonciello, Mario <Mario.Limonciello@amd.com>
Sent: Friday, October 14, 2022 5:35 AM
To: Huang, Tim <Tim.Huang@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Zhang, Yifan <Yifan1.Zhang@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com>; Gong, Richard <Richard.Gong@amd.com>
Subject: Re: [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version

On 10/13/2022 00:46, Tim Huang wrote:
> Update the SMU driver interface version to V7.
>
> Signed-off-by: Tim Huang <tim.huang@amd.com>
> ---
>   .../swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h | 17 +++++++++++++++--
>   1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git
> a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
> b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
> index ae2d337158f3..f77401709d83 100644
> ---
> a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4.h
> +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_4
> +++ .h
> @@ -27,7 +27,7 @@
>   // *** IMPORTANT ***
>   // SMU TEAM: Always increment the interface version if
>   // any structure is changed in this file -#define
> PMFW_DRIVER_IF_VERSION 5
> +#define PMFW_DRIVER_IF_VERSION 7
>
>   typedef struct {
>     int32_t value;
> @@ -163,8 +163,8 @@ typedef struct {
>     uint16_t DclkFrequency;               //[MHz]
>     uint16_t MemclkFrequency;             //[MHz]
>     uint16_t spare;                       //[centi]
> -  uint16_t UvdActivity;                 //[centi]
>     uint16_t GfxActivity;                 //[centi]
> +  uint16_t UvdActivity;                 //[centi]

This is unfortunate, it means that these two flipped based on PMFW driver interface version!

With 13.0.4 in 6.0, this should probably come back.

>> This flipping already happened in the PMFW driver interface version V6. So, should notice this compatible issue from V6.

Cc: stable@vger.kernel.org #6.0
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

>
>     uint16_t Voltage[2];                  //[mV] indices: VDDCR_VDD, VDDCR_SOC
>     uint16_t Current[2];                  //[mA] indices: VDDCR_VDD, VDDCR_SOC
> @@ -199,6 +199,19 @@ typedef struct {
>     uint16_t DeviceState;
>     uint16_t CurTemp;                     //[centi-Celsius]
>     uint16_t spare2;
> +
> +  uint16_t AverageGfxclkFrequency;
> +  uint16_t AverageFclkFrequency;
> +  uint16_t AverageGfxActivity;
> +  uint16_t AverageSocclkFrequency;
> +  uint16_t AverageVclkFrequency;
> +  uint16_t AverageVcnActivity;
> +  uint16_t AverageDRAMReads;          //Filtered DF Bandwidth::DRAM Reads
> +  uint16_t AverageDRAMWrites;         //Filtered DF Bandwidth::DRAM Writes
> +  uint16_t AverageSocketPower;        //Filtered value of CurrentSocketPower
> +  uint16_t AverageCorePower;          //Filtered of [sum of CorePower[8]])
> +  uint16_t AverageCoreC0Residency[8]; //Filtered of [average C0 residency %  per core]
> +  uint32_t MetricsCounter;            //Counts the # of metrics table parameter reads per update to the metrics table, i.e. if the metrics table update happens every 1 second, this value could be up to 1000 if the smu collected metrics data every cycle, or as low as 0 if the smu was asleep the whole time. Reset to 0 after writing.
>   } SmuMetrics_t;
>
>   typedef struct {


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-14  4:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-13  5:46 [PATCH 1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Tim Huang
2022-10-13  5:46 ` [PATCH 2/2] drm/amd/pm: add SMU IP v13.0.4 IF version define to V7 Tim Huang
2022-10-13 21:36   ` [2/2] " Limonciello, Mario
2022-10-13 21:35 ` [1/2] drm/amd/pm: update SMU IP v13.0.4 driver interface version Limonciello, Mario
2022-10-14  4:53   ` Huang, Tim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox