drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c- Extension
.c- Size
- 37491 bytes
- Lines
- 1393
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/kthread.hlinux/freezer.hmedia/v4l2-ioctl.hmedia/v4l2-common.hmedia/v4l2-event.hmedia/videobuf2-dma-sg.hsolo6x10.hsolo6x10-tw28.hsolo6x10-jpeg.h
Detected Declarations
struct solo_enc_buffunction solo_is_motion_onfunction solo_motion_detectedfunction solo_motion_togglefunction solo_update_modefunction solo_enc_onfunction solo_enc_offfunction enc_get_mpeg_dmafunction solo_send_descfunction for_each_sgfunction vop_interlacedfunction vop_channelfunction vop_typefunction vop_mpeg_sizefunction vop_hsizefunction vop_vsizefunction vop_mpeg_offsetfunction vop_jpeg_offsetfunction vop_jpeg_sizefunction vop_secfunction vop_usecfunction solo_fill_jpegfunction solo_fill_mpegfunction solo_enc_fillbuffunction solo_enc_handle_onefunction solo_enc_v4l2_isrfunction solo_handle_ringfunction solo_ring_threadfunction solo_enc_queue_setupfunction solo_enc_buf_queuefunction solo_ring_startfunction solo_ring_stopfunction solo_enc_start_streamingfunction solo_enc_stop_streamingfunction solo_enc_buf_finishfunction solo_enc_querycapfunction solo_enc_enum_inputfunction solo_enc_set_inputfunction solo_enc_get_inputfunction solo_enc_enum_fmt_capfunction solo_valid_pixfmtfunction solo_enc_try_fmt_capfunction solo_enc_set_fmt_capfunction solo_enc_get_fmt_capfunction solo_enc_g_stdfunction solo_enc_s_stdfunction solo_enum_framesizesfunction solo_enum_frameintervals
Annotated Snippet
struct solo_enc_buf {
enum solo_enc_types type;
const vop_header *vh;
int motion;
};
static int solo_is_motion_on(struct solo_enc_dev *solo_enc)
{
struct solo_dev *solo_dev = solo_enc->solo_dev;
return (solo_dev->motion_mask >> solo_enc->ch) & 1;
}
static int solo_motion_detected(struct solo_enc_dev *solo_enc)
{
struct solo_dev *solo_dev = solo_enc->solo_dev;
unsigned long flags;
u32 ch_mask = 1 << solo_enc->ch;
int ret = 0;
spin_lock_irqsave(&solo_enc->motion_lock, flags);
if (solo_reg_read(solo_dev, SOLO_VI_MOT_STATUS) & ch_mask) {
solo_reg_write(solo_dev, SOLO_VI_MOT_CLEAR, ch_mask);
ret = 1;
}
spin_unlock_irqrestore(&solo_enc->motion_lock, flags);
return ret;
}
static void solo_motion_toggle(struct solo_enc_dev *solo_enc, int on)
{
struct solo_dev *solo_dev = solo_enc->solo_dev;
u32 mask = 1 << solo_enc->ch;
unsigned long flags;
spin_lock_irqsave(&solo_enc->motion_lock, flags);
if (on)
solo_dev->motion_mask |= mask;
else
solo_dev->motion_mask &= ~mask;
solo_reg_write(solo_dev, SOLO_VI_MOT_CLEAR, mask);
solo_reg_write(solo_dev, SOLO_VI_MOT_ADR,
SOLO_VI_MOTION_EN(solo_dev->motion_mask) |
(SOLO_MOTION_EXT_ADDR(solo_dev) >> 16));
spin_unlock_irqrestore(&solo_enc->motion_lock, flags);
}
void solo_update_mode(struct solo_enc_dev *solo_enc)
{
struct solo_dev *solo_dev = solo_enc->solo_dev;
int vop_len;
u8 *vop;
solo_enc->interlaced = (solo_enc->mode & 0x08) ? 1 : 0;
solo_enc->bw_weight = max(solo_dev->fps / solo_enc->interval, 1);
if (solo_enc->mode == SOLO_ENC_MODE_CIF) {
solo_enc->width = solo_dev->video_hsize >> 1;
solo_enc->height = solo_dev->video_vsize;
if (solo_dev->type == SOLO_DEV_6110) {
if (solo_dev->video_type == SOLO_VO_FMT_TYPE_NTSC) {
vop = vop_6110_ntsc_cif;
vop_len = sizeof(vop_6110_ntsc_cif);
} else {
vop = vop_6110_pal_cif;
vop_len = sizeof(vop_6110_pal_cif);
}
} else {
if (solo_dev->video_type == SOLO_VO_FMT_TYPE_NTSC) {
vop = vop_6010_ntsc_cif;
vop_len = sizeof(vop_6010_ntsc_cif);
} else {
vop = vop_6010_pal_cif;
vop_len = sizeof(vop_6010_pal_cif);
}
}
} else {
solo_enc->width = solo_dev->video_hsize;
solo_enc->height = solo_dev->video_vsize << 1;
solo_enc->bw_weight <<= 2;
if (solo_dev->type == SOLO_DEV_6110) {
if (solo_dev->video_type == SOLO_VO_FMT_TYPE_NTSC) {
vop = vop_6110_ntsc_d1;
vop_len = sizeof(vop_6110_ntsc_d1);
} else {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/kthread.h`, `linux/freezer.h`, `media/v4l2-ioctl.h`, `media/v4l2-common.h`, `media/v4l2-event.h`, `media/videobuf2-dma-sg.h`.
- Detected declarations: `struct solo_enc_buf`, `function solo_is_motion_on`, `function solo_motion_detected`, `function solo_motion_toggle`, `function solo_update_mode`, `function solo_enc_on`, `function solo_enc_off`, `function enc_get_mpeg_dma`, `function solo_send_desc`, `function for_each_sg`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.