STRUCT VENUS_INST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

struct venus_inst β€” the lil container that holds all the per-instance parameters, bestie. Like, one of these per session, no cap. (Oh and hii, this is the Kernel API Manual β€” welcome to the group chat ✨)


✨ SYNOPSIS ✨

struct venus_inst {
    struct list_head list;
    struct mutex lock;
    struct venus_core *core;
    struct clock_data clk_data;
    struct list_head dpbbufs;
    struct list_head internalbufs;
    struct list_head registeredbufs;
    struct list_head delayed_process;
    struct work_struct delayed_process_work;
    bool nonblock;
    struct v4l2_ctrl_handler ctrl_handler;
    union {
      struct vdec_controls dec;
      struct venc_controls enc;
    } controls;
    struct v4l2_fh fh;
    unsigned int streamon_cap, streamon_out;
    u32 width;
    u32 height;
    struct v4l2_rect crop;
    u32 fw_min_cnt;
    u32 out_width;
    u32 out_height;
    u32 colorspace;
    u8 ycbcr_enc;
    u8 quantization;
    u8 xfer_func;
    enum venus_dec_state codec_state;
    enum venus_enc_state enc_state;
    wait_queue_head_t reconf_wait;
    unsigned int subscriptions;
    int buf_count;
    struct venus_ts_metadata tss[VIDEO_MAX_FRAME];
    unsigned long payloads[VIDEO_MAX_FRAME];
    u64 fps;
    struct v4l2_fract timeperframe;
    const struct venus_format *fmt_out;
    const struct venus_format *fmt_cap;
    unsigned int num_input_bufs;
    unsigned int num_output_bufs;
    unsigned int input_buf_size;
    unsigned int output_buf_size;
    unsigned int output2_buf_size;
    u32 dpb_buftype;
    u32 dpb_fmt;
    u32 opb_buftype;
    u32 opb_fmt;
    bool reconfig;
    u32 hfi_codec;
    u32 sequence_cap;
    u32 sequence_out;
    struct v4l2_m2m_dev *m2m_dev;
    struct v4l2_m2m_ctx *m2m_ctx;
    struct mutex ctx_q_lock;
    unsigned int state;
    struct completion done;
    unsigned int error;
    bool session_error;
    const struct hfi_inst_ops *ops;
    u32 session_type;
    union hfi_get_property hprop;
    unsigned int core_acquired: 1;
    unsigned int bit_depth;
    unsigned int pic_struct;
    bool next_buf_last;
    bool drain_active;
    enum venus_inst_modes flags;
    struct ida dpb_ids;
 };

🌸 Members 🌸

Okay so now we go field by field, and honestly? There are a LOT of them. Stay with me 🫢

  • list β€” used for attach an instance to the core. Glue duty πŸ’…
  • lock β€” instance lock, the bouncer for this specific instance.
  • core β€” a reference to the core struct.
  • clk_data β€” clock data per core ID.
  • dpbbufs β€” a list of decoded picture buffers.
  • internalbufs β€” a list of internal buffers.
  • registeredbufs β€” a list of registered capture buffers.
  • delayed_process β€” a list of delayed buffers, just vibing in the queue.
  • delayed_process_work β€” a work_struct for process delayed buffers.
  • nonblock β€” nonblocking flag, the "don't wait up for me" switch.
  • ctrl_handler β€” v4l control handler.
  • controls β€” a union of decoder and encoder control parameters. One of these at a time, pick a lane ✨
  • fh β€” a holder of v4l file handle structure.
  • streamon_cap β€” stream on flag for capture queue.
  • streamon_out β€” stream on flag for output queue.
  • width β€” current capture width.
  • height β€” current capture height.
  • crop β€” current crop rectangle.
  • fw_min_cnt β€” firmware minimum buffer count.
  • out_width β€” current output width.
  • out_height β€” current output height.
  • colorspace β€” current color space.
  • ycbcr_enc β€” current YCbCr encoding.
  • quantization β€” current quantization.
  • xfer_func β€” current xfer function.
  • codec_state β€” current decoder API state (see DEC_STATE_).
  • enc_state β€” current encoder API state (see ENC_STATE_).
  • reconf_wait β€” wait queue for resolution change event. She waits πŸ₯Ί
  • subscriptions β€” used to hold current events subscriptions.
  • buf_count β€” used to count number of buffers (reqbuf(0)).
  • tss β€” timestamp metadata.
  • payloads β€” cache plane payload to use it for clock/BW scaling.
  • fps β€” holds current FPS.
  • timeperframe β€” holds current time per frame structure.
  • fmt_out β€” a reference to output format structure.
  • fmt_cap β€” a reference to capture format structure.
  • num_input_bufs β€” holds number of input buffers.
  • num_output_bufs β€” holds number of output buffers.
  • input_buf_size β€” holds input buffer size.
  • output_buf_size β€” holds output buffer size.
  • output2_buf_size β€” holds secondary decoder output buffer size.
  • dpb_buftype β€” decoded picture buffer type.
  • dpb_fmt β€” decoded picture buffer raw format.
  • opb_buftype β€” output picture buffer type.
  • opb_fmt β€” output picture buffer raw format.
  • reconfig β€” a flag raised by decoder when the stream resolution changed.
  • hfi_codec β€” current codec for this instance in HFI space.
  • sequence_cap β€” a sequence counter for capture queue.
  • sequence_out β€” a sequence counter for output queue.
  • m2m_dev β€” a reference to m2m device structure.
  • m2m_ctx β€” a reference to m2m context structure.
  • ctx_q_lock β€” a lock to serialize video device ioctl calls.
  • state β€” current state of the instance.
  • done β€” a completion for sync HFI operation.
  • error β€” an error returned during last HFI sync operation.
  • session_error β€” a flag rised by HFI interface in case of session error.
  • ops β€” HFI operations.
  • session_type β€” the type of the session (decoder or encoder).
  • hprop β€” a union used as a holder by get property.
  • core_acquired β€” the Core has been acquired. She's taken πŸ”’
  • bit_depth β€” current bitstream bit-depth.
  • pic_struct β€” bitstream progressive vs interlaced.
  • next_buf_last β€” a flag to mark next queued capture buffer as last.
  • drain_active β€” Drain sequence is in progress.
  • flags β€” bitmask flags describing current instance mode.
  • dpb_ids β€” DPB buffer ID's.

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/media/platform/qcom/venus/core.h struct
  • venus_core(9)

And that's the whole page, bestie, you ate that πŸ’– This icon lives at ./drivers/media/platform/qcom/... in the October 2026 edition of struct venus_inst(9) β€” go forth and read the struct, periodt πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from