drivers/staging/media/tegra-video/vi.h
Source file repositories/reference/linux-study-clean/drivers/staging/media/tegra-video/vi.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/tegra-video/vi.h- Extension
.h- Size
- 10400 bytes
- Lines
- 311
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/host1x.hlinux/list.hlinux/mutex.hlinux/spinlock.hlinux/wait.hmedia/media-entity.hmedia/v4l2-async.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-dev.hmedia/v4l2-subdev.hmedia/videobuf2-v4l2.hcsi.h
Detected Declarations
struct tegra_vistruct tegra_vi_channelstruct tegra_vi_opsstruct tegra_vi_socstruct tegra_vistruct tegra_vi_channelstruct tegra_channel_bufferstruct tegra_video_formatenum tegra_vi_pg_modeenum tegra_image_dt
Annotated Snippet
struct tegra_vi_ops {
int (*vi_enable)(struct tegra_vi *vi, bool on);
int (*channel_host1x_syncpt_init)(struct tegra_vi_channel *chan);
void (*channel_host1x_syncpt_free)(struct tegra_vi_channel *chan);
void (*vi_fmt_align)(struct v4l2_pix_format *pix, unsigned int bpp);
void (*channel_queue_setup)(struct tegra_vi_channel *chan);
int (*vi_start_streaming)(struct vb2_queue *vq, u32 count);
void (*vi_stop_streaming)(struct vb2_queue *vq);
};
/**
* struct tegra_vi_soc - NVIDIA Tegra Video Input SoC structure
*
* @video_formats: supported video formats
* @nformats: total video formats
* @default_video_format: default video format (pointer to a @video_formats item)
* @ops: vi operations
* @hw_revision: VI hw_revision
* @vi_max_channels: supported max streaming channels
* @vi_max_clk_hz: VI clock max frequency
* @has_h_v_flip: the chip can do H and V flip, and the driver implements it
*/
struct tegra_vi_soc {
const struct tegra_video_format *video_formats;
const unsigned int nformats;
const struct tegra_video_format *default_video_format;
const struct tegra_vi_ops *ops;
u32 hw_revision;
unsigned int vi_max_channels;
unsigned int vi_max_clk_hz;
bool has_h_v_flip:1;
};
/**
* struct tegra_vi - NVIDIA Tegra Video Input device structure
*
* @dev: device struct
* @client: host1x_client struct
* @iomem: register base
* @clk: main clock for VI block
* @soc: pointer to SoC data structure
* @ops: vi operations
* @vi_chans: list head for VI channels
*/
struct tegra_vi {
struct device *dev;
struct host1x_client client;
void __iomem *iomem;
struct clk *clk;
const struct tegra_vi_soc *soc;
const struct tegra_vi_ops *ops;
struct list_head vi_chans;
};
/**
* struct tegra_vi_channel - Tegra video channel
*
* @list: list head for this entry
* @video: V4L2 video device associated with the video channel
* @video_lock: protects the @format and @queue fields
* @pad: media pad for the video device entity
*
* @vi: Tegra video input device structure
* @frame_start_sp: host1x syncpoint pointer to synchronize programmed capture
* start condition with hardware frame start events through host1x
* syncpoint counters. (Tegra210)
* @mw_ack_sp: host1x syncpoint pointer to synchronize programmed memory write
* ack trigger condition with hardware memory write done at end of
* frame through host1x syncpoint counters (On Tegra20 used for the
* OUT_1 syncpt)
* @sp_incr_lock: protects cpu syncpoint increment.
*
* @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 up
* kthread_finish_capture thread to wait for finishing frame data
* write to the memory. In case of missing frame start event, this
* thread returns buffer back to vb with VB2_BUF_STATE_ERROR.
* @start_wait: waitqueue for starting frame capture when buffer is available.
* @kthread_finish_capture: kthread to finish the buffer capture and return to.
* This thread is woken up by kthread_start_capture on receiving
* frame start event from the hardware and this thread waits for
* MW_ACK_DONE event which indicates completion of writing frame
* data to the memory. On receiving MW_ACK_DONE event, buffer is
* returned back to vb with VB2_BUF_STATE_DONE and in case of
* missing MW_ACK_DONE event, buffer is returned back to vb with
* VB2_BUF_STATE_ERROR.
* @done_wait: waitqueue for finishing capture data writes to memory.
*
Annotation
- Immediate include surface: `linux/host1x.h`, `linux/list.h`, `linux/mutex.h`, `linux/spinlock.h`, `linux/wait.h`, `media/media-entity.h`, `media/v4l2-async.h`, `media/v4l2-ctrls.h`.
- Detected declarations: `struct tegra_vi`, `struct tegra_vi_channel`, `struct tegra_vi_ops`, `struct tegra_vi_soc`, `struct tegra_vi`, `struct tegra_vi_channel`, `struct tegra_channel_buffer`, `struct tegra_video_format`, `enum tegra_vi_pg_mode`, `enum tegra_image_dt`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.