drivers/media/platform/mediatek/vpu/mtk_vpu.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vpu/mtk_vpu.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/mediatek/vpu/mtk_vpu.h
Extension
.h
Size
5462 bytes
Lines
188
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

#ifndef _MTK_VPU_H
#define _MTK_VPU_H

#include <linux/platform_device.h>

/**
 * DOC: VPU
 *
 * VPU (video processor unit) is a tiny processor controlling video hardware
 * related to video codec, scaling and color format converting.
 * VPU interfaces with other blocks by share memory and interrupt.
 */

typedef void (*ipi_handler_t) (void *data,
			       unsigned int len,
			       void *priv);

/**
 * enum ipi_id - the id of inter-processor interrupt
 *
 * @IPI_VPU_INIT:	 The interrupt from vpu is to notfiy kernel
 *			 VPU initialization completed.
 *			 IPI_VPU_INIT is sent from VPU when firmware is
 *			 loaded. AP doesn't need to send IPI_VPU_INIT
 *			 command to VPU.
 *			 For other IPI below, AP should send the request
 *			 to VPU to trigger the interrupt.
 * @IPI_VDEC_H264:	 The interrupt from vpu is to notify kernel to
 *			 handle H264 vidoe decoder job, and vice versa.
 *			 Decode output format is always MT21 no matter what
 *			 the input format is.
 * @IPI_VDEC_VP8:	 The interrupt from is to notify kernel to
 *			 handle VP8 video decoder job, and vice versa.
 *			 Decode output format is always MT21 no matter what
 *			 the input format is.
 * @IPI_VDEC_VP9:	 The interrupt from vpu is to notify kernel to
 *			 handle VP9 video decoder job, and vice versa.
 *			 Decode output format is always MT21 no matter what
 *			 the input format is.
 * @IPI_VENC_H264:	 The interrupt from vpu is to notify kernel to
 *			 handle H264 video encoder job, and vice versa.
 * @IPI_VENC_VP8:	 The interrupt fro vpu is to notify kernel to
 *			 handle VP8 video encoder job,, and vice versa.
 * @IPI_MDP:		 The interrupt from vpu is to notify kernel to
 *			 handle MDP (Media Data Path) job, and vice versa.
 * @IPI_MAX:		 The maximum IPI number
 */

enum ipi_id {
	IPI_VPU_INIT = 0,
	IPI_VDEC_H264,
	IPI_VDEC_VP8,
	IPI_VDEC_VP9,
	IPI_VENC_H264,
	IPI_VENC_VP8,
	IPI_MDP,
	IPI_MAX,
};

/**
 * enum rst_id - reset id to register reset function for VPU watchdog timeout
 *
 * @VPU_RST_ENC: encoder reset id
 * @VPU_RST_DEC: decoder reset id
 * @VPU_RST_MDP: MDP (Media Data Path) reset id
 * @VPU_RST_MAX: maximum reset id
 */
enum rst_id {
	VPU_RST_ENC,
	VPU_RST_DEC,
	VPU_RST_MDP,
	VPU_RST_MAX,
};

/**
 * vpu_ipi_register - register an ipi function
 *
 * @pdev:	VPU platform device
 * @id:		IPI ID
 * @handler:	IPI handler
 * @name:	IPI name
 * @priv:	private data for IPI handler
 *
 * Register an ipi function to receive ipi interrupt from VPU.
 *
 * Return: Return 0 if ipi registers successfully, otherwise it is failed.
 */
int vpu_ipi_register(struct platform_device *pdev, enum ipi_id id,
		     ipi_handler_t handler, const char *name, void *priv);

Annotation

Implementation Notes