Commit 43d61f6d authored by Melissa Wen's avatar Melissa Wen Committed by Alex Deucher

drm/amd/display: add doc entries for MPC blending configuration

Describe structs and enums used to set blend mode properties to MPC
blocks. Some pieces of information are already available as code
comments, and were just formatted. Others were collected and summarised
from discussions on AMD issue tracker[1][2].

[1] https://gitlab.freedesktop.org/drm/amd/-/issues/1734
[2] https://gitlab.freedesktop.org/drm/amd/-/issues/1769

v2:
- fix typos (Tales)
- add MPCC to MPC entry in the glossary
Signed-off-by: default avatarMelissa Wen <mwen@igalia.com>
Reviewed-by: default avatarTales Aparecida <tales.aparecida@gmail.com>
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 78e16ac1
...@@ -170,7 +170,7 @@ consider asking in the amdgfx and update this page. ...@@ -170,7 +170,7 @@ consider asking in the amdgfx and update this page.
MC MC
Memory Controller Memory Controller
MPC MPC/MPCC
Multiple pipes and plane combine Multiple pipes and plane combine
MPO MPO
......
...@@ -22,6 +22,16 @@ ...@@ -22,6 +22,16 @@
* *
*/ */
/**
* DOC: mpc-overview
*
* Multiple Pipe/Plane Combined (MPC) is a component in the hardware pipeline
* that performs blending of multiple planes, using global and per-pixel alpha.
* It also performs post-blending color correction operations according to the
* hardware capabilities, such as color transformation matrix and gamma 1D and
* 3D LUT.
*/
#ifndef __DC_MPCC_H__ #ifndef __DC_MPCC_H__
#define __DC_MPCC_H__ #define __DC_MPCC_H__
...@@ -48,14 +58,39 @@ enum mpcc_blend_mode { ...@@ -48,14 +58,39 @@ enum mpcc_blend_mode {
MPCC_BLEND_MODE_TOP_BOT_BLENDING MPCC_BLEND_MODE_TOP_BOT_BLENDING
}; };
/**
* enum mpcc_alpha_blend_mode - define the alpha blend mode regarding pixel
* alpha and plane alpha values
*/
enum mpcc_alpha_blend_mode { enum mpcc_alpha_blend_mode {
/**
* @MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA: per pixel alpha using DPP
* alpha value
*/
MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA, MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA,
/**
* @MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA_COMBINED_GLOBAL_GAIN: per
* pixel alpha using DPP alpha value multiplied by a global gain (plane
* alpha)
*/
MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA_COMBINED_GLOBAL_GAIN, MPCC_ALPHA_BLEND_MODE_PER_PIXEL_ALPHA_COMBINED_GLOBAL_GAIN,
/**
* @MPCC_ALPHA_BLEND_MODE_GLOBAL_ALPHA: global alpha value, ignores
* pixel alpha and consider only plane alpha
*/
MPCC_ALPHA_BLEND_MODE_GLOBAL_ALPHA MPCC_ALPHA_BLEND_MODE_GLOBAL_ALPHA
}; };
/* /**
* MPCC blending configuration * struct mpcc_blnd_cfg - MPCC blending configuration
*
* @black_color: background color
* @alpha_mode: alpha blend mode (MPCC_ALPHA_BLND_MODE)
* @pre_multiplied_alpha: whether pixel color values were pre-multiplied by the
* alpha channel (MPCC_ALPHA_MULTIPLIED_MODE)
* @global_gain: used when blend mode considers both pixel alpha and plane
* alpha value and assumes the global alpha value.
* @global_alpha: plane alpha value
*/ */
struct mpcc_blnd_cfg { struct mpcc_blnd_cfg {
struct tg_color black_color; /* background color */ struct tg_color black_color; /* background color */
...@@ -107,8 +142,15 @@ struct mpc_dwb_flow_control { ...@@ -107,8 +142,15 @@ struct mpc_dwb_flow_control {
int flow_ctrl_cnt1; int flow_ctrl_cnt1;
}; };
/* /**
* MPCC connection and blending configuration for a single MPCC instance. * struct mpcc - MPCC connection and blending configuration for a single MPCC instance.
* @mpcc_id: MPCC physical instance
* @dpp_id: DPP input to this MPCC
* @mpcc_bot: pointer to bottom layer MPCC. NULL when not connected.
* @blnd_cfg: the blending configuration for this MPCC
* @sm_cfg: stereo mix setting for this MPCC
* @shared_bottom: if MPCC output to both OPP and DWB endpoints, true. Otherwise, false.
*
* This struct is used as a node in an MPC tree. * This struct is used as a node in an MPC tree.
*/ */
struct mpcc { struct mpcc {
...@@ -120,8 +162,12 @@ struct mpcc { ...@@ -120,8 +162,12 @@ struct mpcc {
bool shared_bottom; /* TRUE if MPCC output to both OPP and DWB endpoints, else FALSE */ bool shared_bottom; /* TRUE if MPCC output to both OPP and DWB endpoints, else FALSE */
}; };
/* /**
* MPC tree represents all MPCC connections for a pipe. * struct mpc_tree - MPC tree represents all MPCC connections for a pipe.
*
* @opp_id: the OPP instance that owns this MPC tree
* @opp_list: the top MPCC layer of the MPC tree that outputs to OPP endpoint
*
*/ */
struct mpc_tree { struct mpc_tree {
int opp_id; /* The OPP instance that owns this MPC tree */ int opp_id; /* The OPP instance that owns this MPC tree */
...@@ -149,13 +195,18 @@ struct mpcc_state { ...@@ -149,13 +195,18 @@ struct mpcc_state {
uint32_t busy; uint32_t busy;
}; };
/**
* struct mpc_funcs - funcs
*/
struct mpc_funcs { struct mpc_funcs {
void (*read_mpcc_state)( void (*read_mpcc_state)(
struct mpc *mpc, struct mpc *mpc,
int mpcc_inst, int mpcc_inst,
struct mpcc_state *s); struct mpcc_state *s);
/* /**
* @insert_plane:
*
* Insert DPP into MPC tree based on specified blending position. * Insert DPP into MPC tree based on specified blending position.
* Only used for planes that are part of blending chain for OPP output * Only used for planes that are part of blending chain for OPP output
* *
...@@ -180,7 +231,9 @@ struct mpc_funcs { ...@@ -180,7 +231,9 @@ struct mpc_funcs {
int dpp_id, int dpp_id,
int mpcc_id); int mpcc_id);
/* /**
* @remove_mpcc:
*
* Remove a specified MPCC from the MPC tree. * Remove a specified MPCC from the MPC tree.
* *
* Parameters: * Parameters:
...@@ -195,7 +248,9 @@ struct mpc_funcs { ...@@ -195,7 +248,9 @@ struct mpc_funcs {
struct mpc_tree *tree, struct mpc_tree *tree,
struct mpcc *mpcc); struct mpcc *mpcc);
/* /**
* @mpc_init:
*
* Reset the MPCC HW status by disconnecting all muxes. * Reset the MPCC HW status by disconnecting all muxes.
* *
* Parameters: * Parameters:
...@@ -208,7 +263,9 @@ struct mpc_funcs { ...@@ -208,7 +263,9 @@ struct mpc_funcs {
struct mpc *mpc, struct mpc *mpc,
unsigned int mpcc_id); unsigned int mpcc_id);
/* /**
* @update_blending:
*
* Update the blending configuration for a specified MPCC. * Update the blending configuration for a specified MPCC.
* *
* Parameters: * Parameters:
...@@ -223,7 +280,9 @@ struct mpc_funcs { ...@@ -223,7 +280,9 @@ struct mpc_funcs {
struct mpcc_blnd_cfg *blnd_cfg, struct mpcc_blnd_cfg *blnd_cfg,
int mpcc_id); int mpcc_id);
/* /**
* @cursor_lock:
*
* Lock cursor updates for the specified OPP. * Lock cursor updates for the specified OPP.
* OPP defines the set of MPCC that are locked together for cursor. * OPP defines the set of MPCC that are locked together for cursor.
* *
...@@ -239,8 +298,10 @@ struct mpc_funcs { ...@@ -239,8 +298,10 @@ struct mpc_funcs {
int opp_id, int opp_id,
bool lock); bool lock);
/* /**
* Add DPP into 'secondary' MPC tree based on specified blending position. * @insert_plane_to_secondary:
*
* Add DPP into secondary MPC tree based on specified blending position.
* Only used for planes that are part of blending chain for DWB output * Only used for planes that are part of blending chain for DWB output
* *
* Parameters: * Parameters:
...@@ -264,7 +325,9 @@ struct mpc_funcs { ...@@ -264,7 +325,9 @@ struct mpc_funcs {
int dpp_id, int dpp_id,
int mpcc_id); int mpcc_id);
/* /**
* @remove_mpcc_from_secondary:
*
* Remove a specified DPP from the 'secondary' MPC tree. * Remove a specified DPP from the 'secondary' MPC tree.
* *
* Parameters: * Parameters:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment