STRUCT DC_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct dc_state(9) β€” the full description of a state requested by users 🌸

okay so this is a page from the Kernel API Manual, and bestie, it's a big one. grab a snack. πŸ“


✨ NAME ✨

struct dc_state β€” literally the full description of a state requested by users. the whole vibe of a request, captured in one struct. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

struct dc_state {
    struct dc_stream_state *streams[MAX_PIPES];
    struct dc_stream_status stream_status[MAX_PIPES];
    struct dc_stream_state *phantom_streams[MAX_PHANTOM_PIPES];
    struct dc_plane_state *phantom_planes[MAX_PHANTOM_PIPES];
    uint8_t stream_count;
    uint8_t stream_mask;
    uint8_t phantom_stream_count;
    uint8_t phantom_plane_count;
    struct dc_probe_state probes[MAX_PROBES];
    struct dc_probe_status probe_status[MAX_PROBES];
    int probe_count;
    struct resource_context res_ctx;
    struct dm_pp_display_configuration pp_display_cfg;
    struct dcn_bw_internal_vars dcn_bw_vars;
    struct clk_mgr *clk_mgr;
    struct bw_context bw_ctx;
    struct block_sequence block_sequence[MAX_HWSS_BLOCK_SEQUENCE_SIZE];
    unsigned int block_sequence_steps;
    struct dc_dmub_cmd dc_dmub_cmd[10];
    unsigned int dmub_cmd_count;
    struct kref refcount;
    struct {
      unsigned int stutter_period_us;
    } perf_params;
    enum dc_power_source_type power_source;
 };

🌈 Members 🌈

look at all these fields, no cap, each one's got a job:

  • streams β€” stream state properties, iconic.
  • stream_status β€” planes status on a given stream. it's giving "who's on which stream". πŸ¦‹
  • phantom_streams β€” stream state properties for phantoms (yes, phantoms, they're real, that's the joke).
  • phantom_planes β€” planes state properties for phantoms.
  • stream_count β€” total phantom planes in use. (that's exactly what the field comment says, so we're keeping it, iykyk. πŸ”₯)
  • probes β€” the committed absolute set of probe descriptors. absolute, bestie. no negotiating.
  • probe_status β€” the committed absolute set of probe results.
  • probe_count β€” number of valid entries in probes. so you know how many of them actually count.
  • res_ctx β€” persistent state of resources. main character energy for resource bookkeeping. πŸ‘‘
  • pp_display_cfg β€” PowerPlay clocks and settings.
⚠️ note: this is a big struct, do not put on stack! seriously. it's huge. the stack did not consent to this. 😭
  • dcn_bw_vars β€” non-stack memory to support bandwidth calculations.
⚠️ note: this is a big struct, do not put on stack! same warning, same energy. πŸ’€
  • bw_ctx β€” the output from bandwidth and watermark calculations and the DML.

Each context must have its own instance of VBA, and in order to initialize and obtain IP and SOC, the base DML instance from DC is initially copied into every context. that's just how the setup works, fr fr. 🧚

  • refcount β€” refcount reference.

Notice that dc_state is used around the code to capture the current context, so we need to pass it everywhere. That's why we want to use kref in this struct. it travels. it's everywhere. that's the whole reason. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./drivers/gpu/drm/amd/display/dc/inc/core_types.h β€” go read it, bestie, it's right there. 🫢

and that's the whole page! ✨ official sign-off time: this absolute gem lives under ./drivers/gpu/drm/amd/display/... and it's dated October 2026. see you in the future, mwah. πŸ’–πŸŽ€β­

πŸ“¦ where this page comes from