/** * struct hantro_irq - irq handler and name * * @name: irq name for device tree lookup * @handler: interrupt handler
*/ struct hantro_irq { constchar *name;
irqreturn_t (*handler)(int irq, void *priv);
};
/** * struct hantro_variant - information about VPU hardware variant * * @enc_offset: Offset from VPU base to encoder registers. * @dec_offset: Offset from VPU base to decoder registers. * @enc_fmts: Encoder formats. * @num_enc_fmts: Number of encoder formats. * @dec_fmts: Decoder formats. * @num_dec_fmts: Number of decoder formats. * @postproc_fmts: Post-processor formats. * @num_postproc_fmts: Number of post-processor formats. * @postproc_ops: Post-processor ops. * @codec: Supported codecs * @codec_ops: Codec ops. * @init: Initialize hardware, optional. * @runtime_resume: reenable hardware after power gating, optional. * @irqs: array of irq names and interrupt handlers * @num_irqs: number of irqs in the array * @clk_names: array of clock names * @num_clocks: number of clocks in the array * @reg_names: array of register range names * @num_regs: number of register range names in the array * @double_buffer: core needs double buffering * @legacy_regs: core uses legacy register set * @late_postproc: postproc must be set up at the end of the job
*/ struct hantro_variant { unsignedint enc_offset; unsignedint dec_offset; conststruct hantro_fmt *enc_fmts; unsignedint num_enc_fmts; conststruct hantro_fmt *dec_fmts; unsignedint num_dec_fmts; conststruct hantro_fmt *postproc_fmts; unsignedint num_postproc_fmts; conststruct hantro_postproc_ops *postproc_ops; unsignedint codec; conststruct hantro_codec_ops *codec_ops; int (*init)(struct hantro_dev *vpu); int (*runtime_resume)(struct hantro_dev *vpu); conststruct hantro_irq *irqs; int num_irqs; constchar * const *clk_names; int num_clocks; constchar * const *reg_names; int num_regs; unsignedint double_buffer : 1; unsignedint legacy_regs : 1; unsignedint late_postproc : 1;
};
/* * struct hantro_ctrl - helper type to declare supported controls * @codec: codec id this control belong to (HANTRO_JPEG_ENCODER, etc.) * @cfg: control configuration
*/ struct hantro_ctrl { unsignedint codec; struct v4l2_ctrl_config cfg;
};
/* * struct hantro_func - Hantro VPU functionality * * @id: processing functionality ID (can be * %MEDIA_ENT_F_PROC_VIDEO_ENCODER or * %MEDIA_ENT_F_PROC_VIDEO_DECODER) * @vdev: &struct video_device that exposes the encoder or * decoder functionality * @source_pad: &struct media_pad with the source pad. * @sink: &struct media_entity pointer with the sink entity * @sink_pad: &struct media_pad with the sink pad. * @proc: &struct media_entity pointer with the M2M device itself. * @proc_pads: &struct media_pad with the @proc pads. * @intf_devnode: &struct media_intf devnode pointer with the interface * with controls the M2M device. * * Contains everything needed to attach the video device to the media device.
*/ struct hantro_func { unsignedint id; struct video_device vdev; struct media_pad source_pad; struct media_entity sink; struct media_pad sink_pad; struct media_entity proc; struct media_pad proc_pads[2]; struct media_intf_devnode *intf_devnode;
};
/** * struct hantro_ctx - Context (instance) private data. * * @dev: VPU driver data to which the context belongs. * @fh: V4L2 file handler. * @is_encoder: Decoder or encoder context? * * @sequence_cap: Sequence counter for capture queue * @sequence_out: Sequence counter for output queue * * @vpu_src_fmt: Descriptor of active source format. * @src_fmt: V4L2 pixel format of active source format. * @vpu_dst_fmt: Descriptor of active destination format. * @dst_fmt: V4L2 pixel format of active destination format. * @ref_fmt: V4L2 pixel format of the reference frames format. * * @ctrl_handler: Control handler used to register controls. * @jpeg_quality: User-specified JPEG compression quality. * @bit_depth: Bit depth of current frame * @need_postproc: Set to true if the bitstream features require to * use the post-processor. * * @codec_ops: Set of operations related to codec mode. * @postproc: Post-processing context. * @h264_dec: H.264-decoding context. * @mpeg2_dec: MPEG-2-decoding context. * @vp8_dec: VP8-decoding context. * @hevc_dec: HEVC-decoding context. * @vp9_dec: VP9-decoding context. * @av1_dec: AV1-decoding context.
*/ struct hantro_ctx { struct hantro_dev *dev; struct v4l2_fh fh; bool is_encoder;
/* Specific for particular codec modes. */ union { struct hantro_h264_dec_hw_ctx h264_dec; struct hantro_mpeg2_dec_hw_ctx mpeg2_dec; struct hantro_vp8_dec_hw_ctx vp8_dec; struct hantro_hevc_dec_hw_ctx hevc_dec; struct hantro_vp9_dec_hw_ctx vp9_dec; struct hantro_av1_dec_hw_ctx av1_dec;
};
};
/** * struct hantro_fmt - information about supported video formats. * @name: Human readable name of the format. * @fourcc: FourCC code of the format. See V4L2_PIX_FMT_*. * @codec_mode: Codec mode related to this format. See * enum hantro_codec_mode. * @header_size: Optional header size. Currently used by JPEG encoder. * @max_depth: Maximum depth, for bitstream formats * @enc_fmt: Format identifier for encoder registers. * @frmsize: Supported range of frame sizes (only for bitstream formats). * @postprocessed: Indicates if this format needs the post-processor. * @match_depth: Indicates if format bit depth must match video bit depth
*/ struct hantro_fmt { char *name;
u32 fourcc; enum hantro_codec_mode codec_mode; int header_size; int max_depth; enum hantro_enc_fmt enc_fmt; struct v4l2_frmsize_stepwise frmsize; bool postprocessed; bool match_depth;
};
struct hantro_vp9_decoded_buffer_info { /* Info needed when the decoded frame serves as a reference frame. */ unsignedshort width; unsignedshort height;
size_t chroma_offset;
size_t mv_offset;
u32 bit_depth : 4;
};
struct hantro_av1_decoded_buffer_info { /* Info needed when the decoded frame serves as a reference frame. */
size_t chroma_offset;
size_t mv_offset;
};
struct hantro_decoded_buffer { /* Must be the first field in this struct. */ struct v4l2_m2m_buffer base;
union { struct hantro_vp9_decoded_buffer_info vp9; struct hantro_av1_decoded_buffer_info av1;
};
};
/* Logging helpers */
/** * DOC: hantro_debug: Module parameter to control level of debugging messages. * * Level of debugging messages can be controlled by bits of * module parameter called "debug". Meaning of particular * bits is as follows: * * bit 0 - global information: mode, size, init, release * bit 1 - each run start/result information * bit 2 - contents of small controls from userspace * bit 3 - contents of big controls from userspace * bit 4 - detail fmt, ctrl, buffer q/dq information * bit 5 - detail function enter/leave trace information * bit 6 - register write/read information
*/ externint hantro_debug;
#define vpu_debug(level, fmt, args...) \ do { \ if (hantro_debug & BIT(level)) \
pr_info("%s:%d: " fmt, \
__func__, __LINE__, ##args); \
} while (0)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.