drivers/media/platform/ti/vpe/csc.c

Source file repositories/reference/linux-study-clean/drivers/media/platform/ti/vpe/csc.c

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/ti/vpe/csc.c
Extension
.c
Size
6921 bytes
Lines
280
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

struct quantization {
	u16	coeff[12];
};

struct colorspace {
	struct quantization limited;
	struct quantization full;
};

struct encoding_direction {
	struct colorspace r601;
	struct colorspace r709;
};

struct csc_coeffs {
	struct encoding_direction y2r;
	struct encoding_direction r2y;
};

/* default colorspace coefficients */
static struct csc_coeffs csc_coeffs = {
	.y2r = {
		.r601 = {
			.limited = {
				{	/* SDTV */
				0x0400, 0x0000, 0x057D, 0x0400, 0x1EA7, 0x1D35,
				0x0400, 0x06EF, 0x1FFE, 0x0D40, 0x0210, 0x0C88,
				}
			},
			.full = {
				{	/* SDTV */
				0x04A8, 0x1FFE, 0x0662, 0x04A8, 0x1E6F, 0x1CBF,
				0x04A8, 0x0812, 0x1FFF, 0x0C84, 0x0220, 0x0BAC,
				}
			},
		},
		.r709 = {
			.limited = {
				{	/* HDTV */
				0x0400, 0x0000, 0x0629, 0x0400, 0x1F45, 0x1E2B,
				0x0400, 0x0742, 0x0000, 0x0CEC, 0x0148, 0x0C60,
				}
			},
			.full = {
				{	/* HDTV */
				0x04A8, 0x0000, 0x072C, 0x04A8, 0x1F26, 0x1DDE,
				0x04A8, 0x0873, 0x0000, 0x0C20, 0x0134, 0x0B7C,
				}
			},
		},
	},
	.r2y = {
		.r601 = {
			.limited = {
				{	/* SDTV */
				0x0132, 0x0259, 0x0075, 0x1F50, 0x1EA5, 0x020B,
				0x020B, 0x1E4A, 0x1FAB, 0x0000, 0x0200, 0x0200,
				}
			},
			.full = {
				{	/* SDTV */
				0x0107, 0x0204, 0x0064, 0x1F68, 0x1ED6, 0x01C2,
				0x01C2, 0x1E87, 0x1FB7, 0x0040, 0x0200, 0x0200,
				}
			},
		},
		.r709 = {
			.limited = {
				{	/* HDTV */
				0x00DA, 0x02DC, 0x004A, 0x1F88, 0x1E6C, 0x020C,
				0x020C, 0x1E24, 0x1FD0, 0x0000, 0x0200, 0x0200,
				}
			},
			.full = {
				{	/* HDTV */
				0x00bb, 0x0275, 0x003f, 0x1f99, 0x1ea5, 0x01c2,
				0x01c2, 0x1e67, 0x1fd7, 0x0040, 0x0200, 0x0200,
				}
			},
		},
	},

};

void csc_dump_regs(struct csc_data *csc)
{
	struct device *dev = &csc->pdev->dev;

#define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, \
	ioread32(csc->base + CSC_##r))

Annotation

Implementation Notes