From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Badal Nilawar <badal.nilawar@intel.com>,
Karthik Poosa <karthik.poosa@intel.com>
Subject: Re: [PATCH 1/2] drm/xe/hwmon: Add HWMON support for BMG
Date: Thu, 23 May 2024 13:29:56 -0400 [thread overview]
Message-ID: <Zk99FOCBzVrDZH06@intel.com> (raw)
In-Reply-To: <20240523144351.4040131-2-balasubramani.vivekanandan@intel.com>
On Thu, May 23, 2024 at 08:13:50PM +0530, Balasubramani Vivekanandan wrote:
> From: Karthik Poosa <karthik.poosa@intel.com>
>
> Add HWMON support for BMG. Exposing the pkg power, current,
> energy info.
>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/regs/xe_pcode_regs.h | 5 +++++
> drivers/gpu/drm/xe/xe_hwmon.c | 16 ++++++++++++----
> 2 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
> index 3dae858508c8..beba16d592fc 100644
> --- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h
> @@ -18,4 +18,9 @@
> #define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
> #define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
>
> +#define BMG_PACKAGE_POWER_SKU XE_REG(0x138098)
> +#define BMG_PACKAGE_POWER_SKU_UNIT XE_REG(0x1380dc)
> +#define BMG_PACKAGE_ENERGY_STATUS XE_REG(0x138120)
> +#define BMG_PACKAGE_RAPL_LIMIT XE_REG(0x138440)
> +
> #endif /* _XE_PCODE_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index dca275117232..8daa070d7b1a 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -86,19 +86,25 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg
>
> switch (hwmon_reg) {
> case REG_PKG_RAPL_LIMIT:
> - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
> + if (xe->info.platform == XE_BATTLEMAGE && channel == CHANNEL_PKG)
> + return BMG_PACKAGE_RAPL_LIMIT;
> + else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
> return PVC_GT0_PACKAGE_RAPL_LIMIT;
> else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
> return PCU_CR_PACKAGE_RAPL_LIMIT;
> break;
> case REG_PKG_POWER_SKU:
> - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
> + if (xe->info.platform == XE_BATTLEMAGE)
> + return BMG_PACKAGE_POWER_SKU;
> + else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
> return PVC_GT0_PACKAGE_POWER_SKU;
> else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
> return PCU_CR_PACKAGE_POWER_SKU;
> break;
> case REG_PKG_POWER_SKU_UNIT:
> - if (xe->info.platform == XE_PVC)
> + if (xe->info.platform == XE_BATTLEMAGE)
> + return BMG_PACKAGE_POWER_SKU_UNIT;
> + else if (xe->info.platform == XE_PVC)
> return PVC_GT0_PACKAGE_POWER_SKU_UNIT;
> else if (xe->info.platform == XE_DG2)
> return PCU_CR_PACKAGE_POWER_SKU_UNIT;
> @@ -108,7 +114,9 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg
> return GT_PERF_STATUS;
> break;
> case REG_PKG_ENERGY_STATUS:
> - if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
> + if (xe->info.platform == XE_BATTLEMAGE && channel == CHANNEL_PKG)
> + return BMG_PACKAGE_ENERGY_STATUS;
> + else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
> return PVC_GT0_PLATFORM_ENERGY_STATUS;
> else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
> return PCU_CR_PACKAGE_ENERGY_STATUS;
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-05-23 17:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 14:43 [PATCH 0/2] Add HWMON support for BMG Balasubramani Vivekanandan
2024-05-23 14:43 ` [PATCH 1/2] drm/xe/hwmon: " Balasubramani Vivekanandan
2024-05-23 17:29 ` Rodrigo Vivi [this message]
2024-05-28 5:08 ` Nilawar, Badal
2024-05-23 14:43 ` [PATCH 2/2] drm/xe/hwmon: Expose card power and energy attributes of BMG Balasubramani Vivekanandan
2024-05-28 5:09 ` Nilawar, Badal
2024-05-23 14:47 ` ✓ CI.Patch_applied: success for Add HWMON support for BMG Patchwork
2024-05-23 14:48 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-23 14:49 ` ✓ CI.KUnit: success " Patchwork
2024-05-23 15:01 ` ✓ CI.Build: " Patchwork
2024-05-23 15:03 ` ✓ CI.Hooks: " Patchwork
2024-05-23 15:05 ` ✓ CI.checksparse: " Patchwork
2024-05-23 15:34 ` ✗ CI.BAT: failure " Patchwork
2024-05-23 17:04 ` ✗ CI.FULL: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zk99FOCBzVrDZH06@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=badal.nilawar@intel.com \
--cc=balasubramani.vivekanandan@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.