drivers/media/platform/rockchip/rga/rga3-hw.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rga/rga3-hw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rga/rga3-hw.c- Extension
.c- Size
- 14753 bytes
- Lines
- 508
- 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/pm_runtime.hlinux/bitfield.hlinux/delay.hlinux/printk.hmedia/v4l2-common.hrga3-hw.hrga.h
Detected Declarations
function Copyrightfunction rga3_can_capturefunction rga3_cmd_set_trans_infofunction rga3_cmd_set_win0_addrfunction rga3_cmd_set_wr_addrfunction rga3_cmd_set_win0_formatfunction rga3_cmd_set_wr_formatfunction rga3_hw_setup_cmdbuffunction rga3_hw_startfunction rga3_handle_irqfunction rga3_get_versionfunction rga3_enum_format
Annotated Snippet
v4l2_is_format_rgb(other_format_info))) {
/*
* The RGA3 only supports BT601, BT709 and BT2020 RGB<->YUV conversions
* Additionally BT709 and BT2020 only support limited range YUV.
*/
switch (format->ycbcr_enc) {
case V4L2_YCBCR_ENC_601:
/* supports full and limited range */
break;
case V4L2_YCBCR_ENC_709:
case V4L2_YCBCR_ENC_BT2020:
format->quantization = V4L2_QUANTIZATION_LIM_RANGE;
break;
default:
format->ycbcr_enc = V4L2_YCBCR_ENC_601;
format->quantization = V4L2_QUANTIZATION_FULL_RANGE;
break;
}
}
for (i = 0; i < ARRAY_SIZE(rga3_formats); i++) {
if (!is_output && !rga3_can_capture(&rga3_formats[i]))
continue;
if (rga3_formats[i].fourcc == format->pixelformat)
return &rga3_formats[i];
}
format->pixelformat = rga3_formats[0].fourcc;
return &rga3_formats[0];
}
const struct rga_hw rga3_hw = {
.card_type = "rga3",
.has_internal_iommu = false,
.cmdbuf_size = RGA3_CMDBUF_SIZE,
.min_width = RGA3_MIN_WIDTH,
.min_height = RGA3_MIN_HEIGHT,
/* use output size, as it's a bit smaller than the input size */
.max_width = RGA3_MAX_OUTPUT_WIDTH,
.max_height = RGA3_MAX_OUTPUT_HEIGHT,
.max_scaling_factor = RGA3_MAX_SCALING_FACTOR,
.stride_alignment = 16,
.features = 0,
.setup_cmdbuf = rga3_hw_setup_cmdbuf,
.start = rga3_hw_start,
.handle_irq = rga3_handle_irq,
.get_version = rga3_get_version,
.enum_format = rga3_enum_format,
.adjust_and_map_format = rga3_adjust_and_map_format,
};
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `linux/bitfield.h`, `linux/delay.h`, `linux/printk.h`, `media/v4l2-common.h`, `rga3-hw.h`, `rga.h`.
- Detected declarations: `function Copyright`, `function rga3_can_capture`, `function rga3_cmd_set_trans_info`, `function rga3_cmd_set_win0_addr`, `function rga3_cmd_set_wr_addr`, `function rga3_cmd_set_win0_format`, `function rga3_cmd_set_wr_format`, `function rga3_hw_setup_cmdbuf`, `function rga3_hw_start`, `function rga3_handle_irq`.
- 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.