STRUCT HANTRO_CTX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct hantro_ctx(9) ✨

okay so bestie, welcome to the Kernel API Manual for struct hantro_ctx β€” literally the private data for one context (aka one instance) of this whole VPU situation πŸ’…


🌸 NAME 🌸

struct hantro_ctx β€” Context (instance) private data.


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole vibe, character for character:

struct hantro_ctx {
    struct hantro_dev *dev;
    struct v4l2_fh fh;
    bool is_encoder;
    u32 sequence_cap;
    u32 sequence_out;
    const struct hantro_fmt *vpu_src_fmt;
    struct v4l2_pix_format_mplane src_fmt;
    const struct hantro_fmt *vpu_dst_fmt;
    struct v4l2_pix_format_mplane dst_fmt;
    struct v4l2_pix_format_mplane ref_fmt;
    struct v4l2_ctrl_handler ctrl_handler;
    int jpeg_quality;
    int bit_depth;
    const struct hantro_codec_ops *codec_ops;
    struct hantro_postproc_ctx postproc;
    bool need_postproc;
    union {
      struct hantro_h264_dec_hw_ctx h264_dec;
      struct hantro_mpeg2_dec_hw_ctx mpeg2_dec;
      struct hantro_vp8_dec_hw_ctx vp8_dec;
      struct hantro_hevc_dec_hw_ctx hevc_dec;
      struct hantro_vp9_dec_hw_ctx vp9_dec;
      struct hantro_av1_dec_hw_ctx av1_dec;
    };
 };

πŸ’– Members πŸ’–

  • dev β€” the VPU driver data that this context belongs to. like, whose child is this? 🫢
  • fh β€” the V4L2 file handler. the file-handle link-up, iykyk.
  • is_encoder β€” decoder or encoder context? the ultimate identity crisis question, answered with a bool 😭
  • sequence_cap β€” sequence counter for the capture queue. keeping count, no cap πŸ“Š
  • sequence_out β€” sequence counter for the output queue. also keeping count ✨
  • vpu_src_fmt β€” descriptor of the active source format. the source's whole descriptor era.
  • src_fmt β€” V4L2 pixel format of the active source format. pixels, but make it V4L2 πŸ’…
  • vpu_dst_fmt β€” descriptor of the active destination format. destination descriptor vibes.
  • dst_fmt β€” V4L2 pixel format of the active destination format. the destination's pixel format moment.
  • ref_fmt β€” V4L2 pixel format of the reference frames format. reference frames gotta have a format too πŸŽ€
  • ctrl_handler β€” control handler used to register controls. it handles the controls, literally its whole job.
  • jpeg_quality β€” user-specified JPEG compression quality. you chose this, bestie πŸ“
  • bit_depth β€” bit depth of the current frame. how deep are the bits? this deep.
  • codec_ops β€” set of operations related to codec mode. the codec-mode to-do list πŸ”₯
  • postproc β€” post-processing context. the after-party context 🌈
  • need_postproc β€” set to true if the bitstream features require to use the post-processor. like, the bitstream said "post-process me" and this flag said "bet" πŸ‘‘

πŸ¦‹ {unnamed_union} πŸ¦‹

anonymous β€” yes bestie, it's an anonymous union, she has no name but she has range πŸ’œ

  • h264_dec β€” H.264-decoding context.
  • mpeg2_dec β€” MPEG-2-decoding context.
  • vp8_dec β€” VP8-decoding context.
  • hevc_dec β€” HEVC-decoding context.
  • vp9_dec β€” VP9-decoding context.
  • av1_dec β€” AV1-decoding context.

🌟 SEE ALSO 🌟

Kernel file ./drivers/media/platform/verisilicon/hantro.h struct hantro_irq(9), struct hantro_variant(9), enum hantro_codec_mode(9), struct hantro_dev(9), struct hantro_fmt(9), hantro_debug: Module parameter to control level of debugging messages.(9)


fr fr, go read those other pages too, they're all connected and it's giving lore 🧚

and that's the whole page, bestie! this gem lives at ./drivers/media/platform/veris... β€” October 2026, struct hantro_ctx(9), slay πŸ’…βœ¨

πŸ“¦ where this page comes from