STRUCT MTK_JPEG_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, this is struct mtk_jpeg_dev(9) from the Kernel API Manual, and it is literally the JPEG IP abstraction. main character energy for the JPEG situation, no cap. πŸŽ€


✨ SYNOPSIS ✨

here's the whole struct, exactly as it is, no edits, no chaos:

struct mtk_jpeg_dev {
    struct mutex            lock;
    spinlock_t hw_lock;
    struct workqueue_struct *workqueue;
    struct device           *dev;
    struct v4l2_device      v4l2_dev;
    struct v4l2_m2m_dev     *m2m_dev;
    void *alloc_ctx;
    struct video_device     *vdev;
    void __iomem            *reg_base;
    struct delayed_work job_timeout_work;
    const struct mtk_jpeg_variant *variant;
    void __iomem *reg_encbase[MTK_JPEGENC_HW_MAX];
    struct mtk_jpegenc_comp_dev *enc_hw_dev[MTK_JPEGENC_HW_MAX];
    wait_queue_head_t hw_wq;
    atomic_t hw_rdy;
    void __iomem *reg_decbase[MTK_JPEGDEC_HW_MAX];
    struct mtk_jpegdec_comp_dev *dec_hw_dev[MTK_JPEGDEC_HW_MAX];
    atomic_t hw_index;
};

look at all those fields β€” she's booked and busy πŸ’…


πŸ’… Members πŸ’…

  • lock β€” the mutex protecting this structure. yes ma'am, mutual exclusion but make it fashion.
  • hw_lock β€” the spinlock protecting the hw device resource. tiny, fierce, doing the most.
  • workqueue β€” the decode work queue. periodt.
  • dev β€” the JPEG device.
  • v4l2_dev β€” the v4l2 device for mem2mem mode.
  • m2m_dev β€” the v4l2 mem2mem device data.
  • alloc_ctx β€” the videobuf2 memory allocator's context. the way that apostrophe is carrying the whole sentence 😭
  • vdev β€” the video device node for jpeg mem2mem mode.
  • reg_base β€” the JPEG registers mapping.
  • job_timeout_work β€” the IRQ timeout structure. keeping track, bestie.
  • variant β€” the driver variant to be used.
  • reg_encbase β€” the jpg encode register base addr.
  • enc_hw_dev β€” the jpg encode hardware device.
  • hw_wq β€” the jpg wait queue.
  • hw_rdy β€” the jpg hw ready flag.
  • reg_decbase β€” the jpg decode register base addr.
  • dec_hw_dev β€” the jpg decode hardware device.
  • hw_index β€” the jpg hw index.

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h enum β€” and these references too, bestie, go read them:

  • mtk_jpeg_ctx_state(9)
  • struct mtk_jpeg_variant(9)
  • struct mtk_jpegenc_clk(9)
  • struct mtk_jpegdec_clk(9)
  • struct mtk_jpegenc_comp_dev(9)
  • struct mtk_jpegdec_comp_dev(9)
  • struct mtk_jpeg_fmt(9)
  • struct mtk_jpeg_q_data(9)
  • struct mtk_jpeg_ctx(9)

signed off from ./drivers/media/platform/media..., dated October 2026 β€” still serving struct mtk_jpeg_dev(9), still iconic πŸ’œ

πŸ“¦ where this page comes from