2017-05-08 19:19:06 +00:00
|
|
|
/* Copyright 2012-15 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* Authors: AMD
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-06-01 22:35:54 +00:00
|
|
|
#ifndef __DC_MPCC_DCN10_H__
|
|
|
|
#define __DC_MPCC_DCN10_H__
|
2017-05-08 19:19:06 +00:00
|
|
|
|
|
|
|
#include "mpc.h"
|
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
#define TO_DCN10_MPC(mpc_base) \
|
|
|
|
container_of(mpc_base, struct dcn10_mpc, base)
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
#define MAX_MPCC 6
|
2017-06-28 18:27:18 +00:00
|
|
|
#define MAX_OPP 6
|
2017-05-08 19:19:06 +00:00
|
|
|
|
|
|
|
#define MPC_COMMON_REG_LIST_DCN1_0(inst) \
|
2017-07-21 21:46:50 +00:00
|
|
|
SRII(MPCC_TOP_SEL, MPCC, inst),\
|
|
|
|
SRII(MPCC_BOT_SEL, MPCC, inst),\
|
|
|
|
SRII(MPCC_CONTROL, MPCC, inst),\
|
|
|
|
SRII(MPCC_STATUS, MPCC, inst),\
|
|
|
|
SRII(MPCC_OPP_ID, MPCC, inst),\
|
|
|
|
SRII(MPCC_BG_G_Y, MPCC, inst),\
|
|
|
|
SRII(MPCC_BG_R_CR, MPCC, inst),\
|
|
|
|
SRII(MPCC_BG_B_CB, MPCC, inst),\
|
|
|
|
SRII(MPCC_BG_B_CB, MPCC, inst)
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-10-05 18:27:27 +00:00
|
|
|
#define MPC_OUT_MUX_COMMON_REG_LIST_DCN1_0(inst) \
|
|
|
|
SRII(MUX, MPC_OUT, inst)
|
|
|
|
|
|
|
|
#define MPC_COMMON_REG_VARIABLE_LIST \
|
|
|
|
uint32_t MPCC_TOP_SEL[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_BOT_SEL[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_CONTROL[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_STATUS[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_OPP_ID[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_BG_G_Y[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_BG_R_CR[MAX_MPCC]; \
|
|
|
|
uint32_t MPCC_BG_B_CB[MAX_MPCC]; \
|
2017-06-01 22:35:54 +00:00
|
|
|
uint32_t MUX[MAX_OPP];
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
#define MPC_COMMON_MASK_SH_LIST_DCN1_0(mask_sh)\
|
2017-05-08 19:19:06 +00:00
|
|
|
SF(MPCC0_MPCC_TOP_SEL, MPCC_TOP_SEL, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_BOT_SEL, MPCC_BOT_SEL, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_CONTROL, MPCC_MODE, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_CONTROL, MPCC_ALPHA_BLND_MODE, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_CONTROL, MPCC_ALPHA_MULTIPLIED_MODE, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_CONTROL, MPCC_BLND_ACTIVE_OVERLAP_ONLY, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_STATUS, MPCC_IDLE, mask_sh),\
|
2017-06-14 22:58:04 +00:00
|
|
|
SF(MPCC0_MPCC_STATUS, MPCC_BUSY, mask_sh),\
|
2017-05-08 19:19:06 +00:00
|
|
|
SF(MPCC0_MPCC_OPP_ID, MPCC_OPP_ID, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_BG_G_Y, MPCC_BG_G_Y, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_BG_R_CR, MPCC_BG_R_CR, mask_sh),\
|
|
|
|
SF(MPCC0_MPCC_BG_B_CB, MPCC_BG_B_CB, mask_sh),\
|
2017-07-12 15:54:10 +00:00
|
|
|
SF(MPC_OUT0_MUX, MPC_OUT_MUX, mask_sh)
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
#define MPC_REG_FIELD_LIST(type) \
|
2017-05-08 19:19:06 +00:00
|
|
|
type MPCC_TOP_SEL;\
|
|
|
|
type MPCC_BOT_SEL;\
|
|
|
|
type MPCC_MODE;\
|
|
|
|
type MPCC_ALPHA_BLND_MODE;\
|
|
|
|
type MPCC_ALPHA_MULTIPLIED_MODE;\
|
|
|
|
type MPCC_BLND_ACTIVE_OVERLAP_ONLY;\
|
|
|
|
type MPCC_IDLE;\
|
2017-06-14 22:58:04 +00:00
|
|
|
type MPCC_BUSY;\
|
2017-05-08 19:19:06 +00:00
|
|
|
type MPCC_OPP_ID;\
|
|
|
|
type MPCC_BG_G_Y;\
|
|
|
|
type MPCC_BG_R_CR;\
|
|
|
|
type MPCC_BG_B_CB;\
|
2017-07-21 21:46:50 +00:00
|
|
|
type MPC_OUT_MUX;
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-10-05 18:27:27 +00:00
|
|
|
struct dcn_mpc_registers {
|
|
|
|
MPC_COMMON_REG_VARIABLE_LIST
|
|
|
|
};
|
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
struct dcn_mpc_shift {
|
|
|
|
MPC_REG_FIELD_LIST(uint8_t)
|
2017-05-08 19:19:06 +00:00
|
|
|
};
|
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
struct dcn_mpc_mask {
|
|
|
|
MPC_REG_FIELD_LIST(uint32_t)
|
2017-05-08 19:19:06 +00:00
|
|
|
};
|
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
struct dcn10_mpc {
|
|
|
|
struct mpc base;
|
|
|
|
|
|
|
|
int mpcc_in_use_mask;
|
|
|
|
int num_mpcc;
|
|
|
|
const struct dcn_mpc_registers *mpc_regs;
|
|
|
|
const struct dcn_mpc_shift *mpc_shift;
|
|
|
|
const struct dcn_mpc_mask *mpc_mask;
|
2017-06-01 22:35:54 +00:00
|
|
|
};
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-07-21 21:46:50 +00:00
|
|
|
void dcn10_mpc_construct(struct dcn10_mpc *mpcc10,
|
2017-06-01 22:35:54 +00:00
|
|
|
struct dc_context *ctx,
|
2017-07-21 21:46:50 +00:00
|
|
|
const struct dcn_mpc_registers *mpc_regs,
|
|
|
|
const struct dcn_mpc_shift *mpc_shift,
|
|
|
|
const struct dcn_mpc_mask *mpc_mask,
|
|
|
|
int num_mpcc);
|
2017-05-08 19:19:06 +00:00
|
|
|
|
2017-10-05 18:27:27 +00:00
|
|
|
int mpc10_mpcc_add(
|
|
|
|
struct mpc *mpc,
|
|
|
|
struct mpcc_cfg *cfg);
|
|
|
|
|
|
|
|
void mpc10_mpcc_remove(
|
|
|
|
struct mpc *mpc,
|
|
|
|
struct mpc_tree_cfg *tree_cfg,
|
|
|
|
int opp_id,
|
|
|
|
int dpp_id);
|
|
|
|
|
|
|
|
void mpc10_assert_idle_mpcc(
|
|
|
|
struct mpc *mpc,
|
|
|
|
int id);
|
|
|
|
|
|
|
|
void mpc10_update_blend_mode(
|
|
|
|
struct mpc *mpc,
|
|
|
|
struct mpcc_cfg *cfg);
|
|
|
|
|
2017-05-08 19:19:06 +00:00
|
|
|
#endif
|