/* * v4l2-hevc-ext-controls.h — verbatim mirror of Linux 7.0+ V4L2 stateless * HEVC extended-SPS RPS control definitions, shipped as an internal * header so this libva backend can be built against pre-7.0 * linux-api-headers packages (currently ampere ships 6.19-1). * * Upstream source: linux kernel, include/uapi/linux/v4l2-controls.h * As-of: Linux 7.0-rc3 (Detlev Casanova / Collabora "VDPU381/VDPU383" * series, see lkml.org/lkml/2026/1/9/1334). The two CIDs + two structs * + two flag macros below are byte-for-byte the kernel UAPI definitions. * * Once linux-api-headers >= 7.0 is the floor across the fleet, this * shim becomes redundant — `` will provide the * same symbols. The include order in h265.c is: this header BEFORE * , so when the system catches up, the macro * guards below silently no-op and we use the system definitions. * * License: MIT (matches backend's COPYING.MIT). Per LGPL § 3.b., the * kernel UAPI struct definitions themselves are excepted from the * kernel's overall GPL and may be copied verbatim into userspace * binaries without inheriting GPL. * * Rationale + iter2 plan: see * ~/src/ampere-kernel-decoders/phase4_plan_iter2.md (§Step 3) * ~/src/ampere-kernel-decoders/phase0_findings_iter2.md */ #ifndef LIBVA_V4L2_REQUEST_FOURIER_V4L2_HEVC_EXT_CONTROLS_H #define LIBVA_V4L2_REQUEST_FOURIER_V4L2_HEVC_EXT_CONTROLS_H #include #include #ifndef V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS # define V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS \ (V4L2_CID_CODEC_STATELESS_BASE + 408) #endif #ifndef V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS # define V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS \ (V4L2_CID_CODEC_STATELESS_BASE + 409) #endif #ifndef V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED # define V4L2_HEVC_EXT_SPS_ST_RPS_FLAG_INTER_REF_PIC_SET_PRED 0x1 #endif #ifndef V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT # define V4L2_HEVC_EXT_SPS_LT_RPS_FLAG_USED_LT 0x1 #endif /* * struct v4l2_ctrl_hevc_ext_sps_st_rps — HEVC short-term RPS parameters. * * Dynamic-size 1-dimension array. Number of elements is * v4l2_ctrl_hevc_sps::num_short_term_ref_pic_sets * Can contain up to 65 elements (the H.265 spec § 7.4.3.2.1 maximum). */ #ifndef V4L2_HEVC_EXT_SPS_ST_RPS_DEFINED # define V4L2_HEVC_EXT_SPS_ST_RPS_DEFINED 1 struct v4l2_ctrl_hevc_ext_sps_st_rps { __u8 delta_idx_minus1; __u8 delta_rps_sign; __u8 num_negative_pics; __u8 num_positive_pics; __u32 used_by_curr_pic; __u32 use_delta_flag; __u16 abs_delta_rps_minus1; __u16 delta_poc_s0_minus1[16]; __u16 delta_poc_s1_minus1[16]; __u16 flags; }; #endif /* * struct v4l2_ctrl_hevc_ext_sps_lt_rps — HEVC long-term RPS parameters. * * Dynamic-size 1-dimension array. Number of elements is * v4l2_ctrl_hevc_sps::num_long_term_ref_pics_sps * Can contain up to 33 elements (the H.265 spec § 7.4.3.2.1 maximum). */ #ifndef V4L2_HEVC_EXT_SPS_LT_RPS_DEFINED # define V4L2_HEVC_EXT_SPS_LT_RPS_DEFINED 1 struct v4l2_ctrl_hevc_ext_sps_lt_rps { __u16 lt_ref_pic_poc_lsb_sps; __u16 flags; }; #endif #endif /* LIBVA_V4L2_REQUEST_FOURIER_V4L2_HEVC_EXT_CONTROLS_H */