STRUCT XE_HWMON(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 a struct 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, an int ✨
  • 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 for energyN_input. it's an array: struct xe_hwmon_energy_info ei[CHANNEL_MAX]; so there's one per channel πŸ’–
  • fi β€” fan info for fanN_input. array time again: struct xe_hwmon_fan_info fi[FAN_MAX]; πŸŒ€
  • boot_power_limit_read β€” is boot power limits read. a bool, 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. a struct 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.c struct
  • 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