drivers/media/pci/hws/hws_v4l2_ioctl.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/hws/hws_v4l2_ioctl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/hws/hws_v4l2_ioctl.c- Extension
.c- Size
- 21779 bytes
- Lines
- 920
- 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/kernel.hlinux/string.hlinux/pci.hlinux/errno.hlinux/io.hlinux/math64.hmedia/v4l2-ioctl.hmedia/v4l2-dev.hmedia/v4l2-dv-timings.hmedia/videobuf2-core.hmedia/videobuf2-v4l2.hhws.hhws_reg.hhws_video.hhws_v4l2_ioctl.h
Detected Declarations
struct hws_dv_modefunction hws_calc_bpl_yuyvfunction hws_calc_size_yuyvfunction hws_calc_half_sizefunction hws_hw_write_bchsfunction hws_match_supported_dvfunction hws_find_dv_by_whfunction hws_find_dv_by_wh_fpsfunction hws_get_live_dv_geometryfunction hws_get_live_fpsfunction hws_pick_fps_from_modefunction hws_fill_dv_timingsfunction hws_input_statusfunction hws_vidioc_query_dv_timingsfunction hws_vidioc_enum_dv_timingsfunction hws_vidioc_g_dv_timingsfunction hws_set_colorimetry_statefunction andfunction hws_vidioc_dv_timings_capfunction hws_s_ctrlfunction hws_vidioc_querycapfunction hws_vidioc_enum_fmt_vid_capfunction hws_vidioc_g_fmt_vid_capfunction hws_set_colorimetry_fmtfunction hws_vidioc_try_fmt_vid_capfunction hws_vidioc_s_fmt_vid_capfunction hws_vidioc_g_parmfunction hws_vidioc_enum_inputfunction hws_vidioc_g_inputfunction hws_vidioc_s_input
Annotated Snippet
struct hws_dv_mode {
struct v4l2_dv_timings timings;
u32 refresh_hz;
};
static const struct hws_dv_mode *
hws_find_dv_by_wh(u32 w, u32 h, bool interlaced);
static const struct hws_dv_mode *
hws_find_dv_by_wh_fps(u32 w, u32 h, bool interlaced, u32 fps);
static u32 hws_get_live_fps(struct hws_video *vid);
static u32 hws_input_status(struct hws_video *vid);
static int hws_fill_dv_timings(u32 w, u32 h, bool interlace, u32 fps,
struct v4l2_dv_timings *timings);
static const struct hws_dv_mode hws_dv_modes[] = {
{
{
.type = V4L2_DV_BT_656_1120,
.bt = {
.width = 1920,
.height = 1080,
.hfrontporch = 88,
.hsync = 44,
.hbackporch = 148,
.vfrontporch = 4,
.vsync = 5,
.vbackporch = 36,
.pixelclock = 148500000,
.polarities = V4L2_DV_VSYNC_POS_POL |
V4L2_DV_HSYNC_POS_POL,
.interlaced = 0,
},
},
60,
},
{
{
.type = V4L2_DV_BT_656_1120,
.bt = {
.width = 1920,
.height = 1080,
.hfrontporch = 88,
.hsync = 44,
.hbackporch = 148,
.vfrontporch = 4,
.vsync = 5,
.vbackporch = 36,
.pixelclock = 74250000,
.polarities = V4L2_DV_VSYNC_POS_POL |
V4L2_DV_HSYNC_POS_POL,
.interlaced = 0,
},
},
30,
},
{
{
.type = V4L2_DV_BT_656_1120,
.bt = {
.width = 1280,
.height = 720,
.hfrontporch = 110,
.hsync = 40,
.hbackporch = 220,
.vfrontporch = 5,
.vsync = 5,
.vbackporch = 20,
.pixelclock = 74250000,
.polarities = V4L2_DV_VSYNC_POS_POL |
V4L2_DV_HSYNC_POS_POL,
.interlaced = 0,
},
},
60,
},
{
{
.type = V4L2_DV_BT_656_1120,
.bt = {
.width = 720,
.height = 480,
.interlaced = 0,
},
},
60,
},
{
{
.type = V4L2_DV_BT_656_1120,
.bt = {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/string.h`, `linux/pci.h`, `linux/errno.h`, `linux/io.h`, `linux/math64.h`, `media/v4l2-ioctl.h`, `media/v4l2-dev.h`.
- Detected declarations: `struct hws_dv_mode`, `function hws_calc_bpl_yuyv`, `function hws_calc_size_yuyv`, `function hws_calc_half_size`, `function hws_hw_write_bchs`, `function hws_match_supported_dv`, `function hws_find_dv_by_wh`, `function hws_find_dv_by_wh_fps`, `function hws_get_live_dv_geometry`, `function hws_get_live_fps`.
- 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.