Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation/gpu: Add kernel doc entry for MPC

This commit adds a kernel-doc entry for the MPC block. Since it enabled
the kernel-doc to parse some of the documentation in the mpc.h file,
fixing some of the comments was required.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <Harry.Wentland@amd.com>
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rodrigo Siqueira and committed by
Alex Deucher
b8c1c3a8 c371aa12

+183 -78
+12
Documentation/gpu/amdgpu/display/dcn-blocks.rst
··· 40 40 41 41 .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h 42 42 :internal: 43 + 44 + MPC 45 + --- 46 + 47 + .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h 48 + :doc: overview 49 + 50 + .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h 51 + :export: 52 + 53 + .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h 54 + :internal:
-3
Documentation/gpu/amdgpu/display/display-manager.rst
··· 132 132 (MPC), as follows: 133 133 134 134 .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h 135 - :doc: mpc-overview 136 - 137 - .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h 138 135 :functions: mpcc_blnd_cfg 139 136 140 137 Therefore, the blending configuration for a single MPCC instance on the MPC
+171 -75
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h
··· 23 23 */ 24 24 25 25 /** 26 - * DOC: mpc-overview 26 + * DOC: overview 27 27 * 28 - * Multiple Pipe/Plane Combined (MPC) is a component in the hardware pipeline 28 + * Multiple Pipe/Plane Combiner (MPC) is a component in the hardware pipeline 29 29 * that performs blending of multiple planes, using global and per-pixel alpha. 30 30 * It also performs post-blending color correction operations according to the 31 31 * hardware capabilities, such as color transformation matrix and gamma 1D and 32 32 * 3D LUT. 33 + * 34 + * MPC receives output from all DPP pipes and combines them to multiple outputs 35 + * supporting "M MPC inputs -> N MPC outputs" flexible composition 36 + * architecture. It features: 37 + * 38 + * - Programmable blending structure to allow software controlled blending and 39 + * cascading; 40 + * - Programmable window location of each DPP in active region of display; 41 + * - Combining multiple DPP pipes in one active region when a single DPP pipe 42 + * cannot process very large surface; 43 + * - Combining multiple DPP from different SLS with blending; 44 + * - Stereo formats from single DPP in top-bottom or side-by-side modes; 45 + * - Stereo formats from 2 DPPs; 46 + * - Alpha blending of multiple layers from different DPP pipes; 47 + * - Programmable background color; 33 48 */ 34 49 35 50 #ifndef __DC_MPCC_H__ ··· 98 83 99 84 /** 100 85 * struct mpcc_blnd_cfg - MPCC blending configuration 101 - * 102 - * @black_color: background color 103 - * @alpha_mode: alpha blend mode (MPCC_ALPHA_BLND_MODE) 104 - * @pre_multiplied_alpha: whether pixel color values were pre-multiplied by the 105 - * alpha channel (MPCC_ALPHA_MULTIPLIED_MODE) 106 - * @global_gain: used when blend mode considers both pixel alpha and plane 107 - * alpha value and assumes the global alpha value. 108 - * @global_alpha: plane alpha value 109 - * @overlap_only: whether overlapping of different planes is allowed 110 - * @bottom_gain_mode: blend mode for bottom gain setting 111 - * @background_color_bpc: background color for bpc 112 - * @top_gain: top gain setting 113 - * @bottom_inside_gain: blend mode for bottom inside 114 - * @bottom_outside_gain: blend mode for bottom outside 115 86 */ 116 87 struct mpcc_blnd_cfg { 117 - struct tg_color black_color; /* background color */ 118 - enum mpcc_alpha_blend_mode alpha_mode; /* alpha blend mode */ 119 - bool pre_multiplied_alpha; /* alpha pre-multiplied mode flag */ 88 + /** 89 + * @black_color: background color. 90 + */ 91 + struct tg_color black_color; 92 + 93 + /** 94 + * @alpha_mode: alpha blend mode (MPCC_ALPHA_BLND_MODE). 95 + */ 96 + enum mpcc_alpha_blend_mode alpha_mode; 97 + 98 + /*** 99 + * @@pre_multiplied_alpha: 100 + * 101 + * Whether pixel color values were pre-multiplied by the alpha channel 102 + * (MPCC_ALPHA_MULTIPLIED_MODE). 103 + */ 104 + bool pre_multiplied_alpha; 105 + 106 + /** 107 + * @global_gain: Used when blend mode considers both pixel alpha and plane. 108 + */ 120 109 int global_gain; 110 + 111 + /** 112 + * @global_alpha: Plane alpha value. 113 + */ 121 114 int global_alpha; 115 + 116 + /** 117 + * @@overlap_only: Whether overlapping of different planes is allowed. 118 + */ 122 119 bool overlap_only; 123 120 124 121 /* MPCC top/bottom gain settings */ 122 + 123 + /** 124 + * @bottom_gain_mode: Blend mode for bottom gain setting. 125 + */ 125 126 int bottom_gain_mode; 127 + 128 + /** 129 + * @background_color_bpc: Background color for bpc. 130 + */ 126 131 int background_color_bpc; 132 + 133 + /** 134 + * @top_gain: Top gain setting. 135 + */ 127 136 int top_gain; 137 + 138 + /** 139 + * @bottom_inside_gain: Blend mode for bottom inside. 140 + */ 128 141 int bottom_inside_gain; 142 + 143 + /** 144 + * @bottom_outside_gain: Blend mode for bottom outside. 145 + */ 129 146 int bottom_outside_gain; 130 147 }; 131 148 ··· 197 150 198 151 /** 199 152 * struct mpcc - MPCC connection and blending configuration for a single MPCC instance. 200 - * @mpcc_id: MPCC physical instance 201 - * @dpp_id: DPP input to this MPCC 202 - * @mpcc_bot: pointer to bottom layer MPCC. NULL when not connected. 203 - * @blnd_cfg: the blending configuration for this MPCC 204 - * @sm_cfg: stereo mix setting for this MPCC 205 - * @shared_bottom: if MPCC output to both OPP and DWB endpoints, true. Otherwise, false. 206 153 * 207 154 * This struct is used as a node in an MPC tree. 208 155 */ 209 156 struct mpcc { 210 - int mpcc_id; /* MPCC physical instance */ 211 - int dpp_id; /* DPP input to this MPCC */ 212 - struct mpcc *mpcc_bot; /* pointer to bottom layer MPCC. NULL when not connected */ 213 - struct mpcc_blnd_cfg blnd_cfg; /* The blending configuration for this MPCC */ 214 - struct mpcc_sm_cfg sm_cfg; /* stereo mix setting for this MPCC */ 215 - bool shared_bottom; /* TRUE if MPCC output to both OPP and DWB endpoints, else FALSE */ 157 + /** 158 + * @mpcc_id: MPCC physical instance. 159 + */ 160 + int mpcc_id; 161 + 162 + /** 163 + * @dpp_id: DPP input to this MPCC 164 + */ 165 + int dpp_id; 166 + 167 + /** 168 + * @mpcc_bot: Pointer to bottom layer MPCC. NULL when not connected. 169 + */ 170 + struct mpcc *mpcc_bot; 171 + 172 + /** 173 + * @blnd_cfg: The blending configuration for this MPCC. 174 + */ 175 + struct mpcc_blnd_cfg blnd_cfg; 176 + 177 + /** 178 + * @sm_cfg: stereo mix setting for this MPCC 179 + */ 180 + struct mpcc_sm_cfg sm_cfg; 181 + 182 + /** 183 + * @shared_bottom: 184 + * 185 + * If MPCC output to both OPP and DWB endpoints, true. Otherwise, false. 186 + */ 187 + bool shared_bottom; 216 188 }; 217 189 218 190 /** 219 191 * struct mpc_tree - MPC tree represents all MPCC connections for a pipe. 220 192 * 221 - * @opp_id: the OPP instance that owns this MPC tree 222 - * @opp_list: the top MPCC layer of the MPC tree that outputs to OPP endpoint 223 193 * 224 194 */ 225 195 struct mpc_tree { 226 - int opp_id; /* The OPP instance that owns this MPC tree */ 227 - struct mpcc *opp_list; /* The top MPCC layer of the MPC tree that outputs to OPP endpoint */ 196 + /** 197 + * @opp_id: The OPP instance that owns this MPC tree. 198 + */ 199 + int opp_id; 200 + 201 + /** 202 + * @opp_list: the top MPCC layer of the MPC tree that outputs to OPP endpoint 203 + */ 204 + struct mpcc *opp_list; 228 205 }; 229 206 230 207 struct mpc { ··· 295 224 * Only used for planes that are part of blending chain for OPP output 296 225 * 297 226 * Parameters: 298 - * [in/out] mpc - MPC context. 299 - * [in/out] tree - MPC tree structure that plane will be added to. 300 - * [in] blnd_cfg - MPCC blending configuration for the new blending layer. 301 - * [in] sm_cfg - MPCC stereo mix configuration for the new blending layer. 302 - * stereo mix must disable for the very bottom layer of the tree config. 303 - * [in] insert_above_mpcc - Insert new plane above this MPCC. If NULL, insert as bottom plane. 304 - * [in] dpp_id - DPP instance for the plane to be added. 305 - * [in] mpcc_id - The MPCC physical instance to use for blending. 306 227 * 307 - * Return: struct mpcc* - MPCC that was added. 228 + * - [in/out] mpc - MPC context. 229 + * - [in/out] tree - MPC tree structure that plane will be added to. 230 + * - [in] blnd_cfg - MPCC blending configuration for the new blending layer. 231 + * - [in] sm_cfg - MPCC stereo mix configuration for the new blending layer. 232 + * stereo mix must disable for the very bottom layer of the tree config. 233 + * - [in] insert_above_mpcc - Insert new plane above this MPCC. 234 + * If NULL, insert as bottom plane. 235 + * - [in] dpp_id - DPP instance for the plane to be added. 236 + * - [in] mpcc_id - The MPCC physical instance to use for blending. 237 + * 238 + * Return: 239 + * 240 + * struct mpcc* - MPCC that was added. 308 241 */ 309 242 struct mpcc* (*insert_plane)( 310 243 struct mpc *mpc, ··· 325 250 * Remove a specified MPCC from the MPC tree. 326 251 * 327 252 * Parameters: 328 - * [in/out] mpc - MPC context. 329 - * [in/out] tree - MPC tree structure that plane will be removed from. 330 - * [in/out] mpcc - MPCC to be removed from tree. 331 253 * 332 - * Return: void 254 + * - [in/out] mpc - MPC context. 255 + * - [in/out] tree - MPC tree structure that plane will be removed from. 256 + * - [in/out] mpcc - MPCC to be removed from tree. 257 + * 258 + * Return: 259 + * 260 + * void 333 261 */ 334 262 void (*remove_mpcc)( 335 263 struct mpc *mpc, ··· 345 267 * Reset the MPCC HW status by disconnecting all muxes. 346 268 * 347 269 * Parameters: 348 - * [in/out] mpc - MPC context. 349 270 * 350 - * Return: void 271 + * - [in/out] mpc - MPC context. 272 + * 273 + * Return: 274 + * 275 + * void 351 276 */ 352 277 void (*mpc_init)(struct mpc *mpc); 353 278 void (*mpc_init_single_inst)( ··· 363 282 * Update the blending configuration for a specified MPCC. 364 283 * 365 284 * Parameters: 366 - * [in/out] mpc - MPC context. 367 - * [in] blnd_cfg - MPCC blending configuration. 368 - * [in] mpcc_id - The MPCC physical instance. 369 285 * 370 - * Return: void 286 + * - [in/out] mpc - MPC context. 287 + * - [in] blnd_cfg - MPCC blending configuration. 288 + * - [in] mpcc_id - The MPCC physical instance. 289 + * 290 + * Return: 291 + * 292 + * void 371 293 */ 372 294 void (*update_blending)( 373 295 struct mpc *mpc, ··· 380 296 /** 381 297 * @cursor_lock: 382 298 * 383 - * Lock cursor updates for the specified OPP. 384 - * OPP defines the set of MPCC that are locked together for cursor. 299 + * Lock cursor updates for the specified OPP. OPP defines the set of 300 + * MPCC that are locked together for cursor. 385 301 * 386 302 * Parameters: 387 - * [in] mpc - MPC context. 388 - * [in] opp_id - The OPP to lock cursor updates on 389 - * [in] lock - lock/unlock the OPP 390 303 * 391 - * Return: void 304 + * - [in] mpc - MPC context. 305 + * - [in] opp_id - The OPP to lock cursor updates on 306 + * - [in] lock - lock/unlock the OPP 307 + * 308 + * Return: 309 + * 310 + * void 392 311 */ 393 312 void (*cursor_lock)( 394 313 struct mpc *mpc, ··· 401 314 /** 402 315 * @insert_plane_to_secondary: 403 316 * 404 - * Add DPP into secondary MPC tree based on specified blending position. 405 - * Only used for planes that are part of blending chain for DWB output 317 + * Add DPP into secondary MPC tree based on specified blending 318 + * position. Only used for planes that are part of blending chain for 319 + * DWB output 406 320 * 407 321 * Parameters: 408 - * [in/out] mpc - MPC context. 409 - * [in/out] tree - MPC tree structure that plane will be added to. 410 - * [in] blnd_cfg - MPCC blending configuration for the new blending layer. 411 - * [in] sm_cfg - MPCC stereo mix configuration for the new blending layer. 412 - * stereo mix must disable for the very bottom layer of the tree config. 413 - * [in] insert_above_mpcc - Insert new plane above this MPCC. If NULL, insert as bottom plane. 414 - * [in] dpp_id - DPP instance for the plane to be added. 415 - * [in] mpcc_id - The MPCC physical instance to use for blending. 416 322 * 417 - * Return: struct mpcc* - MPCC that was added. 323 + * - [in/out] mpc - MPC context. 324 + * - [in/out] tree - MPC tree structure that plane will be added to. 325 + * - [in] blnd_cfg - MPCC blending configuration for the new blending layer. 326 + * - [in] sm_cfg - MPCC stereo mix configuration for the new blending layer. 327 + * stereo mix must disable for the very bottom layer of the tree config. 328 + * - [in] insert_above_mpcc - Insert new plane above this MPCC. If 329 + * NULL, insert as bottom plane. 330 + * - [in] dpp_id - DPP instance for the plane to be added. 331 + * - [in] mpcc_id - The MPCC physical instance to use for blending. 332 + * 333 + * Return: 334 + * 335 + * struct mpcc* - MPCC that was added. 418 336 */ 419 337 struct mpcc* (*insert_plane_to_secondary)( 420 338 struct mpc *mpc, ··· 436 344 * Remove a specified DPP from the 'secondary' MPC tree. 437 345 * 438 346 * Parameters: 439 - * [in/out] mpc - MPC context. 440 - * [in/out] tree - MPC tree structure that plane will be removed from. 441 - * [in] mpcc - MPCC to be removed from tree. 442 - * Return: void 347 + * 348 + * - [in/out] mpc - MPC context. 349 + * - [in/out] tree - MPC tree structure that plane will be removed from. 350 + * - [in] mpcc - MPCC to be removed from tree. 351 + * 352 + * Return: 353 + * 354 + * void 443 355 */ 444 356 void (*remove_mpcc_from_secondary)( 445 357 struct mpc *mpc,