drivers/staging/media/meson/vdec/codec_vp9.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/meson/vdec/codec_vp9.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/meson/vdec/codec_vp9.c- Extension
.c- Size
- 64043 bytes
- Lines
- 2171
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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.hmedia/videobuf2-dma-contig.hdos_regs.hhevc_regs.hcodec_vp9.hvdec_helpers.hcodec_hevc_common.h
Detected Declarations
struct segmentationstruct loop_filter_threshstruct loop_filter_info_nstruct loopfilterstruct vp9_framestruct codec_vp9enum FRAME_TYPEenum SEG_LVL_FEATURESfunction round_power_of_twofunction div_r32function clip_probfunction segfeature_activefunction get_segdatafunction vp9_update_sharpnessfunction vp9_loop_filter_initfunction vp9_loop_filter_frame_initfunction codec_vp9_flush_outputfunction codec_vp9_num_pending_bufsfunction codec_vp9_alloc_workspacefunction codec_vp9_setup_workspacefunction codec_vp9_startfunction codec_vp9_stopfunction codec_vp9_set_mcrccfunction codec_vp9_set_saofunction codec_vp9_get_frame_mv_paddrfunction codec_vp9_set_mpred_mvfunction codec_vp9_update_next_reffunction codec_vp9_save_refsfunction codec_vp9_update_reffunction list_for_each_entryfunction codec_vp9_sync_reffunction codec_vp9_set_refsfunction codec_vp9_set_mcfunction codec_vp9_show_existing_framefunction codec_vp9_rm_noshow_framefunction list_for_each_entryfunction codec_vp9_process_framefunction codec_vp9_process_lffunction codec_vp9_resumefunction codec_vp9_fetch_rpmfunction codec_vp9_process_rpmfunction codec_vp9_is_reffunction codec_vp9_show_framefunction list_for_each_entry_safefunction vp9_tree_merge_probsfunction adapt_coef_probs_cxtfunction adapt_coef_probsfunction codec_vp9_threaded_isr
Annotated Snippet
struct segmentation {
u8 enabled;
u8 update_map;
u8 update_data;
u8 abs_delta;
u8 temporal_update;
s16 feature_data[MAX_SEGMENTS][SEG_LVL_MAX];
unsigned int feature_mask[MAX_SEGMENTS];
};
struct loop_filter_thresh {
u8 mblim;
u8 lim;
u8 hev_thr;
};
struct loop_filter_info_n {
struct loop_filter_thresh lfthr[MAX_LOOP_FILTER + 1];
u8 lvl[MAX_SEGMENTS][MAX_REF_FRAMES][MAX_MODE_LF_DELTAS];
};
struct loopfilter {
int filter_level;
int sharpness_level;
int last_sharpness_level;
u8 mode_ref_delta_enabled;
u8 mode_ref_delta_update;
/*0 = Intra, Last, GF, ARF*/
signed char ref_deltas[MAX_REF_LF_DELTAS];
signed char last_ref_deltas[MAX_REF_LF_DELTAS];
/*0 = ZERO_MV, MV*/
signed char mode_deltas[MAX_MODE_LF_DELTAS];
signed char last_mode_deltas[MAX_MODE_LF_DELTAS];
};
struct vp9_frame {
struct list_head list;
struct vb2_v4l2_buffer *vbuf;
int index;
int intra_only;
int show;
int type;
int done;
unsigned int width;
unsigned int height;
};
struct codec_vp9 {
/* VP9 context lock */
struct mutex lock;
/* Common part with the HEVC decoder */
struct codec_hevc_common common;
/* Buffer for the VP9 Workspace */
void *workspace_vaddr;
dma_addr_t workspace_paddr;
/* Contains many information parsed from the bitstream */
union rpm_param rpm_param;
/* Whether we detected the bitstream as 10-bit */
int is_10bit;
/* Coded resolution reported by the hardware */
u32 width, height;
/* All ref frames used by the HW at a given time */
struct list_head ref_frames_list;
u32 frames_num;
/* In case of downsampling (decoding with FBC but outputting in NV12M),
* we need to allocate additional buffers for FBC.
*/
void *fbc_buffer_vaddr[MAX_REF_PIC_NUM];
dma_addr_t fbc_buffer_paddr[MAX_REF_PIC_NUM];
int ref_frame_map[REF_FRAMES];
int next_ref_frame_map[REF_FRAMES];
struct vp9_frame *frame_refs[REFS_PER_FRAME];
u32 lcu_total;
/* loop filter */
int default_filt_lvl;
struct loop_filter_info_n lfi;
Annotation
- Immediate include surface: `media/v4l2-mem2mem.h`, `media/videobuf2-dma-contig.h`, `dos_regs.h`, `hevc_regs.h`, `codec_vp9.h`, `vdec_helpers.h`, `codec_hevc_common.h`.
- Detected declarations: `struct segmentation`, `struct loop_filter_thresh`, `struct loop_filter_info_n`, `struct loopfilter`, `struct vp9_frame`, `struct codec_vp9`, `enum FRAME_TYPE`, `enum SEG_LVL_FEATURES`, `function round_power_of_two`, `function div_r32`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.