drivers/media/test-drivers/vivid/vivid-vid-common.c
Source file repositories/reference/linux-study-clean/drivers/media/test-drivers/vivid/vivid-vid-common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/test-drivers/vivid/vivid-vid-common.c- Extension
.c- Size
- 26457 bytes
- Lines
- 1138
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/kernel.hlinux/sched.hlinux/videodev2.hlinux/v4l2-dv-timings.hmedia/v4l2-common.hmedia/v4l2-event.hmedia/v4l2-dv-timings.hvivid-core.hvivid-vid-common.h
Detected Declarations
function vivid_vid_can_loopfunction vivid_send_input_source_changefunction vivid_send_source_changefunction fmt_sp2mpfunction fmt_sp2mp_funcfunction vivid_vid_adjust_selfunction vivid_enum_fmt_vidfunction vidioc_g_stdfunction vidioc_g_dv_timingsfunction vidioc_enum_dv_timingsfunction vidioc_dv_timings_capfunction vidioc_g_edid
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* vivid-vid-common.c - common video support functions.
*
* Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*/
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/videodev2.h>
#include <linux/v4l2-dv-timings.h>
#include <media/v4l2-common.h>
#include <media/v4l2-event.h>
#include <media/v4l2-dv-timings.h>
#include "vivid-core.h"
#include "vivid-vid-common.h"
const struct v4l2_dv_timings_cap vivid_dv_timings_cap = {
.type = V4L2_DV_BT_656_1120,
/* keep this initialization for compatibility with GCC < 4.4.6 */
.reserved = { 0 },
V4L2_INIT_BT_TIMINGS(16, MAX_WIDTH, 16, MAX_HEIGHT, 14000000, 775000000,
V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
V4L2_DV_BT_STD_CVT | V4L2_DV_BT_STD_GTF,
V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_INTERLACED)
};
/* ------------------------------------------------------------------
Basic structures
------------------------------------------------------------------*/
struct vivid_fmt vivid_formats[] = {
{
.fourcc = V4L2_PIX_FMT_YUYV,
.vdownsampling = { 1 },
.bit_depth = { 16 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 1,
.buffers = 1,
.data_offset = { PLANE0_DATA_OFFSET },
},
{
.fourcc = V4L2_PIX_FMT_UYVY,
.vdownsampling = { 1 },
.bit_depth = { 16 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 1,
.buffers = 1,
},
{
.fourcc = V4L2_PIX_FMT_YVYU,
.vdownsampling = { 1 },
.bit_depth = { 16 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 1,
.buffers = 1,
},
{
.fourcc = V4L2_PIX_FMT_VYUY,
.vdownsampling = { 1 },
.bit_depth = { 16 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 1,
.buffers = 1,
},
{
.fourcc = V4L2_PIX_FMT_YUV422P,
.vdownsampling = { 1, 1, 1 },
.bit_depth = { 8, 4, 4 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 3,
.buffers = 1,
},
{
.fourcc = V4L2_PIX_FMT_YUV420,
.vdownsampling = { 1, 2, 2 },
.bit_depth = { 8, 4, 4 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 3,
.buffers = 1,
},
{
.fourcc = V4L2_PIX_FMT_YVU420,
.vdownsampling = { 1, 2, 2 },
.bit_depth = { 8, 4, 4 },
.color_enc = TGP_COLOR_ENC_YCBCR,
.planes = 3,
.buffers = 1,
Annotation
- Immediate include surface: `linux/errno.h`, `linux/kernel.h`, `linux/sched.h`, `linux/videodev2.h`, `linux/v4l2-dv-timings.h`, `media/v4l2-common.h`, `media/v4l2-event.h`, `media/v4l2-dv-timings.h`.
- Detected declarations: `function vivid_vid_can_loop`, `function vivid_send_input_source_change`, `function vivid_send_source_change`, `function fmt_sp2mp`, `function fmt_sp2mp_func`, `function vivid_vid_adjust_sel`, `function vivid_enum_fmt_vid`, `function vidioc_g_std`, `function vidioc_g_dv_timings`, `function vidioc_enum_dv_timings`.
- Atlas domain: Driver Families / drivers/media.
- 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.