STRUCT HANTRO_DEV(9)
π struct hantro_dev(9) β driver data, but make it iconic
okay bestie, welcome to struct hantro_dev(9), straight out of the Kernel API Manual. this is the struct that's basically the main character of the whole verisilicon VPU driver situation β it holds all the driver data, and yes it's a lot, but we're gonna get through it together π«Ά
β¨ NAME β¨
struct hantro_dev β driver data. that's it, that's the vibe. it's the struct that carries everything the driver needs to function, no cap π
πΈ SYNOPSIS πΈ
okay so here's the whole thing, exactly as it lives, do not touch:
struct hantro_dev {
struct v4l2_device v4l2_dev;
struct v4l2_m2m_dev *m2m_dev;
struct media_device mdev;
struct hantro_func *encoder;
struct hantro_func *decoder;
struct platform_device *pdev;
struct device *dev;
struct clk_bulk_data *clocks;
struct reset_control *resets;
void __iomem **reg_bases;
void __iomem *enc_base;
void __iomem *dec_base;
void __iomem *ctrl_base;
struct mutex vpu_mutex;
spinlock_t irqlock;
const struct hantro_variant *variant;
struct delayed_work watchdog_work;
};
like, look at all those fields. she's thriving π¦
π Members π
let's go member by member, because every single one of these deserves her moment:
v4l2_devβ the V4L2 device that you register the video devices for. it's giving "the foundation of the whole operation" β¨m2m_devβ the mem2mem device that's associated with this device. memory-to-memory, slay πmdevβ the media device associated with this device. media device for the media device, iykyk π¬encoderβ the encoder functionality. encoding era π₯decoderβ the decoder functionality. decoding era, equally iconic πpdevβ a pointer to the VPU platform device. pointer bestie π«Άdevβ a pointer to the device, there so you can do convenient logging with thedev_macros. logging queen, honestly π₯clocksβ an array of clock handles. tick tock β°resetsβ an array of reset handles. reset button energy πreg_basesβ the mapped addresses of the VPU registers. mapped = located, and we love a good address β¨enc_baseβ the mapped address of the VPU encoder register, kept around for convenience. for convenience!! we love convenience πdec_baseβ the mapped address of the VPU decoder register, also for convenience. matching set, cute π€ctrl_baseβ the mapped address of the VPU control block. the control center, the moment, the icon πvpu_mutexβ a mutex to synchronize V4L2 calls. mutual exclusion but make it chic πirqlockβ a spinlock that synchronizes access to the data structures shared with interrupt handlers. very serious, very necessary, do not skip the locking fr frvariantβ the hardware variant-specific parameters. every VPU is different and this field knows it πΈwatchdog_workβ delayed work for hardware timeout handling. watchdog bestie is watching, she's always watching π
π¦ SEE ALSO π¦
related reading, all from the kernel file ./drivers/media/platform/verisilicon/hantro.h, go read them bestie:
struct hantro_irq(9)struct hantro_variant(9)enum hantro_codec_mode(9)struct hantro_ctx(9)struct hantro_fmt(9)hantro_debug: Module parameter to control level of debugging messages.(9)
like, that's a whole friend group right there π
ngl, if you're poking around in ./drivers/media/platform/verisilicon/, you're gonna meet all of these. no cap, they all hang out together π
and that's the whole page! this one's from ./drivers/media/platform/veris... (yes, they really did abbreviate it like that), October 2026 edition, struct hantro_dev(9). thanks for reading bestie, you ate that π
β¨π
π¦ 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