[PATCH v2 1/3] Utility function and macro for telemetry reading

Poosa, Karthik karthik.poosa at intel.com
Fri May 30 16:10:18 UTC 2025


On 29-05-2025 23:27, Soham Purkait wrote:
> The changes in this patch is taken from
> https://patchwork.freedesktop.org/series/149026/
> Thay are  added only for compilation and does not
> require review.
> ---
>   drivers/gpu/drm/xe/regs/xe_pmt.h | 5 +++++
>   drivers/gpu/drm/xe/xe_vsec.c     | 2 +-
>   drivers/gpu/drm/xe/xe_vsec.h     | 5 +++++
>   3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/regs/xe_pmt.h b/drivers/gpu/drm/xe/regs/xe_pmt.h
> index f45abcd96ba8..b1d4504e4adc 100644
> --- a/drivers/gpu/drm/xe/regs/xe_pmt.h
> +++ b/drivers/gpu/drm/xe/regs/xe_pmt.h
> @@ -10,6 +10,11 @@
>   #define BMG_PMT_BASE_OFFSET		0xDB000
>   #define BMG_DISCOVERY_OFFSET		(SOC_BASE + BMG_PMT_BASE_OFFSET)
>   
> +#define PUNIT_TELEMETRY_GUID		XE_REG(BMG_DISCOVERY_OFFSET + 0x4)
> +#define BMG_ENERGY_STATUS_PMT_OFFSET	(0x30)
> +#define ENERGY_PKG			REG_GENMASK64(31, 0)
> +#define ENERGY_CARD			REG_GENMASK64(63, 32)
> +
>   #define BMG_TELEMETRY_BASE_OFFSET	0xE0000
>   #define BMG_TELEMETRY_OFFSET		(SOC_BASE + BMG_TELEMETRY_BASE_OFFSET)
>   
> diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
> index b378848d3b7b..a46e9580b1f4 100644
> --- a/drivers/gpu/drm/xe/xe_vsec.c
> +++ b/drivers/gpu/drm/xe/xe_vsec.c
> @@ -149,7 +149,7 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
>   	return 0;
>   }
>   
> -static int xe_pmt_telem_read(struct pci_dev *pdev, u32 guid, u64 *data, loff_t user_offset,
> +int xe_pmt_telem_read(struct pci_dev *pdev, u32 guid, u64 *data, loff_t user_offset,
>   			     u32 count)
>   {
>   	struct xe_device *xe = pdev_to_xe_device(pdev);
> diff --git a/drivers/gpu/drm/xe/xe_vsec.h b/drivers/gpu/drm/xe/xe_vsec.h
> index 5777c53faec2..6184b875e4b1 100644
> --- a/drivers/gpu/drm/xe/xe_vsec.h
> +++ b/drivers/gpu/drm/xe/xe_vsec.h
> @@ -4,8 +4,13 @@
>   #ifndef _XE_VSEC_H_
>   #define _XE_VSEC_H_
>   
> +#include "linux/types.h"
> +#include "linux/pci.h"
> +
>   struct xe_device;
>   
>   void xe_vsec_init(struct xe_device *xe);
> +int xe_pmt_telem_read(struct pci_dev *pdev, u32 guid, u64 *data, loff_t user_offset,
> +		      u32 count);
>   
>   #endif
These are merged now 
https://lore.kernel.org/all/20250529163458.2354509-6-karthik.poosa@intel.com/ 
, you can rebase on top of it.


More information about the Intel-xe mailing list