STRUCT XE_HWMON(9)
π STRUCT XE_HWMON(9) π
okay bestie, so this is struct xe_hwmon β the xe hwmon data structure, straight out of the Kernel API Manual (section 9, yes ma'am π). it's the lil' bookkeeping queen that holds all the hardware-monitoring tea for your xe device. let's get into it π
β¨ NAME β¨
struct xe_hwmon β the xe hwmon data structure. that's her. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
here's the actual glow-up, copy it exactly bestie, don't get creative:
struct xe_hwmon {
struct device *hwmon_dev;
struct xe_device *xe;
struct mutex hwmon_lock;
int scl_shift_power;
int scl_shift_energy;
int scl_shift_time;
struct xe_hwmon_energy_info ei[CHANNEL_MAX];
struct xe_hwmon_fan_info fi[FAN_MAX];
bool boot_power_limit_read;
u32 pl1_on_boot[CHANNEL_MAX];
u32 pl2_on_boot[CHANNEL_MAX];
struct xe_hwmon_thermal_info temp;
};
like, look at her. struct definition icon behavior honestly π
β¨ Members β¨
okay now the main event, one by one, no skipping, i promised π«Ά
hwmon_devβ the hwmon device for xe. this is the device handle, the main character of the hwmon situation πxeβ the Xe device. the actual GPU she's monitoring, iykyk π₯hwmon_lockβ lock for rw attributes. it's astruct mutex, and it's there so read/write attributes don't body-slam each other. respect the lock bestie, fr fr πscl_shift_powerβ pkg power unit. that's the package power unit scaling shift, anintβ¨scl_shift_energyβ pkg energy unit. same deal, but for package energy πΈscl_shift_timeβ pkg time unit. and this one's for package time βeiβ energy info forenergyN_input. it's an array:struct xe_hwmon_energy_info ei[CHANNEL_MAX];so there's one per channel πfiβ fan info forfanN_input. array time again:struct xe_hwmon_fan_info fi[FAN_MAX];πboot_power_limit_readβ is boot power limits read. abool, so it's literally just "did we read the boot power limits or not" πpl1_on_bootβ power limit PL1 on boot.u32 pl1_on_boot[CHANNEL_MAX];β per-channel PL1 value captured at boot πpl2_on_bootβ power limit PL2 on boot.u32 pl2_on_boot[CHANNEL_MAX];β same but PL2, she's the bigger sister π₯tempβ Temperature info. astruct xe_hwmon_thermal_info, keeping an eye on the heat π‘οΈ
ngl bestie, if you're poking at these fields from outside the driver, you're in "know what you're doing" territory. the lock is there for a reason, don't just raw-dog the rw attributes π
β¨ SEE ALSO β¨
go read the source, it's giving main character energy:
- Kernel file
./drivers/gpu/drm/xe/xe_hwmon.cstruct struct xe_hwmon_energy_info(9)struct xe_hwmon_fan_info(9)struct xe_hwmon_thermal_info(9)
those last three are the structs nested inside this one, so like, go say hi to them too π«Ά
and that's the page!! π this one lives in ./drivers/gpu/drm/xe, it's dated October 2026, and it's struct xe_hwmon(9) from the Kernel API Manual β mwah, love that for us πβ¨πΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms