drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c- Extension
.c- Size
- 22862 bytes
- Lines
- 592
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
media/v4l2-mem2mem.hrkvdec.hrkvdec-regs.hrkvdec-cabac.hrkvdec-hevc-common.hrkvdec-bitwriter.h
Detected Declarations
struct rkvdec_sps_pps_packetstruct rkvdec_rps_packetstruct rkvdec_hevc_priv_tblstruct rkvdec_hevc_ctxfunction assemble_hw_ppsfunction L1function config_registersfunction rkvdec_hevc_validate_spsfunction rkvdec_hevc_startfunction rkvdec_hevc_stopfunction rkvdec_hevc_runfunction rkvdec_hevc_try_ctrl
Annotated Snippet
struct rkvdec_sps_pps_packet {
u32 info[RKV_PPS_SIZE];
};
struct rkvdec_rps_packet {
u32 info[RKV_RPS_SIZE];
};
/* SPS */
#define VIDEO_PARAMETER_SET_ID BW_FIELD(0, 4)
#define SEQ_PARAMETER_SET_ID BW_FIELD(4, 4)
#define CHROMA_FORMAT_IDC BW_FIELD(8, 2)
#define PIC_WIDTH_IN_LUMA_SAMPLES BW_FIELD(10, 13)
#define PIC_HEIGHT_IN_LUMA_SAMPLES BW_FIELD(23, 13)
#define BIT_DEPTH_LUMA BW_FIELD(36, 4)
#define BIT_DEPTH_CHROMA BW_FIELD(40, 4)
#define LOG2_MAX_PIC_ORDER_CNT_LSB BW_FIELD(44, 5)
#define LOG2_DIFF_MAX_MIN_LUMA_CODING_BLOCK_SIZE BW_FIELD(49, 2)
#define LOG2_MIN_LUMA_CODING_BLOCK_SIZE BW_FIELD(51, 3)
#define LOG2_MIN_TRANSFORM_BLOCK_SIZE BW_FIELD(54, 3)
#define LOG2_DIFF_MAX_MIN_LUMA_TRANSFORM_BLOCK_SIZE BW_FIELD(57, 2)
#define MAX_TRANSFORM_HIERARCHY_DEPTH_INTER BW_FIELD(59, 3)
#define MAX_TRANSFORM_HIERARCHY_DEPTH_INTRA BW_FIELD(62, 3)
#define SCALING_LIST_ENABLED_FLAG BW_FIELD(65, 1)
#define AMP_ENABLED_FLAG BW_FIELD(66, 1)
#define SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG BW_FIELD(67, 1)
#define PCM_ENABLED_FLAG BW_FIELD(68, 1)
#define PCM_SAMPLE_BIT_DEPTH_LUMA BW_FIELD(69, 4)
#define PCM_SAMPLE_BIT_DEPTH_CHROMA BW_FIELD(73, 4)
#define PCM_LOOP_FILTER_DISABLED_FLAG BW_FIELD(77, 1)
#define LOG2_DIFF_MAX_MIN_PCM_LUMA_CODING_BLOCK_SIZE BW_FIELD(78, 3)
#define LOG2_MIN_PCM_LUMA_CODING_BLOCK_SIZE BW_FIELD(81, 3)
#define NUM_SHORT_TERM_REF_PIC_SETS BW_FIELD(84, 7)
#define LONG_TERM_REF_PICS_PRESENT_FLAG BW_FIELD(91, 1)
#define NUM_LONG_TERM_REF_PICS_SPS BW_FIELD(92, 6)
#define SPS_TEMPORAL_MVP_ENABLED_FLAG BW_FIELD(98, 1)
#define STRONG_INTRA_SMOOTHING_ENABLED_FLAG BW_FIELD(99, 1)
/* PPS */
#define PIC_PARAMETER_SET_ID BW_FIELD(128, 6)
#define PPS_SEQ_PARAMETER_SET_ID BW_FIELD(134, 4)
#define DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG BW_FIELD(138, 1)
#define OUTPUT_FLAG_PRESENT_FLAG BW_FIELD(139, 1)
#define NUM_EXTRA_SLICE_HEADER_BITS BW_FIELD(140, 13)
#define SIGN_DATA_HIDING_ENABLED_FLAG BW_FIELD(153, 1)
#define CABAC_INIT_PRESENT_FLAG BW_FIELD(154, 1)
#define NUM_REF_IDX_L0_DEFAULT_ACTIVE BW_FIELD(155, 4)
#define NUM_REF_IDX_L1_DEFAULT_ACTIVE BW_FIELD(159, 4)
#define INIT_QP_MINUS26 BW_FIELD(163, 7)
#define CONSTRAINED_INTRA_PRED_FLAG BW_FIELD(170, 1)
#define TRANSFORM_SKIP_ENABLED_FLAG BW_FIELD(171, 1)
#define CU_QP_DELTA_ENABLED_FLAG BW_FIELD(172, 1)
#define LOG2_MIN_CU_QP_DELTA_SIZE BW_FIELD(173, 3)
#define PPS_CB_QP_OFFSET BW_FIELD(176, 5)
#define PPS_CR_QP_OFFSET BW_FIELD(181, 5)
#define PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG BW_FIELD(186, 1)
#define WEIGHTED_PRED_FLAG BW_FIELD(187, 1)
#define WEIGHTED_BIPRED_FLAG BW_FIELD(188, 1)
#define TRANSQUANT_BYPASS_ENABLED_FLAG BW_FIELD(189, 1)
#define TILES_ENABLED_FLAG BW_FIELD(190, 1)
#define ENTROPY_CODING_SYNC_ENABLED_FLAG BW_FIELD(191, 1)
#define PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED_FLAG BW_FIELD(192, 1)
#define LOOP_FILTER_ACROSS_TILES_ENABLED_FLAG BW_FIELD(193, 1)
#define DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG BW_FIELD(194, 1)
#define PPS_DEBLOCKING_FILTER_DISABLED_FLAG BW_FIELD(195, 1)
#define PPS_BETA_OFFSET_DIV2 BW_FIELD(196, 4)
#define PPS_TC_OFFSET_DIV2 BW_FIELD(200, 4)
#define LISTS_MODIFICATION_PRESENT_FLAG BW_FIELD(204, 1)
#define LOG2_PARALLEL_MERGE_LEVEL BW_FIELD(205, 3)
#define SLICE_SEGMENT_HEADER_EXTENSION_PRESENT_FLAG BW_FIELD(208, 1)
#define NUM_TILE_COLUMNS BW_FIELD(212, 5)
#define NUM_TILE_ROWS BW_FIELD(217, 5)
#define COLUMN_WIDTH(i) BW_FIELD(256 + ((i) * 8), 8)
#define ROW_HEIGHT(i) BW_FIELD(416 + ((i) * 8), 8)
#define SCALING_LIST_ADDRESS BW_FIELD(592, 32)
/* Data structure describing auxiliary buffer format. */
struct rkvdec_hevc_priv_tbl {
u8 cabac_table[RKV_HEVC_CABAC_TABLE_SIZE];
struct scaling_factor scaling_list;
struct rkvdec_sps_pps_packet param_set[RKV_PPS_LEN];
struct rkvdec_rps_packet rps[RKV_RPS_LEN];
};
struct rkvdec_hevc_ctx {
struct rkvdec_aux_buf priv_tbl;
struct v4l2_ctrl_hevc_scaling_matrix scaling_matrix_cache;
struct rkvdec_regs regs;
};
static void assemble_hw_pps(struct rkvdec_ctx *ctx,
Annotation
- Immediate include surface: `media/v4l2-mem2mem.h`, `rkvdec.h`, `rkvdec-regs.h`, `rkvdec-cabac.h`, `rkvdec-hevc-common.h`, `rkvdec-bitwriter.h`.
- Detected declarations: `struct rkvdec_sps_pps_packet`, `struct rkvdec_rps_packet`, `struct rkvdec_hevc_priv_tbl`, `struct rkvdec_hevc_ctx`, `function assemble_hw_pps`, `function L1`, `function config_registers`, `function rkvdec_hevc_validate_sps`, `function rkvdec_hevc_start`, `function rkvdec_hevc_stop`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.