STRUCT TEGRA_VI_CHANNEL(9)
π struct tegra_vi_channel(9) π
okay so bestie, we're deep in the Kernel API Manual right now and today's main character is the one and only struct tegra_vi_channel β the Tegra video channel π like literally the whole vibe of a video channel on Tegra, all wrapped up in one struct. no cap, she's a big one. let's get into it β¨
πΈ NAME πΈ
struct tegra_vi_channel β Tegra video channel π
β¨ SYNOPSIS β¨
struct tegra_vi_channel {
struct list_head list;
struct video_device video;
struct mutex video_lock;
struct media_pad pad;
struct tegra_vi *vi;
struct host1x_syncpt *frame_start_sp[GANG_PORTS_MAX];
struct host1x_syncpt *mw_ack_sp[GANG_PORTS_MAX];
spinlock_t sp_incr_lock[GANG_PORTS_MAX];
struct task_struct *kthread_start_capture;
wait_queue_head_t start_wait;
struct task_struct *kthread_finish_capture;
wait_queue_head_t done_wait;
struct v4l2_pix_format format;
const struct tegra_video_format *fmtinfo;
struct vb2_queue queue;
u32 sequence;
unsigned int addr_offset_u;
unsigned int addr_offset_v;
unsigned int start_offset;
unsigned int start_offset_u;
unsigned int start_offset_v;
struct list_head capture;
spinlock_t start_lock;
struct list_head done;
spinlock_t done_lock;
unsigned char portnos[GANG_PORTS_MAX];
u8 totalports;
u8 numgangports;
struct device_node *of_node;
struct v4l2_ctrl_handler ctrl_handler;
unsigned int syncpt_timeout_retry;
unsigned long fmts_bitmap[BITS_TO_LONGS( MAX_FORMAT_NUM)];
unsigned long tpg_fmts_bitmap[BITS_TO_LONGS( MAX_FORMAT_NUM)];
enum tegra_vi_pg_mode pg_mode;
struct v4l2_async_notifier notifier;
bool hflip:1;
bool vflip:1;
};
like, she's got range π¦ and honestly? obsessed.
π Members π
okay this is the part where we go member by member, and there are a LOT of them, so buckle up bestie π«Ά
listβ list head for this entry. iconic little linked-list behavior, we love to see it β¨videoβ the V4L2 video device associated with the video channel. this is her public-facing era πvideo_lockβ protects theformatandqueuefields. do not touch those without her, fr fr πpadβ media pad for the video device entity. media-pad representation, very main character πviβ the Tegra video input device structure. her parent, basically πframe_start_spβ host1x syncpoint pointer to synchronize the programmed capture start condition with hardware frame start events through host1x syncpoint counters. (Tegra210) βmw_ack_spβ host1x syncpoint pointer to synchronize the programmed memory write ack trigger condition with hardware memory write done at end of frame through host1x syncpoint counters (On Tegra20 used for theOUT_1syncpt). π₯sp_incr_lockβ protects cpu syncpoint increment. tiny lock, big job πkthread_start_captureβ kthread to start capture of single frame when vb buffer is available. This thread programs VI CSI hardware for single frame capture and waits for frame start event from the hardware. On receiving frame start event, it wakes upkthread_finish_capturethread to wait for finishing frame data write to the memory. In case of missing frame start event, this thread returns buffer back to vb withVB2_BUF_STATE_ERROR. π she's got responsibilitiesstart_waitβ waitqueue for starting frame capture when buffer is available. she waits, she slays π¦kthread_finish_captureβ kthread to finish the buffer capture and return to. This thread is woken up bykthread_start_captureon receiving frame start event from the hardware and this thread waits forMW_ACK_DONEevent which indicates completion of writing frame data to the memory. On receivingMW_ACK_DONEevent, buffer is returned back to vb withVB2_BUF_STATE_DONEand in case of missingMW_ACK_DONEevent, buffer is returned back to vb withVB2_BUF_STATE_ERROR. the relay race of the kernel, no cap πββοΈdone_waitβ waitqueue for finishing capture data writes to memory. the "are we done yet" queue πformatβ active V4L2 pixel format. the current look β¨fmtinfoβ format information corresponding to the active format. her info card πqueueβ vb2 buffers queue. buffer queue behavior πsequenceβ V4L2 buffers sequence number. counting the vibes, one buffer at a time π’addr_offset_uβ U plane base address, relative to buffer base address (only for planar). πaddr_offset_vβ V plane base address, relative to buffer base address (only for planar). πstart_offsetβ 1st Y byte to write, relative to buffer base address (for H/V flip). πstart_offset_uβ 1st U byte to write, relative to buffer base address (for H/V flip). πstart_offset_vβ 1st V byte to write, relative to buffer base address (for H/V flip). πcaptureβ list of queued buffers for capture. the queue of dreams πstart_lockβ protects the capture queued list. πdoneβ list of capture done queued buffers. the finished pile β¨done_lockβ protects the capture done queue list. πportnosβ VI channel port numbers. π’totalportsβ total number of ports used for this channel. π’numgangportsβ number of ports combined together as a gang for capture. gang gang π«Άπ₯of_nodeβ device node of VI channel. device-tree era πΈctrl_handlerβ V4L2 control handler of this video channel. she's got controls πsyncpt_timeout_retryβ syncpt timeout retry count for the capture. try again energy πfmts_bitmapβ a bitmap for supported formats matching v4l2 subdev formats. βtpg_fmts_bitmapβ a bitmap for supported TPG formats. βpg_modeβ test pattern generator mode (disabled/direct/patch). three moods, honestly πnotifierβ V4L2 asynchronous subdevs notifier. she notifies β¨hflipβ Horizontal flip is enabled. π¦vflipβ Vertical flip is enabled. π¦
π₯ SEE ALSO π₯
Kernel file ./drivers/staging/media/tegra-video/vi.h struct tegra_vi_ops(9), struct tegra_vi_soc(9), struct tegra_vi(9), struct tegra_channel_buffer(9), struct tegra_video_format(9)
iykyk, go read those next bestie, they're all linked in the same little kernel friend group π«Άπ
and that's the whole page, periodt π
this was brought to you by ./drivers/staging/media/tegra-... and the very cute month of October 2026 β stan the kernel docs, they ate ππ
π¦ 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