Commit ca4d9b3a authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Add DCN2 DIO

Add support for the DIO (Display IO)  block of DCN2, which entails our
stream and link encoders.

HW Blocks:

    +--------+
    |  DIO   |
    +--------+
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 728c0698
......@@ -72,6 +72,9 @@
struct dcn10_link_enc_aux_registers {
uint32_t AUX_CONTROL;
uint32_t AUX_DPHY_RX_CONTROL0;
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
uint32_t AUX_DPHY_TX_CONTROL;
#endif
};
struct dcn10_link_enc_hpd_registers {
......@@ -103,6 +106,23 @@ struct dcn10_link_enc_registers {
uint32_t DP_DPHY_HBR2_PATTERN_CONTROL;
uint32_t DP_SEC_CNTL1;
uint32_t TMDS_CTL_BITS;
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
/* DCCG */
uint32_t CLOCK_ENABLE;
/* DIG */
uint32_t DIG_LANE_ENABLE;
/* UNIPHY */
uint32_t CHANNEL_XBAR_CNTL;
/* indirect registers */
uint32_t RAWLANE0_DIG_PCS_XF_RX_OVRD_IN_2;
uint32_t RAWLANE0_DIG_PCS_XF_RX_OVRD_IN_3;
uint32_t RAWLANE1_DIG_PCS_XF_RX_OVRD_IN_2;
uint32_t RAWLANE1_DIG_PCS_XF_RX_OVRD_IN_3;
uint32_t RAWLANE2_DIG_PCS_XF_RX_OVRD_IN_2;
uint32_t RAWLANE2_DIG_PCS_XF_RX_OVRD_IN_3;
uint32_t RAWLANE3_DIG_PCS_XF_RX_OVRD_IN_2;
uint32_t RAWLANE3_DIG_PCS_XF_RX_OVRD_IN_3;
#endif
};
#define LE_SF(reg_name, field_name, post_fix)\
......@@ -208,12 +228,166 @@ struct dcn10_link_enc_registers {
type AUX_LS_READ_EN;\
type AUX_RX_RECEIVE_WINDOW
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
#define DCN20_LINK_ENCODER_DPCS_REG_FIELD_LIST(type) \
type RDPCS_PHY_DP_TX0_DATA_EN;\
type RDPCS_PHY_DP_TX1_DATA_EN;\
type RDPCS_PHY_DP_TX2_DATA_EN;\
type RDPCS_PHY_DP_TX3_DATA_EN;\
type RDPCS_PHY_DP_TX0_PSTATE;\
type RDPCS_PHY_DP_TX1_PSTATE;\
type RDPCS_PHY_DP_TX2_PSTATE;\
type RDPCS_PHY_DP_TX3_PSTATE;\
type RDPCS_PHY_DP_TX0_MPLL_EN;\
type RDPCS_PHY_DP_TX1_MPLL_EN;\
type RDPCS_PHY_DP_TX2_MPLL_EN;\
type RDPCS_PHY_DP_TX3_MPLL_EN;\
type RDPCS_TX_FIFO_LANE0_EN;\
type RDPCS_TX_FIFO_LANE1_EN;\
type RDPCS_TX_FIFO_LANE2_EN;\
type RDPCS_TX_FIFO_LANE3_EN;\
type RDPCS_EXT_REFCLK_EN;\
type RDPCS_TX_FIFO_EN;\
type UNIPHY_LINK_ENABLE;\
type UNIPHY_CHANNEL0_INVERT;\
type UNIPHY_CHANNEL1_INVERT;\
type UNIPHY_CHANNEL2_INVERT;\
type UNIPHY_CHANNEL3_INVERT;\
type UNIPHY_LINK_ENABLE_HPD_MASK;\
type UNIPHY_LANE_STAGGER_DELAY;\
type RDPCS_SRAMCLK_BYPASS;\
type RDPCS_SRAMCLK_EN;\
type RDPCS_SRAMCLK_CLOCK_ON;\
type DPCS_TX_FIFO_EN;\
type RDPCS_PHY_DP_TX0_DISABLE;\
type RDPCS_PHY_DP_TX1_DISABLE;\
type RDPCS_PHY_DP_TX2_DISABLE;\
type RDPCS_PHY_DP_TX3_DISABLE;\
type RDPCS_PHY_DP_TX0_CLK_RDY;\
type RDPCS_PHY_DP_TX1_CLK_RDY;\
type RDPCS_PHY_DP_TX2_CLK_RDY;\
type RDPCS_PHY_DP_TX3_CLK_RDY;\
type RDPCS_PHY_DP_TX0_REQ;\
type RDPCS_PHY_DP_TX1_REQ;\
type RDPCS_PHY_DP_TX2_REQ;\
type RDPCS_PHY_DP_TX3_REQ;\
type RDPCS_PHY_DP_TX0_ACK;\
type RDPCS_PHY_DP_TX1_ACK;\
type RDPCS_PHY_DP_TX2_ACK;\
type RDPCS_PHY_DP_TX3_ACK;\
type RDPCS_PHY_DP_TX0_RESET;\
type RDPCS_PHY_DP_TX1_RESET;\
type RDPCS_PHY_DP_TX2_RESET;\
type RDPCS_PHY_DP_TX3_RESET;\
type RDPCS_PHY_RESET;\
type RDPCS_PHY_CR_MUX_SEL;\
type RDPCS_PHY_REF_RANGE;\
type RDPCS_PHY_DP4_POR;\
type RDPCS_SRAM_BYPASS;\
type RDPCS_SRAM_EXT_LD_DONE;\
type RDPCS_PHY_DP_TX0_TERM_CTRL;\
type RDPCS_PHY_DP_TX1_TERM_CTRL;\
type RDPCS_PHY_DP_TX2_TERM_CTRL;\
type RDPCS_PHY_DP_TX3_TERM_CTRL;\
type RDPCS_PHY_DP_REF_CLK_MPLLB_DIV;\
type RDPCS_PHY_DP_MPLLB_MULTIPLIER;\
type RDPCS_PHY_DP_MPLLB_SSC_EN;\
type RDPCS_PHY_DP_MPLLB_DIV5_CLK_EN;\
type RDPCS_PHY_DP_MPLLB_TX_CLK_DIV;\
type RDPCS_PHY_DP_MPLLB_WORD_DIV2_EN;\
type RDPCS_PHY_DP_MPLLB_FRACN_EN;\
type RDPCS_PHY_DP_MPLLB_PMIX_EN;\
type RDPCS_PHY_DP_MPLLB_FRACN_QUOT;\
type RDPCS_PHY_DP_MPLLB_FRACN_DEN;\
type RDPCS_PHY_DP_MPLLB_FRACN_REM;\
type RDPCS_PHY_DP_MPLLB_SSC_UP_SPREAD;\
type RDPCS_PHY_DP_MPLLB_SSC_STEPSIZE;\
type RDPCS_PHY_DP_MPLLB_SSC_PEAK;\
type RDPCS_PHY_DP_MPLLB_DIV_CLK_EN;\
type RDPCS_PHY_DP_MPLLB_DIV_MULTIPLIER;\
type RDPCS_PHY_TX_VBOOST_LVL;\
type RDPCS_PHY_HDMIMODE_ENABLE;\
type RDPCS_PHY_DP_REF_CLK_EN;\
type RDPCS_PLL_UPDATE_DATA;\
type RDPCS_SRAM_INIT_DONE;\
type RDPCS_TX_CR_ADDR;\
type RDPCS_TX_CR_DATA;\
type RDPCS_PHY_HDMI_MPLLB_HDMI_DIV;\
type RDPCS_PHY_DP_MPLLB_STATE;\
type RDPCS_PHY_DP_TX0_WIDTH;\
type RDPCS_PHY_DP_TX0_RATE;\
type RDPCS_PHY_DP_TX1_WIDTH;\
type RDPCS_PHY_DP_TX1_RATE;\
type RDPCS_PHY_DP_TX2_WIDTH;\
type RDPCS_PHY_DP_TX2_RATE;\
type RDPCS_PHY_DP_TX3_WIDTH;\
type RDPCS_PHY_DP_TX3_RATE;\
type DPCS_SYMCLK_CLOCK_ON;\
type DPCS_SYMCLK_GATE_DIS;\
type DPCS_SYMCLK_EN;\
type RDPCS_SYMCLK_DIV2_CLOCK_ON;\
type RDPCS_SYMCLK_DIV2_GATE_DIS;\
type RDPCS_SYMCLK_DIV2_EN;\
type DPCS_TX_DATA_SWAP;\
type DPCS_TX_DATA_ORDER_INVERT;\
type DPCS_TX_FIFO_RD_START_DELAY;\
type RDPCS_TX_FIFO_RD_START_DELAY;\
type RDPCS_REG_FIFO_ERROR_MASK;\
type RDPCS_TX_FIFO_ERROR_MASK;\
type RDPCS_DPALT_DISABLE_TOGGLE_MASK;\
type RDPCS_DPALT_4LANE_TOGGLE_MASK;\
type RDPCS_PHY_DPALT_DISABLE_ACK;\
type RDPCS_PHY_DP_MPLLB_V2I;\
type RDPCS_PHY_DP_MPLLB_FREQ_VCO;\
type RDPCS_PHY_DP_MPLLB_CP_INT;\
type RDPCS_PHY_DP_MPLLB_CP_PROP;\
type RDPCS_PHY_RX_REF_LD_VAL;\
type RDPCS_PHY_RX_VCO_LD_VAL;\
type DPCSTX_DEBUG_CONFIG; \
type RDPCSTX_DEBUG_CONFIG
#define DCN20_LINK_ENCODER_REG_FIELD_LIST(type) \
type DIG_LANE0EN;\
type DIG_LANE1EN;\
type DIG_LANE2EN;\
type DIG_LANE3EN;\
type DIG_CLK_EN;\
type SYMCLKA_CLOCK_ENABLE;\
type DPHY_FEC_EN;\
type DPHY_FEC_READY_SHADOW;\
type DPHY_FEC_ACTIVE_STATUS;\
DCN20_LINK_ENCODER_DPCS_REG_FIELD_LIST(type);\
type VCO_LD_VAL_OVRD;\
type VCO_LD_VAL_OVRD_EN;\
type REF_LD_VAL_OVRD;\
type REF_LD_VAL_OVRD_EN;\
type AUX_RX_START_WINDOW; \
type AUX_RX_HALF_SYM_DETECT_LEN; \
type AUX_RX_TRANSITION_FILTER_EN; \
type AUX_RX_ALLOW_BELOW_THRESHOLD_PHASE_DETECT; \
type AUX_RX_ALLOW_BELOW_THRESHOLD_START; \
type AUX_RX_ALLOW_BELOW_THRESHOLD_STOP; \
type AUX_RX_PHASE_DETECT_LEN; \
type AUX_RX_DETECTION_THRESHOLD; \
type AUX_TX_PRECHARGE_LEN; \
type AUX_TX_PRECHARGE_SYMBOLS; \
type AUX_MODE_DET_CHECK_DELAY;\
type DPCS_DBG_CBUS_DIS
#endif
struct dcn10_link_enc_shift {
DCN_LINK_ENCODER_REG_FIELD_LIST(uint8_t);
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
DCN20_LINK_ENCODER_REG_FIELD_LIST(uint8_t);
#endif
};
struct dcn10_link_enc_mask {
DCN_LINK_ENCODER_REG_FIELD_LIST(uint32_t);
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
DCN20_LINK_ENCODER_REG_FIELD_LIST(uint32_t);
#endif
};
struct dcn10_link_encoder {
......
......@@ -82,6 +82,7 @@
SRI(DP_PIXEL_FORMAT, DP, id), \
SRI(DP_SEC_CNTL, DP, id), \
SRI(DP_SEC_CNTL2, DP, id), \
SRI(DP_SEC_CNTL6, DP, id), \
SRI(DP_STEER_FIFO, DP, id), \
SRI(DP_VID_M, DP, id), \
SRI(DP_VID_N, DP, id), \
......@@ -125,6 +126,7 @@ struct dcn10_stream_enc_registers {
uint32_t DP_PIXEL_FORMAT;
uint32_t DP_SEC_CNTL;
uint32_t DP_SEC_CNTL2;
uint32_t DP_SEC_CNTL6;
uint32_t DP_STEER_FIFO;
uint32_t DP_VID_M;
uint32_t DP_VID_N;
......@@ -153,12 +155,21 @@ struct dcn10_stream_enc_registers {
uint32_t HDMI_ACR_48_1;
uint32_t DP_DB_CNTL;
uint32_t DP_MSA_MISC;
uint32_t DP_MSA_VBID_MISC;
uint32_t DP_MSA_COLORIMETRY;
uint32_t DP_MSA_TIMING_PARAM1;
uint32_t DP_MSA_TIMING_PARAM2;
uint32_t DP_MSA_TIMING_PARAM3;
uint32_t DP_MSA_TIMING_PARAM4;
uint32_t HDMI_DB_CONTROL;
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
uint32_t DP_DSC_CNTL;
uint32_t DP_DSC_BYTES_PER_PIXEL;
uint32_t DME_CONTROL;
uint32_t DP_SEC_METADATA_TRANSMISSION;
uint32_t HDMI_METADATA_PACKET_CONTROL;
uint32_t DP_SEC_FRAMING4;
#endif
};
......@@ -271,6 +282,7 @@ struct dcn10_stream_enc_registers {
SE_SF(DP0_DP_SEC_CNTL, DP_SEC_GSP7_ENABLE, mask_sh),\
SE_SF(DP0_DP_SEC_CNTL2, DP_SEC_GSP7_PPS, mask_sh),\
SE_SF(DP0_DP_SEC_CNTL2, DP_SEC_GSP7_SEND, mask_sh),\
SE_SF(DP0_DP_SEC_CNTL6, DP_SEC_GSP7_LINE_NUM, mask_sh),\
SE_SF(DP0_DP_DB_CNTL, DP_DB_DISABLE, mask_sh),\
SE_SF(DP0_DP_MSA_COLORIMETRY, DP_MSA_MISC0, mask_sh),\
SE_SF(DP0_DP_MSA_TIMING_PARAM1, DP_MSA_HTOTAL, mask_sh),\
......@@ -424,6 +436,7 @@ struct dcn10_stream_enc_registers {
type DP_SEC_ATP_ENABLE;\
type DP_SEC_AIP_ENABLE;\
type DP_SEC_ACM_ENABLE;\
type DP_SEC_GSP7_LINE_NUM;\
type AFMT_AUDIO_SAMPLE_SEND;\
type AFMT_AUDIO_CLOCK_EN;\
type TMDS_PIXEL_ENCODING;\
......@@ -447,12 +460,39 @@ struct dcn10_stream_enc_registers {
type DP_VID_M_DOUBLE_VALUE_EN;\
type DIG_SOURCE_SELECT
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
#define SE_REG_FIELD_LIST_DCN2_0(type) \
type DP_DSC_MODE;\
type DP_DSC_SLICE_WIDTH;\
type DP_DSC_BYTES_PER_PIXEL;\
type DP_VBID6_LINE_REFERENCE;\
type DP_VBID6_LINE_NUM;\
type METADATA_ENGINE_EN;\
type METADATA_HUBP_REQUESTOR_ID;\
type METADATA_STREAM_TYPE;\
type DP_SEC_METADATA_PACKET_ENABLE;\
type DP_SEC_METADATA_PACKET_LINE_REFERENCE;\
type DP_SEC_METADATA_PACKET_LINE;\
type HDMI_METADATA_PACKET_ENABLE;\
type HDMI_METADATA_PACKET_LINE_REFERENCE;\
type HDMI_METADATA_PACKET_LINE;\
type DOLBY_VISION_EN;\
type DP_PIXEL_COMBINE;\
type DP_SST_SDP_SPLITTING
#endif
struct dcn10_stream_encoder_shift {
SE_REG_FIELD_LIST_DCN1_0(uint8_t);
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
SE_REG_FIELD_LIST_DCN2_0(uint8_t);
#endif
};
struct dcn10_stream_encoder_mask {
SE_REG_FIELD_LIST_DCN1_0(uint32_t);
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
SE_REG_FIELD_LIST_DCN2_0(uint32_t);
#endif
};
struct dcn10_stream_encoder {
......
This diff is collapsed.
/*
* 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
*
*/
#ifndef __DC_LINK_ENCODER__DCN20_H__
#define __DC_LINK_ENCODER__DCN20_H__
#include "dcn10/dcn10_link_encoder.h"
#define DCN2_AUX_REG_LIST(id)\
AUX_REG_LIST(id), \
SRI(AUX_DPHY_TX_CONTROL, DP_AUX, id)
#define UNIPHY_MASK_SH_LIST(mask_sh)\
LE_SF(UNIPHYA_CHANNEL_XBAR_CNTL, UNIPHY_LINK_ENABLE, mask_sh)
#define LINK_ENCODER_MASK_SH_LIST_DCN20(mask_sh)\
LINK_ENCODER_MASK_SH_LIST_DCN10(mask_sh),\
LE_SF(DP0_DP_DPHY_CNTL, DPHY_FEC_EN, mask_sh),\
LE_SF(DP0_DP_DPHY_CNTL, DPHY_FEC_READY_SHADOW, mask_sh),\
LE_SF(DP0_DP_DPHY_CNTL, DPHY_FEC_ACTIVE_STATUS, mask_sh),\
LE_SF(DIG0_DIG_LANE_ENABLE, DIG_LANE0EN, mask_sh),\
LE_SF(DIG0_DIG_LANE_ENABLE, DIG_LANE1EN, mask_sh),\
LE_SF(DIG0_DIG_LANE_ENABLE, DIG_LANE2EN, mask_sh),\
LE_SF(DIG0_DIG_LANE_ENABLE, DIG_LANE3EN, mask_sh),\
LE_SF(DIG0_DIG_LANE_ENABLE, DIG_CLK_EN, mask_sh),\
LE_SF(DIG0_TMDS_CTL_BITS, TMDS_CTL0, mask_sh), \
UNIPHY_MASK_SH_LIST(mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_START_WINDOW, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_HALF_SYM_DETECT_LEN, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_TRANSITION_FILTER_EN, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_ALLOW_BELOW_THRESHOLD_PHASE_DETECT, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_ALLOW_BELOW_THRESHOLD_START, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_ALLOW_BELOW_THRESHOLD_STOP, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_PHASE_DETECT_LEN, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_RX_CONTROL0, AUX_RX_DETECTION_THRESHOLD, mask_sh), \
LE_SF(DP_AUX0_AUX_DPHY_TX_CONTROL, AUX_TX_PRECHARGE_LEN, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_TX_CONTROL, AUX_TX_PRECHARGE_SYMBOLS, mask_sh),\
LE_SF(DP_AUX0_AUX_DPHY_TX_CONTROL, AUX_MODE_DET_CHECK_DELAY, mask_sh)
#define UNIPHY_DCN2_REG_LIST(id) \
SRI(CLOCK_ENABLE, SYMCLK, id), \
SRI(CHANNEL_XBAR_CNTL, UNIPHY, id)
struct mpll_cfg {
uint32_t mpllb_ana_v2i;
uint32_t mpllb_ana_freq_vco;
uint32_t mpllb_ana_cp_int;
uint32_t mpllb_ana_cp_prop;
uint32_t mpllb_multiplier;
uint32_t ref_clk_mpllb_div;
bool mpllb_word_div2_en;
bool mpllb_ssc_en;
bool mpllb_div5_clk_en;
bool mpllb_div_clk_en;
bool mpllb_fracn_en;
bool mpllb_pmix_en;
uint32_t mpllb_div_multiplier;
uint32_t mpllb_tx_clk_div;
uint32_t mpllb_fracn_quot;
uint32_t mpllb_fracn_den;
uint32_t mpllb_ssc_peak;
uint32_t mpllb_ssc_stepsize;
uint32_t mpllb_ssc_up_spread;
uint32_t mpllb_fracn_rem;
uint32_t mpllb_hdmi_div;
// TODO: May not mpll params, need to figure out.
uint32_t tx_vboost_lvl;
uint32_t hdmi_pixel_clk_div;
uint32_t ref_range;
uint32_t ref_clk;
bool hdmimode_enable;
};
struct dpcssys_phy_seq_cfg {
bool program_fuse;
bool bypass_sram;
bool lane_en[4];
bool use_calibration_setting;
struct mpll_cfg mpll_cfg;
bool load_sram_fw;
#if 0
bool hdmimode_enable;
bool silver2;
bool ext_refclk_en;
uint32_t dp_tx0_term_ctrl;
uint32_t dp_tx1_term_ctrl;
uint32_t dp_tx2_term_ctrl;
uint32_t dp_tx3_term_ctrl;
uint32_t fw_data[0x1000];
uint32_t dp_tx0_width;
uint32_t dp_tx1_width;
uint32_t dp_tx2_width;
uint32_t dp_tx3_width;
uint32_t dp_tx0_rate;
uint32_t dp_tx1_rate;
uint32_t dp_tx2_rate;
uint32_t dp_tx3_rate;
uint32_t dp_tx0_eq_main;
uint32_t dp_tx0_eq_pre;
uint32_t dp_tx0_eq_post;
uint32_t dp_tx1_eq_main;
uint32_t dp_tx1_eq_pre;
uint32_t dp_tx1_eq_post;
uint32_t dp_tx2_eq_main;
uint32_t dp_tx2_eq_pre;
uint32_t dp_tx2_eq_post;
uint32_t dp_tx3_eq_main;
uint32_t dp_tx3_eq_pre;
uint32_t dp_tx3_eq_post;
bool data_swap_en;
bool data_order_invert_en;
uint32_t ldpcs_fifo_start_delay;
uint32_t rdpcs_fifo_start_delay;
bool rdpcs_reg_fifo_error_mask;
bool rdpcs_tx_fifo_error_mask;
bool rdpcs_dpalt_disable_mask;
bool rdpcs_dpalt_4lane_mask;
#endif
};
struct dcn20_link_encoder {
struct dcn10_link_encoder enc10;
struct dpcssys_phy_seq_cfg phy_seq_cfg;
};
void enc2_fec_set_enable(struct link_encoder *enc, bool enable);
void enc2_fec_set_ready(struct link_encoder *enc, bool ready);
bool enc2_fec_is_active(struct link_encoder *enc);
void enc2_hw_init(struct link_encoder *enc);
void dcn20_link_encoder_construct(
struct dcn20_link_encoder *enc20,
const struct encoder_init_data *init_data,
const struct encoder_feature_support *enc_features,
const struct dcn10_link_enc_registers *link_regs,
const struct dcn10_link_enc_aux_registers *aux_regs,
const struct dcn10_link_enc_hpd_registers *hpd_regs,
const struct dcn10_link_enc_shift *link_shift,
const struct dcn10_link_enc_mask *link_mask);
#endif /* __DC_LINK_ENCODER__DCN20_H__ */
This diff is collapsed.
/*
* 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
*
*/
#ifndef __DC_STREAM_ENCODER_DCN20_H__
#define __DC_STREAM_ENCODER_DCN20_H__
#include "stream_encoder.h"
#include "dcn10/dcn10_stream_encoder.h"
#define SE_DCN2_REG_LIST(id)\
SE_COMMON_DCN_REG_LIST(id),\
SRI(HDMI_GENERIC_PACKET_CONTROL4, DIG, id), \
SRI(HDMI_GENERIC_PACKET_CONTROL5, DIG, id), \
SRI(DP_DSC_CNTL, DP, id), \
SRI(DP_DSC_BYTES_PER_PIXEL, DP, id), \
SRI(DME_CONTROL, DIG, id),\
SRI(DP_SEC_METADATA_TRANSMISSION, DP, id), \
SRI(HDMI_METADATA_PACKET_CONTROL, DIG, id), \
SRI(DP_SEC_FRAMING4, DP, id)
#define SE_COMMON_MASK_SH_LIST_DCN20(mask_sh)\
SE_COMMON_MASK_SH_LIST_SOC(mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC0_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC0_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC1_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC1_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC2_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC2_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC3_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC3_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC4_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC4_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC5_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC5_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC6_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC6_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC7_CONT, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL0, HDMI_GENERIC7_SEND, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL1, HDMI_GENERIC0_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL1, HDMI_GENERIC1_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL2, HDMI_GENERIC2_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL2, HDMI_GENERIC3_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL3, HDMI_GENERIC4_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL3, HDMI_GENERIC5_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL4, HDMI_GENERIC6_LINE, mask_sh),\
SE_SF(DIG0_HDMI_GENERIC_PACKET_CONTROL4, HDMI_GENERIC7_LINE, mask_sh),\
SE_SF(DP0_DP_DSC_CNTL, DP_DSC_MODE, mask_sh),\
SE_SF(DP0_DP_DSC_CNTL, DP_DSC_SLICE_WIDTH, mask_sh),\
SE_SF(DP0_DP_DSC_BYTES_PER_PIXEL, DP_DSC_BYTES_PER_PIXEL, mask_sh),\
SE_SF(DP0_DP_MSA_VBID_MISC, DP_VBID6_LINE_REFERENCE, mask_sh),\
SE_SF(DP0_DP_MSA_VBID_MISC, DP_VBID6_LINE_NUM, mask_sh),\
SE_SF(DIG0_DME_CONTROL, METADATA_ENGINE_EN, mask_sh),\
SE_SF(DIG0_DME_CONTROL, METADATA_HUBP_REQUESTOR_ID, mask_sh),\
SE_SF(DIG0_DME_CONTROL, METADATA_STREAM_TYPE, mask_sh),\
SE_SF(DP0_DP_SEC_METADATA_TRANSMISSION, DP_SEC_METADATA_PACKET_ENABLE, mask_sh),\
SE_SF(DP0_DP_SEC_METADATA_TRANSMISSION, DP_SEC_METADATA_PACKET_LINE_REFERENCE, mask_sh),\
SE_SF(DP0_DP_SEC_METADATA_TRANSMISSION, DP_SEC_METADATA_PACKET_LINE, mask_sh),\
SE_SF(DIG0_HDMI_METADATA_PACKET_CONTROL, HDMI_METADATA_PACKET_ENABLE, mask_sh),\
SE_SF(DIG0_HDMI_METADATA_PACKET_CONTROL, HDMI_METADATA_PACKET_LINE_REFERENCE, mask_sh),\
SE_SF(DIG0_HDMI_METADATA_PACKET_CONTROL, HDMI_METADATA_PACKET_LINE, mask_sh),\
SE_SF(DIG0_DIG_FE_CNTL, DOLBY_VISION_EN, mask_sh),\
SE_SF(DP0_DP_PIXEL_FORMAT, DP_PIXEL_COMBINE, mask_sh),\
SE_SF(DP0_DP_SEC_FRAMING4, DP_SST_SDP_SPLITTING, mask_sh)
void dcn20_stream_encoder_construct(
struct dcn10_stream_encoder *enc1,
struct dc_context *ctx,
struct dc_bios *bp,
enum engine_id eng_id,
const struct dcn10_stream_enc_registers *regs,
const struct dcn10_stream_encoder_shift *se_shift,
const struct dcn10_stream_encoder_mask *se_mask);
#endif /* __DC_STREAM_ENCODER_DCN20_H__ */
......@@ -113,8 +113,12 @@ struct link_encoder {
struct encoder_feature_support features;
enum transmitter transmitter;
enum hpd_source_id hpd_source;
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
bool usbc_combo_phy;
#endif
};
struct link_encoder_funcs {
bool (*validate_output_with_stream)(
struct link_encoder *enc, const struct dc_stream_state *stream);
......@@ -156,6 +160,16 @@ struct link_encoder_funcs {
bool (*is_dig_enabled)(struct link_encoder *enc);
unsigned int (*get_dig_frontend)(struct link_encoder *enc);
void (*destroy)(struct link_encoder **enc);
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
void (*fec_set_enable)(struct link_encoder *enc,
bool enable);
void (*fec_set_ready)(struct link_encoder *enc,
bool ready);
bool (*fec_is_active)(struct link_encoder *enc);
#endif
};
#endif /* LINK_ENCODER_H_ */
......@@ -65,11 +65,20 @@ struct audio_clock_info {
uint32_t cts_48khz;
};
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
enum dynamic_metadata_mode {
dmdata_dp,
dmdata_hdmi,
dmdata_dolby_vision
};
#endif
struct encoder_info_frame {
/* auxiliary video information */
struct dc_info_packet avi;
struct dc_info_packet gamut;
struct dc_info_packet vendor;
struct dc_info_packet hfvsif;
/* source product description */
struct dc_info_packet spd;
/* video stream configuration */
......@@ -81,6 +90,9 @@ struct encoder_info_frame {
struct encoder_unblank_param {
struct dc_link_settings link_settings;
struct dc_crtc_timing timing;
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
bool odm;
#endif
};
struct encoder_set_dp_phy_pattern_param {
......@@ -97,6 +109,7 @@ struct stream_encoder {
enum engine_id id;
};
struct stream_encoder_funcs {
void (*dp_set_stream_attribute)(
struct stream_encoder *enc,
......@@ -184,6 +197,17 @@ struct stream_encoder_funcs {
struct stream_encoder *enc,
int tg_inst);
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
void (*set_dynamic_metadata)(struct stream_encoder *enc,
bool enable,
uint32_t hubp_requestor_id,
enum dynamic_metadata_mode dmdata_mode);
void (*dp_set_odm_combine)(
struct stream_encoder *enc,
bool odm_combine);
#endif
};
#endif /* STREAM_ENCODER_H_ */
......@@ -75,7 +75,12 @@ static void virtual_audio_mute_control(
struct stream_encoder *enc,
bool mute) {}
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
#endif
static const struct stream_encoder_funcs virtual_str_enc_funcs = {
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
#endif
.dp_set_stream_attribute =
virtual_stream_encoder_dp_set_stream_attribute,
.hdmi_set_stream_attribute =
......
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