drivers/media/pci/intel/ipu6/ipu6-isys-video.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/intel/ipu6/ipu6-isys-video.c- Extension
.c- Size
- 38191 bytes
- Lines
- 1369
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/align.hlinux/bits.hlinux/bug.hlinux/completion.hlinux/container_of.hlinux/device.hlinux/list.hlinux/math64.hlinux/minmax.hlinux/module.hlinux/mutex.hlinux/pm_runtime.hlinux/spinlock.hlinux/string.hmedia/media-entity.hmedia/v4l2-ctrls.hmedia/v4l2-dev.hmedia/v4l2-fh.hmedia/v4l2-ioctl.hmedia/v4l2-subdev.hmedia/videobuf2-v4l2.hipu6.hipu6-bus.hipu6-cpd.hipu6-fw-isys.hipu6-isys.hipu6-isys-csi2.hipu6-isys-queue.hipu6-isys-video.hipu6-platform-regs.h
Detected Declarations
function video_openfunction ipu6_isys_get_isys_formatfunction ipu6_isys_vidioc_querycapfunction ipu6_isys_vidioc_enum_fmtfunction ipu6_isys_vidioc_enum_framesizesfunction ipu6_isys_vidioc_g_fmt_vid_capfunction ipu6_isys_vidioc_g_fmt_meta_capfunction ipu6_isys_try_fmt_capfunction __ipu6_isys_vidioc_try_fmt_vid_capfunction ipu6_isys_vidioc_try_fmt_vid_capfunction __ipu6_isys_vidioc_try_fmt_meta_capfunction ipu6_isys_vidioc_try_fmt_meta_capfunction ipu6_isys_vidioc_s_fmt_vid_capfunction ipu6_isys_vidioc_s_fmt_meta_capfunction ipu6_isys_vidioc_reqbufsfunction ipu6_isys_vidioc_create_bufsfunction link_validatefunction get_stream_openedfunction put_stream_openedfunction ipu6_isys_fw_pin_cfgfunction start_stream_firmwarefunction list_for_each_entryfunction stop_streaming_firmwarefunction close_streaming_firmwarefunction ipu6_isys_video_prepare_streamfunction ipu6_isys_configure_stream_watermarkfunction calculate_stream_dataratefunction ipu6_isys_update_stream_watermarkfunction ipu6_isys_put_streamfunction ipu6_isys_get_streamfunction ipu6_isys_query_stream_by_handlefunction ipu6_isys_query_stream_by_sourcefunction get_stream_mask_by_pipelinefunction ipu6_isys_video_set_streamingfunction ipu6_isys_fw_openfunction ipu6_isys_fw_closefunction ipu6_isys_setup_videofunction ipu6_isys_video_initfunction ipu6_isys_video_cleanupfunction ipu6_isys_get_formatfunction ipu6_isys_get_data_sizefunction ipu6_isys_get_bytes_per_linefunction ipu6_isys_get_frame_widthfunction ipu6_isys_get_frame_height
Annotated Snippet
if (num_found < f->index) {
num_found++;
continue;
}
f->flags = 0;
f->pixelformat = ipu6_isys_pfmts[i].pixelformat;
return 0;
}
return -EINVAL;
}
static int ipu6_isys_vidioc_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{
unsigned int i;
if (fsize->index > 0)
return -EINVAL;
for (i = 0; i < ARRAY_SIZE(ipu6_isys_pfmts); i++) {
if (fsize->pixel_format != ipu6_isys_pfmts[i].pixelformat)
continue;
fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
fsize->stepwise.min_width = IPU6_ISYS_MIN_WIDTH;
fsize->stepwise.max_width = IPU6_ISYS_MAX_WIDTH;
fsize->stepwise.min_height = IPU6_ISYS_MIN_HEIGHT;
fsize->stepwise.max_height = IPU6_ISYS_MAX_HEIGHT;
fsize->stepwise.step_width = 2;
fsize->stepwise.step_height = 2;
return 0;
}
return -EINVAL;
}
static int ipu6_isys_vidioc_g_fmt_vid_cap(struct file *file, void *fh,
struct v4l2_format *f)
{
struct ipu6_isys_video *av = video_drvdata(file);
f->fmt.pix = av->pix_fmt;
return 0;
}
static int ipu6_isys_vidioc_g_fmt_meta_cap(struct file *file, void *fh,
struct v4l2_format *f)
{
struct ipu6_isys_video *av = video_drvdata(file);
f->fmt.meta = av->meta_fmt;
return 0;
}
static void ipu6_isys_try_fmt_cap(struct ipu6_isys_video *av, u32 type,
u32 *format, u32 *width, u32 *height,
u32 *bytesperline, u32 *sizeimage)
{
const struct ipu6_isys_pixelformat *pfmt =
ipu6_isys_get_isys_format(*format, type);
*format = pfmt->pixelformat;
*width = clamp(*width, IPU6_ISYS_MIN_WIDTH, IPU6_ISYS_MAX_WIDTH);
*height = clamp(*height, IPU6_ISYS_MIN_HEIGHT, IPU6_ISYS_MAX_HEIGHT);
if (pfmt->bpp != pfmt->bpp_packed)
*bytesperline = *width * DIV_ROUND_UP(pfmt->bpp, BITS_PER_BYTE);
else
*bytesperline = DIV_ROUND_UP(*width * pfmt->bpp, BITS_PER_BYTE);
*bytesperline = ALIGN(*bytesperline, 64);
/*
* (height + 1) * bytesperline due to a hardware issue: the DMA unit
* is a power of two, and a line should be transferred as few units
* as possible. The result is that up to line length more data than
* the image size may be transferred to memory after the image.
* Another limitation is the GDA allocation unit size. For low
* resolution it gives a bigger number. Use larger one to avoid
* memory corruption.
*/
*sizeimage = *bytesperline * *height +
max(*bytesperline,
av->isys->pdata->ipdata->isys_dma_overshoot);
Annotation
- Immediate include surface: `linux/align.h`, `linux/bits.h`, `linux/bug.h`, `linux/completion.h`, `linux/container_of.h`, `linux/device.h`, `linux/list.h`, `linux/math64.h`.
- Detected declarations: `function video_open`, `function ipu6_isys_get_isys_format`, `function ipu6_isys_vidioc_querycap`, `function ipu6_isys_vidioc_enum_fmt`, `function ipu6_isys_vidioc_enum_framesizes`, `function ipu6_isys_vidioc_g_fmt_vid_cap`, `function ipu6_isys_vidioc_g_fmt_meta_cap`, `function ipu6_isys_try_fmt_cap`, `function __ipu6_isys_vidioc_try_fmt_vid_cap`, `function ipu6_isys_vidioc_try_fmt_vid_cap`.
- 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.