STRUCT DRM_DSC_CONFIG(9)
π struct drm_dsc_config(9) π
okay so welcome to struct drm_dsc_config, bestie β a.k.a. the Kernel API Manual situation where the parameters required to configure DSC all live. it's giving "one struct to rule them all" and honestly? iconic. π
β¨ SYNOPSIS β¨
like, here's the whole glow-up, verbatim, no edits, we don't touch the code:
struct drm_dsc_config {
u8 line_buf_depth;
u8 bits_per_component;
bool convert_rgb;
u8 slice_count;
u16 slice_width;
u16 slice_height;
bool simple_422;
u16 pic_width;
u16 pic_height;
u8 rc_tgt_offset_high;
u8 rc_tgt_offset_low;
u16 bits_per_pixel;
u8 rc_edge_factor;
u8 rc_quant_incr_limit1;
u8 rc_quant_incr_limit0;
u16 initial_xmit_delay;
u16 initial_dec_delay;
bool block_pred_enable;
u8 first_line_bpg_offset;
u16 initial_offset;
u16 rc_buf_thresh[DSC_NUM_BUF_RANGES - 1];
struct drm_dsc_rc_range_parameters
rc_range_params[DSC_NUM_BUF_RANGES];
u16 rc_model_size;
u8 flatness_min_qp;
u8 flatness_max_qp;
u8 initial_scale_value;
u16 scale_decrement_interval;
u16 scale_increment_interval;
u16 nfl_bpg_offset;
u16 slice_bpg_offset;
u16 final_offset;
bool vbr_enable;
u8 mux_word_size;
u16 slice_chunk_size;
u16 rc_bits;
u8 dsc_version_minor;
u8 dsc_version_major;
bool native_422;
bool native_420;
u8 second_line_bpg_offset;
u16 nsl_bpg_offset;
u16 second_line_offset_adj;
};
πΈ Members πΈ
okay so this is the part where we go member by member, and there are so many, but every single one matters, so buckle up bestie π«Ά
line_buf_depthβ bits per component for the previous reconstructed line buffer. yes. that whole sentence. slay.bits_per_componentβ the bits per component we're actually coding, and the options are8/10/12. pick one, king.convert_rgbβ flag that says whether RGB β YCoCg conversion is needed.Trueif the input is RGB,Falseif the input is YCoCg. no in-between, we don't do ambiguity here πslice_countβ number of slices per line used by the DSC encoder. (the original says "Number fo slices per line" and we are respectfully not fixing that typo, we're just preserving the vibe π)slice_widthβ width of each slice, in pixels.slice_heightβ slice height, in pixels.simple_422βTrueif simple 4_2_2 mode is enabled, elseFalse.pic_widthβ width of the input display frame, in pixels.pic_heightβ vertical height of the input display frame.rc_tgt_offset_highβ offset to bits/group that the RC uses to determine QP adjustment. π₯rc_tgt_offset_lowβ offset to bits/group that the RC uses to determine QP adjustment. (yes it's the same description as the one above, and no, that's not me being lazy, that's literally what the page says β twins fr fr)bits_per_pixelβ target bits per pixel with 4 fractional bits, so it'sbits_per_pixel << 4. do not forget the shift, i'm begging π«Άrc_edge_factorβ factor used to determine if an edge is present, based on the bits produced.rc_quant_incr_limit1β slow down incrementing once the range reaches this value.rc_quant_incr_limit0β slow down incrementing once the range reaches this value. (again β same words, both limits, we keep them both, that's the rule π)initial_xmit_delayβ number of pixels to delay the initial transmission.initial_dec_delayβ initial decoder delay: the number of pixel times that the decoder accumulates data in its rate buffer before it starts to decode and output pixels.block_pred_enableβTrueif block prediction is used to code any groups within the picture,Falseif BP is not used.first_line_bpg_offsetβ number of additional bits allocated for each group on the first line of the slice.initial_offsetβ the value to use for the RC model offset at slice start.rc_buf_threshβ the thresholds defining each of the buffer ranges.rc_range_paramsβ parameters for each of the RC ranges, as defined instruct drm_dsc_rc_range_parameters. iykyk πrc_model_sizeβ total size of the RC model.flatness_min_qpβ minimum QP where flatness information gets sent.flatness_max_qpβ maximum QP where flatness information gets sent.initial_scale_valueβ the initial value for the scale factor.scale_decrement_intervalβ specifies the number of group times between decrementing the scale factor at the beginning of a slice.scale_increment_intervalβ number of group times between incrementing the scale factor value used at the beginning of a slice.nfl_bpg_offsetβ non first line BPG offset to be used.slice_bpg_offsetβ BPG offset used to enforce the slice bit.final_offsetβ final RC linear transformation offset value.vbr_enableβTrueif VBR mode is enabled,falseif disabled.mux_word_sizeβ mux word size (in bits) for SSM mode.slice_chunk_sizeβ the (max) size in bytes of the "chunks" that get used in slice multiplexing.rc_bitsβ rate control buffer size, in bits.dsc_version_minorβ DSC minor version.dsc_version_majorβ DSC major version.native_422βTrueif Native 4:2:2 is supported, elsefalse.native_420βTrueif Native 4:2:0 is supported, elsefalse.second_line_bpg_offsetβ additional bits/grp for the seconnd line of the slice, for native 4:2:0. (yes "seconnd". keeping it. that's the canon text bestie β¨)nsl_bpg_offsetβ number of bits deallocated for each grp that is not in the second line of the slice.second_line_offset_adjβ offset adjustment for the second line in Native 4:2:0 mode.
π¦ Description π¦
so like, the driver populates this structure with all the parameters required to configure the display stream compression on the source. that's it, that's the whole description, but honestly it's kind of the main character of the entire page β everything above is just the receipts π
lowkey important: this struct is a driver-fills-it-in situation. the driver is the one populating it. don't come for me, that's literally what the page says. π§
π SEE ALSO π
go look at these, bestie, they're the friend group:
- Kernel file
./include/drm/display/drm_dsc.h struct drm_dsc_rc_range_parameters(9)struct drm_dsc_picture_parameter_set(9)struct drm_dsc_pps_infoframe(9)
and that's the whole page, bestie, no notes, ate and left no crumbs π β¨
source: ./include/drm/display Β· date: October 2026 Β· page: struct drm_dsc_config(9) β mwah, go configure some display stream compression, you're literally built for this π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms