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.

Dependency Surface

Detected Declarations

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

Implementation Notes