drivers/media/platform/ti/omap3isp/ispvideo.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/omap3isp/ispvideo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/ti/omap3isp/ispvideo.c- Extension
.c- Size
- 44379 bytes
- Lines
- 1584
- 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/clk.hlinux/mm.hlinux/module.hlinux/pagemap.hlinux/scatterlist.hlinux/sched.hlinux/slab.hlinux/vmalloc.hmedia/v4l2-dev.hmedia/v4l2-ioctl.hmedia/v4l2-mc.hmedia/videobuf2-dma-contig.hispvideo.hisp.h
Detected Declarations
function isp_video_mbus_to_pixfunction isp_video_pix_to_mbusfunction isp_video_remote_subdevfunction isp_video_get_graph_datafunction media_pipeline_for_each_entityfunction __isp_video_get_formatfunction isp_video_check_formatfunction isp_video_queue_setupfunction isp_video_buffer_preparefunction isp_video_buffer_queuefunction omap3isp_video_return_buffersfunction isp_video_start_streamingfunction omap3isp_video_cancel_streamfunction omap3isp_video_resumefunction isp_video_querycapfunction isp_video_enum_formatfunction isp_video_get_formatfunction isp_video_try_formatfunction isp_video_set_formatfunction isp_video_get_selectionfunction isp_video_set_selectionfunction isp_video_get_paramfunction isp_video_set_paramfunction isp_video_reqbufsfunction isp_video_create_bufsfunction isp_video_querybuffunction isp_video_prepare_buffunction isp_video_qbuffunction isp_video_dqbuffunction isp_video_check_external_subdevsfunction isp_video_streamonfunction isp_video_streamofffunction isp_video_enum_inputfunction isp_video_g_inputfunction isp_video_s_inputfunction isp_video_openfunction isp_video_releasefunction isp_video_pollfunction isp_video_mmapfunction omap3isp_video_initfunction omap3isp_video_cleanupfunction omap3isp_video_registerfunction omap3isp_video_unregister
Annotated Snippet
if (j == f->index) {
f->pixelformat = formats[i].pixelformat;
return 0;
}
j++;
}
return -EINVAL;
}
static int
isp_video_get_format(struct file *file, void *fh, struct v4l2_format *format)
{
struct isp_video_fh *vfh = file_to_isp_video_fh(file);
struct isp_video *video = video_drvdata(file);
if (format->type != video->type)
return -EINVAL;
mutex_lock(&video->mutex);
*format = vfh->format;
mutex_unlock(&video->mutex);
return 0;
}
static int
isp_video_try_format(struct file *file, void *fh, struct v4l2_format *format)
{
struct isp_video *video = video_drvdata(file);
struct v4l2_subdev_format fmt = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
struct v4l2_subdev *subdev;
u32 pad;
int ret;
if (format->type != video->type)
return -EINVAL;
/* Replace unsupported field orders with sane defaults. */
switch (format->fmt.pix.field) {
case V4L2_FIELD_NONE:
/* Progressive is supported everywhere. */
break;
case V4L2_FIELD_ALTERNATE:
/* ALTERNATE is not supported on output nodes. */
if (video->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
format->fmt.pix.field = V4L2_FIELD_NONE;
break;
case V4L2_FIELD_INTERLACED:
/* The ISP has no concept of video standard, select the
* top-bottom order when the unqualified interlaced order is
* requested.
*/
format->fmt.pix.field = V4L2_FIELD_INTERLACED_TB;
fallthrough;
case V4L2_FIELD_INTERLACED_TB:
case V4L2_FIELD_INTERLACED_BT:
/* Interlaced orders are only supported at the CCDC output. */
if (video != &video->isp->isp_ccdc.video_out)
format->fmt.pix.field = V4L2_FIELD_NONE;
break;
case V4L2_FIELD_TOP:
case V4L2_FIELD_BOTTOM:
case V4L2_FIELD_SEQ_TB:
case V4L2_FIELD_SEQ_BT:
default:
/* All other field orders are currently unsupported, default to
* progressive.
*/
format->fmt.pix.field = V4L2_FIELD_NONE;
break;
}
if (video->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
isp_video_pix_to_mbus(&format->fmt.pix, &fmt.format);
isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix);
return 0;
}
subdev = isp_video_remote_subdev(video, &pad);
if (subdev == NULL)
return -EINVAL;
isp_video_pix_to_mbus(&format->fmt.pix, &fmt.format);
fmt.pad = pad;
ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
if (ret)
Annotation
- Immediate include surface: `linux/clk.h`, `linux/mm.h`, `linux/module.h`, `linux/pagemap.h`, `linux/scatterlist.h`, `linux/sched.h`, `linux/slab.h`, `linux/vmalloc.h`.
- Detected declarations: `function isp_video_mbus_to_pix`, `function isp_video_pix_to_mbus`, `function isp_video_remote_subdev`, `function isp_video_get_graph_data`, `function media_pipeline_for_each_entity`, `function __isp_video_get_format`, `function isp_video_check_format`, `function isp_video_queue_setup`, `function isp_video_buffer_prepare`, `function isp_video_buffer_queue`.
- 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.