STRUCT HVA_CTX(9)
π struct hva_ctx(9) β from the Kernel API Manual, bestie
Okay so this is struct hva_ctx(9) and it lives in the Kernel API Manual, and it is literally the whole personality of one hva instance. Think of it as the group chat every encode job gets assigned to. πΈ
β¨ NAME β¨
struct hva_ctx β the context of an hva instance. That's it, that's the vibe. π«Ά
π¦ SYNOPSIS π¦
struct hva_ctx {
struct hva_dev *hva_dev;
struct v4l2_fh fh;
struct v4l2_ctrl_handler ctrl_handler;
struct hva_controls ctrls;
u8 id;
bool aborting;
char name[100];
struct work_struct run_work;
struct mutex lock;
u32 flags;
u32 frame_num;
u32 stream_num;
u32 max_stream_size;
enum v4l2_colorspace colorspace;
enum v4l2_xfer_func xfer_func;
enum v4l2_ycbcr_encoding ycbcr_enc;
enum v4l2_quantization quantization;
struct hva_streaminfo streaminfo;
struct hva_frameinfo frameinfo;
struct hva_enc *enc;
void *priv;
bool hw_err;
u32 encoded_frames;
u32 sys_errors;
u32 encode_errors;
u32 frame_errors;
#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS;
struct hva_ctx_dbg dbg;
#endif;
};
No cap, that's the entire struct, character for character. Do not touch it. π
π Members π
Every field, every one, because we don't do "and so on" in this house:
hva_devβ the device that this instance is associated with. Like, who's your sponsor basically.fhβ V4L2 file handle. Your little badge for the club. πctrl_handlerβ V4L2 controls handler.ctrlsβ hva controls set.idβ instance identifier. The number that says you specifically. β¨abortingβtrueif current job aborted. She's leaving the party early, respectfully.nameβ instance name (debug purpose). For the debug girlies.run_workβ encode work. The actual labour. πlockβ mutex used to lock access of this context. One at a time, bestie, one at a time.flagsβ validity ofstreaminfoandframeinfofields. Says whether those two are even telling the truth.frame_numβ frame number.stream_numβ stream number.max_stream_sizeβ maximum size in bytes required for stream data. Big girl budget, in bytes. πcolorspaceβ colorspace identifier.xfer_funcβ transfer function identifier.ycbcr_encβ Y'CbCr encoding identifier.quantizationβ quantization identifier.streaminfoβ stream properties.frameinfoβ frame properties.encβ current encoder. The main character of this whole thing tbh. πprivβ private codec data for this instance, allocated by encoder open time.hw_errβtrueif hardware error detected. π¨encoded_framesβ number of encoded frames. The receipts.sys_errorsβ number of system errors (memory, resource, pm...). Not her fault, the environment was toxic.encode_errorsβ number of encoding errors (hw/driver errors).frame_errorsβ number of frame errors (format, size, header...).dbgβ context debug info.
Note thatdbgonly even exists under#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS;β so if debugfs wasn't configured in, that field is simply not invited to the function. π
π SEE ALSO π
Kernel file ./drivers/media/platform/st/sti/hva/hva.h struct hva_frameinfo(9), struct hva_streaminfo(9), struct hva_controls(9), struct hva_frame(9), struct hva_stream(9), struct hva_ctx_dbg(9), struct hva_dev_dbg(9), struct hva_dev(9), struct hva_enc(9)
Go read them, iykyk. π¦
That's the whole page, bestie β love that for us. Sourced from ./drivers/media/platform/st/st..., dated October 2026, and yes the struct hva_ctx(9) girlies stay iconic. πβ¨π
π¦ 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