drivers/media/platform/ti/omap/omap_vout.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/omap/omap_vout.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/ti/omap/omap_vout.c- Extension
.c- Size
- 44269 bytes
- Lines
- 1741
- 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.
- 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/init.hlinux/module.hlinux/vmalloc.hlinux/sched.hlinux/types.hlinux/platform_device.hlinux/irq.hlinux/videodev2.hlinux/dma-mapping.hlinux/slab.hmedia/v4l2-device.hmedia/v4l2-ioctl.hmedia/v4l2-event.hvideo/omapvrfb.hvideo/omapfb_dss.homap_voutlib.homap_voutdef.homap_vout_vrfb.h
Detected Declarations
enum omap_vout_channelsfunction omap_vout_try_formatfunction v4l2_rot_to_dss_rotfunction omap_vout_calculate_offsetfunction video_mode_to_dss_modefunction omapvid_setup_overlayfunction omapvid_initfunction omapvid_apply_changesfunction omapvid_handle_interlace_displayfunction omap_vout_isrfunction vidioc_querycapfunction vidioc_enum_fmt_vid_outfunction vidioc_g_fmt_vid_outfunction vidioc_try_fmt_vid_outfunction vidioc_s_fmt_vid_outfunction vidioc_try_fmt_vid_overlayfunction vidioc_s_fmt_vid_overlayfunction vidioc_g_fmt_vid_overlayfunction vidioc_g_selectionfunction vidioc_s_selectionfunction omap_vout_s_ctrlfunction omap_vout_vb2_queue_setupfunction omap_vout_vb2_preparefunction omap_vout_vb2_queuefunction omap_vout_vb2_start_streamingfunction omap_vout_vb2_stop_streamingfunction vidioc_s_fbuffunction vidioc_g_fbuffunction vidioc_enum_outputfunction vidioc_g_outputfunction vidioc_s_outputfunction omap_vout_setup_video_datafunction omap_vout_setup_video_bufsfunction omap_vout_create_video_devicesfunction omap_vout_cleanup_devicefunction omap_vout_removefunction omap_vout_probefunction omap_vout_initfunction omap_vout_cleanup
Annotated Snippet
switch (vout->rotation) {
case dss_rotation_90_degree:
/* Invert the height and width for 90
* and 270 degree rotation
*/
swap(outw, outh);
posy = (timing->y_res - win->w.width) - win->w.left;
posx = win->w.top;
break;
case dss_rotation_180_degree:
posx = (timing->x_res - win->w.width) - win->w.left;
posy = (timing->y_res - win->w.height) - win->w.top;
break;
case dss_rotation_270_degree:
swap(outw, outh);
posy = win->w.left;
posx = (timing->x_res - win->w.height) - win->w.top;
break;
default:
posx = win->w.left;
posy = win->w.top;
break;
}
ret = omapvid_setup_overlay(vout, ovl, posx, posy,
outw, outh, addr);
if (ret)
goto omapvid_init_err;
}
return 0;
omapvid_init_err:
v4l2_warn(&vout->vid_dev->v4l2_dev, "apply_changes failed\n");
return ret;
}
/*
* Apply the changes set the go bit of DSS
*/
static int omapvid_apply_changes(struct omap_vout_device *vout)
{
int i;
struct omap_overlay *ovl;
struct omapvideo_info *ovid = &vout->vid_info;
for (i = 0; i < ovid->num_overlays; i++) {
struct omap_dss_device *dssdev;
ovl = ovid->overlays[i];
dssdev = ovl->get_device(ovl);
if (!dssdev)
return -EINVAL;
ovl->manager->apply(ovl->manager);
}
return 0;
}
static int omapvid_handle_interlace_display(struct omap_vout_device *vout,
unsigned int irqstatus, u64 ts)
{
u32 fid;
if (vout->first_int) {
vout->first_int = 0;
goto err;
}
if (irqstatus & DISPC_IRQ_EVSYNC_ODD)
fid = 1;
else if (irqstatus & DISPC_IRQ_EVSYNC_EVEN)
fid = 0;
else
goto err;
vout->field_id ^= 1;
if (fid != vout->field_id) {
if (fid == 0)
vout->field_id = fid;
} else if (0 == fid) {
if (vout->cur_frm == vout->next_frm)
goto err;
vout->cur_frm->vbuf.vb2_buf.timestamp = ts;
vout->cur_frm->vbuf.sequence = vout->sequence++;
vb2_buffer_done(&vout->cur_frm->vbuf.vb2_buf, VB2_BUF_STATE_DONE);
vout->cur_frm = vout->next_frm;
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `linux/vmalloc.h`, `linux/sched.h`, `linux/types.h`, `linux/platform_device.h`, `linux/irq.h`, `linux/videodev2.h`.
- Detected declarations: `enum omap_vout_channels`, `function omap_vout_try_format`, `function v4l2_rot_to_dss_rot`, `function omap_vout_calculate_offset`, `function video_mode_to_dss_mode`, `function omapvid_setup_overlay`, `function omapvid_init`, `function omapvid_apply_changes`, `function omapvid_handle_interlace_display`, `function omap_vout_isr`.
- 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.
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.