STRUCT MPC_FUNCS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct mpc_funcs(9) β€” Kernel API Manual πŸ’…

🌸 NAME 🌸

struct mpc_funcs β€” literally the funcs struct. That’s the name, bestie, no notes. πŸ’–


✨ SYNOPSIS ✨

okay so the whole struct is right here, and yes every single function pointer is invited to the party. Copy it exactly, do not touch the semicolons, and keep the nested rmcm struct β€” it’s iconic:

struct mpc_funcs {
    void (*read_mpcc_state)( struct mpc *mpc, int mpcc_inst, struct
mpcc_state *s);
    void (*mpc_read_reg_state)( struct mpc *mpc, int mpcc_inst, struct
dcn_mpc_reg_state *mpc_reg_state);
    struct mpcc* (*insert_plane)( struct mpc *mpc, struct mpc_tree
*tree, struct mpcc_blnd_cfg *blnd_cfg, struct mpcc_sm_cfg *sm_cfg,
struct mpcc *insert_above_mpcc, int dpp_id, int mpcc_id);
    void (*remove_mpcc)( struct mpc *mpc, struct mpc_tree *tree, struct
mpcc *mpcc);
    void (*mpc_init)(struct mpc *mpc);
    void (*mpc_init_single_inst)( struct mpc *mpc, unsigned int
mpcc_id);
    void (*update_blending)( struct mpc *mpc, struct mpcc_blnd_cfg
*blnd_cfg, int mpcc_id);
    void (*cursor_lock)( struct mpc *mpc, int opp_id, bool lock);
    struct mpcc* (*insert_plane_to_secondary)( struct mpc *mpc, struct
mpc_tree *tree, struct mpcc_blnd_cfg *blnd_cfg, struct mpcc_sm_cfg
*sm_cfg, struct mpcc *insert_above_mpcc, int dpp_id, int mpcc_id);
    void (*remove_mpcc_from_secondary)( struct mpc *mpc, struct mpc_tree
*tree, struct mpcc *mpcc);
    struct mpcc* (*get_mpcc_for_dpp_from_secondary)( struct mpc_tree
*tree, int dpp_id);
    struct mpcc* (*get_mpcc_for_dpp)( struct mpc_tree *tree, int
dpp_id);
    void (*wait_for_idle)(struct mpc *mpc, int id);
    void (*assert_mpcc_idle_before_connect)(struct mpc *mpc, int
mpcc_id);
    void (*init_mpcc_list_from_hw)( struct mpc *mpc, struct mpc_tree
*tree);
    void (*set_denorm)(struct mpc *mpc, int opp_id, enum dc_color_depth
output_depth);
    void (*set_denorm_clamp)( struct mpc *mpc, int opp_id, struct
mpc_denorm_clamp denorm_clamp);
    void (*set_output_csc)(struct mpc *mpc, int opp_id, const uint16_t
*regval, enum mpc_output_csc_mode ocsc_mode);
    void (*set_ocsc_default)(struct mpc *mpc, int opp_id, enum
dc_color_space color_space, enum mpc_output_csc_mode ocsc_mode);
    void (*set_output_gamma)( struct mpc *mpc, int mpcc_id, const struct
pwl_params *params);
    void (*power_on_mpc_mem_pwr)( struct mpc *mpc, int mpcc_id, bool
power_on);
    void (*set_dwb_mux)( struct mpc *mpc, int dwb_id, int mpcc_id);
    void (*disable_dwb_mux)( struct mpc *mpc, int dwb_id);
    bool (*is_dwb_idle)( struct mpc *mpc, int dwb_id);
    void (*set_out_rate_control)( struct mpc *mpc, int opp_id, bool
enable, bool rate_2x_mode, struct mpc_dwb_flow_control *flow_control);
    void (*set_gamut_remap)( struct mpc *mpc, int mpcc_id, const struct
mpc_grph_gamut_adjustment *adjust);
    bool (*program_1dlut)( struct mpc *mpc, const struct pwl_params
*params, uint32_t rmu_idx);
    bool (*program_shaper)( struct mpc *mpc, const struct pwl_params
*params, uint32_t rmu_idx);
    uint32_t (*acquire_rmu)(struct mpc *mpc, int mpcc_id, int rmu_idx);
    bool (*program_3dlut)( struct mpc *mpc, const struct
tetrahedral_params *params, int rmu_idx);
    int (*release_rmu)(struct mpc *mpc, int mpcc_id);
    unsigned int (*get_mpc_out_mux)( struct mpc *mpc, int opp_id);
    void (*set_bg_color)(struct mpc *mpc, struct tg_color *bg_color, int
mpcc_id);
    void (*set_mpc_mem_lp_mode)(struct mpc *mpc);
    void (*set_movable_cm_location)(struct mpc *mpc, enum
mpcc_movable_cm_location location, int mpcc_id);
    void (*update_3dlut_fast_load_select)(struct mpc *mpc, int mpcc_id,
int hubp_idx);
    void (*get_3dlut_fast_load_status)(struct mpc *mpc, int mpcc_id,
uint32_t *done, uint32_t *soft_underflow, uint32_t *hard_underflow);
    void (*populate_lut)(struct mpc *mpc, const enum MCM_LUT_ID id,
const union mcm_lut_params *params, const bool lut_bank_a, const int
mpcc_id);
    void (*program_lut_read_write_control)(struct mpc *mpc, const enum
MCM_LUT_ID id, const bool lut_bank_a, const unsigned int bit_depth,
const int mpcc_id);
    void (*program_lut_mode)(struct mpc *mpc, const enum MCM_LUT_ID id,
const bool enable, const bool lut_bank_a, const enum dc_cm_lut_size
size, const int mpcc_id);
    void (*get_lut_mode)(struct mpc *mpc, const enum MCM_LUT_ID id,
const int mpcc_id, bool *enable, bool *lut_bank_a);
    struct {
      void (*fl_3dlut_configure)(struct mpc *mpc, struct
mpc_fl_3dlut_config *cfg, int mpcc_id);
      void (*enable_3dlut_fl)(struct mpc *mpc, bool enable, int
mpcc_id);
      void (*update_3dlut_fast_load_select)(struct mpc *mpc, int
mpcc_id, int hubp_idx);
      void (*program_lut_read_write_control)(struct mpc *mpc, const enum
MCM_LUT_ID id, bool lut_bank_a, bool enabled, int mpcc_id);
      void (*program_lut_mode)(struct mpc *mpc, bool enable, bool
lut_bank_a, int mpcc_id);
      void (*program_3dlut_size)(struct mpc *mpc, const enum
dc_cm_lut_size size, int mpcc_id);
      void (*program_bias_scale)(struct mpc *mpc, uint16_t bias,
uint16_t scale, int mpcc_id);
      void (*program_bit_depth)(struct mpc *mpc, uint16_t bit_depth, int
mpcc_id);
      bool (*is_config_supported)(uint32_t width);
      void (*power_on_shaper_3dlut)(struct mpc *mpc, uint32_t mpcc_id,
bool power_on);
      void (*populate_lut)(struct mpc *mpc, const union mcm_lut_params
params, bool lut_bank_a, int mpcc_id);
      void (*get_3dlut_mode)(struct mpc *mpc, int mpcc_id, bool *enable,
bool *lut_bank_a);
    } rmcm;
 };

🫢 Members 🫢

okay bestie, now we go member by member. Yes, all the documented ones from this part. Grab a strawberry πŸ“ and let’s get into it.

πŸ’– read_mpcc_state πŸ’–

Read the register content from the given MPCC physical instance. πŸ‘‘

Parameters:

  • [in/out] mpc β€” MPC context
  • [in] mpcc_instance β€” MPC context instance
  • [in] mpcc_state β€” MPC context state

Return: void

πŸ’– mpc_read_reg_state πŸ’–

Read the MPC register state for debugging underflow purposes. Underflow detective behavior, fr fr. πŸ”

Parameters:

  • [in] mpc β€” MPC context
  • [out] reg_state β€” MPC register state structure

Return: void

πŸ’– insert_plane πŸ’–

Insert a DPP into the MPC tree based on the specified blending position. Only used for planes that are part of blending chain for OPP output. ✨

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in/out] tree β€” MPC tree structure that plane will be added to.
  • [in] blnd_cfg β€” MPCC blending configuration for the new blending layer.
  • [in] sm_cfg β€” MPCC stereo mix configuration for the new blending layer. Stereo mix must disable for the very bottom layer of the tree config.
  • [in] insert_above_mpcc β€” Insert new plane above this MPCC. If NULL, insert as bottom plane.
  • [in] dpp_id β€” DPP instance for the plane to be added.
  • [in] mpcc_id β€” The MPCC physical instance to use for blending.

Return: struct mpcc* β€” MPCC that was added.

πŸ’– remove_mpcc πŸ’–

Remove a specified MPCC from the MPC tree. Bye bestie, you’re out of the tree. πŸ‘‹

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in/out] tree β€” MPC tree structure that plane will be removed from.
  • [in/out] mpcc β€” MPCC to be removed from tree.

Return: void

πŸ’– mpc_init πŸ’–

Reset the MPCC HW status by disconnecting all muxes. Clean slate energy. 🧼

Parameters:

  • [in/out] mpc β€” MPC context.

Return: void

πŸ’– mpc_init_single_inst πŸ’–

Initialize the given MPCC physical instance. πŸŽ€

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] mpcc_id β€” The MPCC physical instance to be initialized.

πŸ’– update_blending πŸ’–

Update the blending configuration for a specified MPCC. Glow-up for the blend config. 🌈

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] blnd_cfg β€” MPCC blending configuration.
  • [in] mpcc_id β€” The MPCC physical instance.

Return: void

πŸ’– cursor_lock πŸ’–

Lock cursor updates for the specified OPP. OPP defines the set of MPCC that are locked together for cursor. Cursor, but make it communal. πŸ–±οΈ

Parameters:

  • [in] mpc β€” MPC context.
  • [in] opp_id β€” The OPP to lock cursor updates on
  • [in] lock β€” lock/unlock the OPP

Return: void

πŸ’– insert_plane_to_secondary πŸ’–

Add a DPP into the secondary MPC tree based on the specified blending position. Only used for planes that are part of blending chain for DWB output. secondary-tree main character energy. 🌟

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in/out] tree β€” MPC tree structure that plane will be added to.
  • [in] blnd_cfg β€” MPCC blending configuration for the new blending layer.
  • [in] sm_cfg β€” MPCC stereo mix configuration for the new blending layer. Stereo mix must disable for the very bottom layer of the tree config.
  • [in] insert_above_mpcc β€” Insert new plane above this MPCC. If NULL, insert as bottom plane.
  • [in] dpp_id β€” DPP instance for the plane to be added.
  • [in] mpcc_id β€” The MPCC physical instance to use for blending.

Return: struct mpcc* β€” MPCC that was added.

πŸ’– remove_mpcc_from_secondary πŸ’–

Remove a specified DPP from the 'secondary' MPC tree. Not the main tree, bestie β€” the secondary one. πŸ“

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in/out] tree β€” MPC tree structure that plane will be removed from.
  • [in] mpcc β€” MPCC to be removed from tree.

Return: void

πŸ’– get_mpcc_for_dpp_from_secondary πŸ’–

Find, if it exists, a MPCC from a given 'secondary' MPC tree that is associated with the specified plane. Search era. πŸ”Ž

Parameters:

  • [in/out] tree β€” MPC tree structure to search for plane.
  • [in] dpp_id β€” DPP to be searched.

Return: struct mpcc* β€” pointer to plane or NULL if no plane found.

πŸ’– get_mpcc_for_dpp πŸ’–

Find, if it exists, a MPCC from a given MPC tree that is associated with the specified plane. Same search vibe, main tree edition. 🌸

Parameters:

  • [in/out] tree β€” MPC tree structure to search for plane.
  • [in] dpp_id β€” DPP to be searched.

Return: struct mpcc* β€” pointer to plane or NULL if no plane found.

πŸ’– wait_for_idle πŸ’–

Wait for a MPCC in MPC context to enter idle state. Patience, bestie. ⏳

Parameters:

  • [in/out] mpc β€” MPC Context.
  • [in] id β€” MPCC to wait for idle state.

Return: void

πŸ’– assert_mpcc_idle_before_connect πŸ’–

Assert if the MPCC in MPC context is in idle state. Pre-connect vibe check. βœ…

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] id β€” MPCC to assert idle state.

Return: void

πŸ’– init_mpcc_list_from_hw πŸ’–

Iterate through the MPCC array from a given MPC context struct and configure each MPCC according to its registers’ values. Hardware says jump, the MPCC array says how high. πŸ”₯

Parameters:

  • [in/out] mpc β€” MPC context to initialize MPCC array.
  • [in/out] tree β€” MPC tree structure containing MPCC contexts to initialize.

Return: void β€” okay that's the tail of the previous function, bestie; we're back in the Members zone and it's about to be a whole parade of MPC ops πŸ’…


set_denorm 🌸

Sets the corresponding OPP DENORM_CONTROL register value to a specific denorm_mode, based on the given color depth. Lowkey one of those "tiny register, big mood" situations.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] opp_id β€” Corresponding OPP to update register.
  • [in] output_depth β€” Arbitrary color depth to set denorm_mode.

Return: void

set_denorm_clamp πŸŽ€

Sets denorm clamp values on the corresponding OPP DENORM CONTROL register. Clamp it, bestie.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] opp_id β€” Corresponding OPP to update register.
  • [in] denorm_clamp β€” Arbitrary denorm clamp to be set.

Return: void

set_output_csc ✨

Sets the Output Color Space Conversion matrix with the given values and mode. Color math? We're doing it.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] opp_id β€” Corresponding OPP to update register.
  • [in] regval β€” Values to set in CSC matrix.
  • [in] ocsc_mode β€” Mode to set CSC.

Return: void

set_ocsc_default πŸ¦‹

Sets the Output Color Space Conversion matrix to default values according to the color space. Defaults but make it fashion.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] opp_id β€” Corresponding OPP to update register.
  • [in] color_space β€” OCSC color space.
  • [in] ocsc_mode β€” Mode to set CSC.

Return: void

set_output_gamma πŸ”₯

Sets output gamma with the given curve parameters. Gamma curve said "I'm the main character."

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] mpcc_id β€” Corresponding MPC to update registers.
  • [in] params β€” Parameters.

Return: void

power_on_mpc_mem_pwr πŸ’€

Powers on/off memory LUT for the given MPCC. Powering on enables LUT to be updated. Powering off allows entering low power mode. It's giving "lights on, lights off" but for hardware.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] mpcc_id β€” MPCC to power on.
  • [in] power_on

Return: void

set_dwb_mux 🌈

Sets the corresponding Display Writeback mux MPC register field to the given MPCC id. Mux it, bestie.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] dwb_id β€” DWB to be set.
  • [in] mpcc_id β€” MPCC id to be stored in DWB mux register.

Return: void

disable_dwb_mux πŸ™ˆ

Resets the corresponding Display Writeback mux MPC register field. Reset era.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] dwb_id β€” DWB to be set.

Return: void

is_dwb_idle πŸ’€

Checks DWB status on the MPC_DWB0_MUX_STATUS register field. Returns if it is null. Basically a vibe check for DWB.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] dwb_id β€” DWB to be checked.

Return: bool β€” wheter DWB is idle or not

set_out_rate_control 🎚️

Sets display output rate control. Rate control walked in with main character energy.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] opp_id β€” OPP to be set.
  • [in] enable
  • [in] rate_2x_mode
  • [in] flow_control

Return: void

set_gamut_remap 🎨

Sets post-blending CTM for the given MPCC. Gamut remap said "not me being iconic."

Parameters:

  • [in] mpc β€” MPC context.
  • [in] mpcc_id β€” MPCC to set gamut map.
  • [in] adjust

Return: void

program_1dlut ⭐

Sets 1 dimensional Lookup Table. One dimension, infinite slay.

Parameters:

  • [in/out] mpc β€” MPC context
  • [in] params β€” curve parameters for the LUT configuration
  • [in] rmu_idx

Return: bool β€” wheter LUT was set (set with given parameters) or not (params is NULL and LUT is disabled).

program_shaper 🧚

Sets shaper. Shape it, bestie.

Parameters:

  • [in/out] mpc β€” MPC context
  • [in] params β€” curve parameters to be set
  • [in] rmu_idx

Return: bool β€” wheter shaper was set (set with given parameters) or not (params is NULL and LUT is disabled).

acquire_rmu πŸ‘‘

Sets the given MPCC to be multiplexed to the given RMU unit. Claiming your RMU like it's a group chat invite.

Parameters:

  • [in/out] mpc β€” MPC context
  • [in] mpcc_id β€” MPCC
  • [in] rmu_idx β€” Given RMU unit to set MPCC to be multiplexed to.

Return: unit32_t β€” rmu_idx if operation was successful, -1 else.

program_3dlut πŸ’œ

Sets 3 dimensional Lookup Table. Three dimensions of LUT, no cap.

Parameters:

  • [in/out] mpc β€” MPC context
  • [in] params β€” tetrahedral parameters for the LUT configuration
  • [in] rmu_idx

Return: bool β€” wheter LUT was set (set with given parameters) or not (params is NULL and LUT is disabled).

release_rmu 🫢

For a given MPCC, releases the RMU unit it muliplexes to. Let it go, let it gooo.

Parameters:

  • [in/out] mpc β€” MPC context
  • [in] mpcc_id β€” MPCC

Return: int β€” a valid rmu_idx representing released RMU unit or -1 if there was no RMU unit to release.

get_mpc_out_mux πŸ“

Returns MPC out mux. Out mux said "here's my answer."

Parameters:

  • [in] mpc β€” MPC context.
  • [in] opp_id β€” OPP

Return: unsigned int β€” Out Mux

set_bg_color 🌸

Finds the corresponding bottommost MPCC and sets its bg color. Bottommost MPCC is lowkey the foundation of the look.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] bg_color β€” background color to be set.
  • [in] mpcc_id

Return: void

set_mpc_mem_lp_mode πŸŒ™

Sets mpc_mem_lp_mode. Short and mysterious, honestly.

Parameters:

  • [in/out] mpc β€” MPC context.

Return: void

set_movable_cm_location 🚚

Sets Movable CM Location. Movable? Location? We're relocating the whole vibe.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] location
  • [in] mpcc_id

Return: void

update_3dlut_fast_load_select ⚑

Updates 3D LUT fast load select. Fast load, fast slay.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] mpcc_id
  • [in] hubp_idx

Return: void

get_3dlut_fast_load_status πŸ“‘

Gets 3D LUT fast load status and references them with done, soft_underflow and hard_underflow pointers. Receipts via pointers, iykyk.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] mpcc_id
  • [in/out] done
  • [in/out] soft_underflow
  • [in/out] hard_underflow

Return: void

populate_lut 🧁

Populates LUT with the given tetrahedral parameters. Fill that LUT like it's a Stanley cup.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] id
  • [in] params
  • [in] lut_bank_a
  • [in] mpcc_id

Return: void

program_lut_read_write_control πŸ”

Programs LUT RW control. Read/write control is the bouncer at the LUT club.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] id
  • [in] lut_bank_a
  • [in] bit_depth
  • [in] mpcc_id

Return: void

program_lut_mode πŸŽ›οΈ

Programs LUT mode. Mode setting but make it fashion.

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] id
  • [in] enable
  • [in] lut_bank_a
  • [in] size
  • [in] mpcc_id

Return: void

get_lut_mode πŸ”

Obtains enablement and ram bank status. It's giving "status check, but for LUT."

Parameters:

  • [in/out] mpc β€” MPC context.
  • [in] id
  • [in] mpcc_id
  • [out] enable
  • [out] lut_bank_a

Return: void

rmcm πŸ‘‘

MPC RMCM new HW sequential programming functions. That's the whole description, bestie β€” sometimes the icon speaks for itself.


🌈 SEE ALSO 🌈

  • Kernel file ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h overview(9), enum mpcc_alpha_blend_mode(9), struct mpcc_blnd_cfg(9), struct mpcc(9), struct mpc_tree(9)

And that's the page, bestie! Footer vibes for the very end: source/version is ./drivers/gpu/drm/amd/display/..., date is October 2026, and this manual page is struct mpc_funcs(9). Periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from