STRUCT DRM_DSC_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 are 8/10/12. pick one, king.
  • convert_rgb β€” flag that says whether RGB β†’ YCoCg conversion is needed. True if the input is RGB, False if 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 β€” True if simple 4_2_2 mode is enabled, else False.
  • 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's bits_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 β€” True if block prediction is used to code any groups within the picture, False if 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 in struct 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 β€” True if VBR mode is enabled, false if 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 β€” True if Native 4:2:2 is supported, else false.
  • native_420 β€” True if Native 4:2:0 is supported, else false.
  • 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