forked from luck/tmp_suning_uos_patched
Merge branch 'drm-radeon-next' of /ssd/git/drm-radeon-next into drm-core-next
* 'drm-radeon-next' of /ssd/git/drm-radeon-next: (32 commits) drivers/gpu/drm/radeon/atom.c: fix warning drm/radeon/kms: bump kms version number drm/radeon/kms: properly set num banks for fusion asics drm/radeon/kms/atom: move dig phy init out of modesetting drm/radeon/kms/cayman: fix typo in register mask drm/radeon/kms: fix typo in spread spectrum code drm/radeon/kms: fix tile_config value reported to userspace on cayman. drm/radeon/kms: fix incorrect comparison in cayman setup code. drm/radeon/kms: add wait idle ioctl for eg->cayman drm/radeon/cayman: setup hdp to invalidate and flush when asked drm/radeon/evergreen/btc/fusion: setup hdp to invalidate and flush when asked agp/uninorth: Fix lockups with radeon KMS and >1x. drm/radeon/kms: the SS_Id field in the LCD table if for LVDS only drm/radeon/kms: properly set the CLK_REF bit for DCE3 devices drm/radeon/kms: fixup eDP connector handling drm/radeon/kms: bail early for eDP in hotplug callback drm/radeon/kms: simplify hotplug handler logic drm/radeon/kms: rewrite DP handling drm/radeon/kms/atom: add support for setting DP panel mode drm/radeon/kms: atombios.h updates for DP panel mode ...
This commit is contained in:
commit
931474c4c3
|
@ -80,7 +80,7 @@ static void uninorth_tlbflush(struct agp_memory *mem)
|
|||
ctrl | UNI_N_CFG_GART_INVAL);
|
||||
pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL, ctrl);
|
||||
|
||||
if (uninorth_rev <= 0x30) {
|
||||
if (!mem && uninorth_rev <= 0x30) {
|
||||
pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL,
|
||||
ctrl | UNI_N_CFG_GART_2xRESET);
|
||||
pci_write_config_dword(agp_bridge->dev, UNI_N_CFG_GART_CTRL,
|
||||
|
|
|
@ -652,12 +652,12 @@ static void atom_op_compare(atom_exec_context *ctx, int *ptr, int arg)
|
|||
|
||||
static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg)
|
||||
{
|
||||
uint8_t count = U8((*ptr)++);
|
||||
unsigned count = U8((*ptr)++);
|
||||
SDEBUG(" count: %d\n", count);
|
||||
if (arg == ATOM_UNIT_MICROSEC)
|
||||
udelay(count);
|
||||
else
|
||||
schedule_timeout_uninterruptible(msecs_to_jiffies(count));
|
||||
msleep(count);
|
||||
}
|
||||
|
||||
static void atom_op_div(atom_exec_context *ctx, int *ptr, int arg)
|
||||
|
|
|
@ -726,6 +726,7 @@ typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V2
|
|||
#define ATOM_ENCODER_CMD_DP_VIDEO_ON 0x0d
|
||||
#define ATOM_ENCODER_CMD_QUERY_DP_LINK_TRAINING_STATUS 0x0e
|
||||
#define ATOM_ENCODER_CMD_SETUP 0x0f
|
||||
#define ATOM_ENCODER_CMD_SETUP_PANEL_MODE 0x10
|
||||
|
||||
// ucStatus
|
||||
#define ATOM_ENCODER_STATUS_LINK_TRAINING_COMPLETE 0x10
|
||||
|
@ -765,13 +766,19 @@ typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V3
|
|||
USHORT usPixelClock; // in 10KHz; for bios convenient
|
||||
ATOM_DIG_ENCODER_CONFIG_V3 acConfig;
|
||||
UCHAR ucAction;
|
||||
UCHAR ucEncoderMode;
|
||||
union {
|
||||
UCHAR ucEncoderMode;
|
||||
// =0: DP encoder
|
||||
// =1: LVDS encoder
|
||||
// =2: DVI encoder
|
||||
// =3: HDMI encoder
|
||||
// =4: SDVO encoder
|
||||
// =5: DP audio
|
||||
UCHAR ucPanelMode; // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
|
||||
// =0: external DP
|
||||
// =1: internal DP2
|
||||
// =0x11: internal DP1 for NutMeg/Travis DP translator
|
||||
};
|
||||
UCHAR ucLaneNum; // how many lanes to enable
|
||||
UCHAR ucBitPerColor; // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
|
||||
UCHAR ucReserved;
|
||||
|
@ -816,13 +823,19 @@ typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V4
|
|||
UCHAR ucConfig;
|
||||
};
|
||||
UCHAR ucAction;
|
||||
UCHAR ucEncoderMode;
|
||||
union {
|
||||
UCHAR ucEncoderMode;
|
||||
// =0: DP encoder
|
||||
// =1: LVDS encoder
|
||||
// =2: DVI encoder
|
||||
// =3: HDMI encoder
|
||||
// =4: SDVO encoder
|
||||
// =5: DP audio
|
||||
UCHAR ucPanelMode; // only valid when ucAction == ATOM_ENCODER_CMD_SETUP_PANEL_MODE
|
||||
// =0: external DP
|
||||
// =1: internal DP2
|
||||
// =0x11: internal DP1 for NutMeg/Travis DP translator
|
||||
};
|
||||
UCHAR ucLaneNum; // how many lanes to enable
|
||||
UCHAR ucBitPerColor; // only valid for DP mode when ucAction = ATOM_ENCODER_CMD_SETUP
|
||||
UCHAR ucHPD_ID; // HPD ID (1-6). =0 means to skip HDP programming. New comparing to previous version
|
||||
|
@ -836,6 +849,11 @@ typedef struct _DIG_ENCODER_CONTROL_PARAMETERS_V4
|
|||
#define PANEL_12BIT_PER_COLOR 0x04
|
||||
#define PANEL_16BIT_PER_COLOR 0x05
|
||||
|
||||
//define ucPanelMode
|
||||
#define DP_PANEL_MODE_EXTERNAL_DP_MODE 0x00
|
||||
#define DP_PANEL_MODE_INTERNAL_DP2_MODE 0x01
|
||||
#define DP_PANEL_MODE_INTERNAL_DP1_MODE 0x11
|
||||
|
||||
/****************************************************************************/
|
||||
// Structures used by UNIPHYTransmitterControlTable
|
||||
// LVTMATransmitterControlTable
|
||||
|
|
|
@ -420,7 +420,7 @@ static void atombios_crtc_program_ss(struct drm_crtc *crtc,
|
|||
|
||||
if (ASIC_IS_DCE5(rdev)) {
|
||||
args.v3.usSpreadSpectrumAmountFrac = cpu_to_le16(0);
|
||||
args.v3.ucSpreadSpectrumType = ss->type;
|
||||
args.v3.ucSpreadSpectrumType = ss->type & ATOM_SS_CENTRE_SPREAD_MODE_MASK;
|
||||
switch (pll_id) {
|
||||
case ATOM_PPLL1:
|
||||
args.v3.ucSpreadSpectrumType |= ATOM_PPLL_SS_TYPE_V3_P1PLL;
|
||||
|
@ -440,10 +440,12 @@ static void atombios_crtc_program_ss(struct drm_crtc *crtc,
|
|||
case ATOM_PPLL_INVALID:
|
||||
return;
|
||||
}
|
||||
args.v2.ucEnable = enable;
|
||||
args.v3.ucEnable = enable;
|
||||
if ((ss->percentage == 0) || (ss->type & ATOM_EXTERNAL_SS_MASK))
|
||||
args.v3.ucEnable = ATOM_DISABLE;
|
||||
} else if (ASIC_IS_DCE4(rdev)) {
|
||||
args.v2.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage);
|
||||
args.v2.ucSpreadSpectrumType = ss->type;
|
||||
args.v2.ucSpreadSpectrumType = ss->type & ATOM_SS_CENTRE_SPREAD_MODE_MASK;
|
||||
switch (pll_id) {
|
||||
case ATOM_PPLL1:
|
||||
args.v2.ucSpreadSpectrumType |= ATOM_PPLL_SS_TYPE_V2_P1PLL;
|
||||
|
@ -464,32 +466,36 @@ static void atombios_crtc_program_ss(struct drm_crtc *crtc,
|
|||
return;
|
||||
}
|
||||
args.v2.ucEnable = enable;
|
||||
if ((ss->percentage == 0) || (ss->type & ATOM_EXTERNAL_SS_MASK))
|
||||
args.v2.ucEnable = ATOM_DISABLE;
|
||||
} else if (ASIC_IS_DCE3(rdev)) {
|
||||
args.v1.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage);
|
||||
args.v1.ucSpreadSpectrumType = ss->type;
|
||||
args.v1.ucSpreadSpectrumType = ss->type & ATOM_SS_CENTRE_SPREAD_MODE_MASK;
|
||||
args.v1.ucSpreadSpectrumStep = ss->step;
|
||||
args.v1.ucSpreadSpectrumDelay = ss->delay;
|
||||
args.v1.ucSpreadSpectrumRange = ss->range;
|
||||
args.v1.ucPpll = pll_id;
|
||||
args.v1.ucEnable = enable;
|
||||
} else if (ASIC_IS_AVIVO(rdev)) {
|
||||
if (enable == ATOM_DISABLE) {
|
||||
if ((enable == ATOM_DISABLE) || (ss->percentage == 0) ||
|
||||
(ss->type & ATOM_EXTERNAL_SS_MASK)) {
|
||||
atombios_disable_ss(crtc);
|
||||
return;
|
||||
}
|
||||
args.lvds_ss_2.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage);
|
||||
args.lvds_ss_2.ucSpreadSpectrumType = ss->type;
|
||||
args.lvds_ss_2.ucSpreadSpectrumType = ss->type & ATOM_SS_CENTRE_SPREAD_MODE_MASK;
|
||||
args.lvds_ss_2.ucSpreadSpectrumStep = ss->step;
|
||||
args.lvds_ss_2.ucSpreadSpectrumDelay = ss->delay;
|
||||
args.lvds_ss_2.ucSpreadSpectrumRange = ss->range;
|
||||
args.lvds_ss_2.ucEnable = enable;
|
||||
} else {
|
||||
if (enable == ATOM_DISABLE) {
|
||||
if ((enable == ATOM_DISABLE) || (ss->percentage == 0) ||
|
||||
(ss->type & ATOM_EXTERNAL_SS_MASK)) {
|
||||
atombios_disable_ss(crtc);
|
||||
return;
|
||||
}
|
||||
args.lvds_ss.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage);
|
||||
args.lvds_ss.ucSpreadSpectrumType = ss->type;
|
||||
args.lvds_ss.ucSpreadSpectrumType = ss->type & ATOM_SS_CENTRE_SPREAD_MODE_MASK;
|
||||
args.lvds_ss.ucSpreadSpectrumStepSize_Delay = (ss->step & 3) << 2;
|
||||
args.lvds_ss.ucSpreadSpectrumStepSize_Delay |= (ss->delay & 7) << 4;
|
||||
args.lvds_ss.ucEnable = enable;
|
||||
|
@ -512,6 +518,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
|
|||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct drm_encoder *encoder = NULL;
|
||||
struct radeon_encoder *radeon_encoder = NULL;
|
||||
struct drm_connector *connector = NULL;
|
||||
u32 adjusted_clock = mode->clock;
|
||||
int encoder_mode = 0;
|
||||
u32 dp_clock = mode->clock;
|
||||
|
@ -546,9 +553,12 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
|
|||
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
|
||||
if (encoder->crtc == crtc) {
|
||||
radeon_encoder = to_radeon_encoder(encoder);
|
||||
connector = radeon_get_connector_for_encoder(encoder);
|
||||
if (connector)
|
||||
bpc = connector->display_info.bpc;
|
||||
encoder_mode = atombios_get_encoder_mode(encoder);
|
||||
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) {
|
||||
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
|
||||
if ((radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) ||
|
||||
radeon_encoder_is_dp_bridge(encoder)) {
|
||||
if (connector) {
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
struct radeon_connector_atom_dig *dig_connector =
|
||||
|
@ -612,7 +622,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
|
|||
args.v1.usPixelClock = cpu_to_le16(mode->clock / 10);
|
||||
args.v1.ucTransmitterID = radeon_encoder->encoder_id;
|
||||
args.v1.ucEncodeMode = encoder_mode;
|
||||
if (ss_enabled)
|
||||
if (ss_enabled && ss->percentage)
|
||||
args.v1.ucConfig |=
|
||||
ADJUST_DISPLAY_CONFIG_SS_ENABLE;
|
||||
|
||||
|
@ -625,10 +635,11 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
|
|||
args.v3.sInput.ucTransmitterID = radeon_encoder->encoder_id;
|
||||
args.v3.sInput.ucEncodeMode = encoder_mode;
|
||||
args.v3.sInput.ucDispPllConfig = 0;
|
||||
if (ss_enabled)
|
||||
if (ss_enabled && ss->percentage)
|
||||
args.v3.sInput.ucDispPllConfig |=
|
||||
DISPPLL_CONFIG_SS_ENABLE;
|
||||
if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) {
|
||||
if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT) ||
|
||||
radeon_encoder_is_dp_bridge(encoder)) {
|
||||
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
|
||||
if (encoder_mode == ATOM_ENCODER_MODE_DP) {
|
||||
args.v3.sInput.ucDispPllConfig |=
|
||||
|
@ -754,7 +765,10 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,
|
|||
u32 ref_div,
|
||||
u32 fb_div,
|
||||
u32 frac_fb_div,
|
||||
u32 post_div)
|
||||
u32 post_div,
|
||||
int bpc,
|
||||
bool ss_enabled,
|
||||
struct radeon_atom_ss *ss)
|
||||
{
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
|
@ -801,6 +815,8 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,
|
|||
args.v3.ucPostDiv = post_div;
|
||||
args.v3.ucPpll = pll_id;
|
||||
args.v3.ucMiscInfo = (pll_id << 2);
|
||||
if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
|
||||
args.v3.ucMiscInfo |= PIXEL_CLOCK_MISC_REF_DIV_SRC;
|
||||
args.v3.ucTransmitterId = encoder_id;
|
||||
args.v3.ucEncoderMode = encoder_mode;
|
||||
break;
|
||||
|
@ -812,6 +828,17 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,
|
|||
args.v5.ulFbDivDecFrac = cpu_to_le32(frac_fb_div * 100000);
|
||||
args.v5.ucPostDiv = post_div;
|
||||
args.v5.ucMiscInfo = 0; /* HDMI depth, etc. */
|
||||
if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
|
||||
args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_REF_DIV_SRC;
|
||||
switch (bpc) {
|
||||
case 8:
|
||||
default:
|
||||
args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP;
|
||||
break;
|
||||
case 10:
|
||||
args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP;
|
||||
break;
|
||||
}
|
||||
args.v5.ucTransmitterID = encoder_id;
|
||||
args.v5.ucEncoderMode = encoder_mode;
|
||||
args.v5.ucPpll = pll_id;
|
||||
|
@ -824,6 +851,23 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,
|
|||
args.v6.ulFbDivDecFrac = cpu_to_le32(frac_fb_div * 100000);
|
||||
args.v6.ucPostDiv = post_div;
|
||||
args.v6.ucMiscInfo = 0; /* HDMI depth, etc. */
|
||||
if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
|
||||
args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_REF_DIV_SRC;
|
||||
switch (bpc) {
|
||||
case 8:
|
||||
default:
|
||||
args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP;
|
||||
break;
|
||||
case 10:
|
||||
args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP;
|
||||
break;
|
||||
case 12:
|
||||
args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP;
|
||||
break;
|
||||
case 16:
|
||||
args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP;
|
||||
break;
|
||||
}
|
||||
args.v6.ucTransmitterID = encoder_id;
|
||||
args.v6.ucEncoderMode = encoder_mode;
|
||||
args.v6.ucPpll = pll_id;
|
||||
|
@ -855,6 +899,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
|
|||
int encoder_mode = 0;
|
||||
struct radeon_atom_ss ss;
|
||||
bool ss_enabled = false;
|
||||
int bpc = 8;
|
||||
|
||||
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
|
||||
if (encoder->crtc == crtc) {
|
||||
|
@ -891,41 +936,30 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
|
|||
struct radeon_connector_atom_dig *dig_connector =
|
||||
radeon_connector->con_priv;
|
||||
int dp_clock;
|
||||
bpc = connector->display_info.bpc;
|
||||
|
||||
switch (encoder_mode) {
|
||||
case ATOM_ENCODER_MODE_DP:
|
||||
/* DP/eDP */
|
||||
dp_clock = dig_connector->dp_clock / 10;
|
||||
if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) {
|
||||
if (ASIC_IS_DCE4(rdev))
|
||||
ss_enabled =
|
||||
radeon_atombios_get_asic_ss_info(rdev, &ss,
|
||||
dig->lcd_ss_id,
|
||||
dp_clock);
|
||||
else
|
||||
if (ASIC_IS_DCE4(rdev))
|
||||
ss_enabled =
|
||||
radeon_atombios_get_asic_ss_info(rdev, &ss,
|
||||
ASIC_INTERNAL_SS_ON_DP,
|
||||
dp_clock);
|
||||
else {
|
||||
if (dp_clock == 16200) {
|
||||
ss_enabled =
|
||||
radeon_atombios_get_ppll_ss_info(rdev, &ss,
|
||||
dig->lcd_ss_id);
|
||||
} else {
|
||||
if (ASIC_IS_DCE4(rdev))
|
||||
ss_enabled =
|
||||
radeon_atombios_get_asic_ss_info(rdev, &ss,
|
||||
ASIC_INTERNAL_SS_ON_DP,
|
||||
dp_clock);
|
||||
else {
|
||||
if (dp_clock == 16200) {
|
||||
ss_enabled =
|
||||
radeon_atombios_get_ppll_ss_info(rdev, &ss,
|
||||
ATOM_DP_SS_ID2);
|
||||
if (!ss_enabled)
|
||||
ss_enabled =
|
||||
radeon_atombios_get_ppll_ss_info(rdev, &ss,
|
||||
ATOM_DP_SS_ID1);
|
||||
} else
|
||||
ATOM_DP_SS_ID2);
|
||||
if (!ss_enabled)
|
||||
ss_enabled =
|
||||
radeon_atombios_get_ppll_ss_info(rdev, &ss,
|
||||
ATOM_DP_SS_ID1);
|
||||
}
|
||||
} else
|
||||
ss_enabled =
|
||||
radeon_atombios_get_ppll_ss_info(rdev, &ss,
|
||||
ATOM_DP_SS_ID1);
|
||||
}
|
||||
break;
|
||||
case ATOM_ENCODER_MODE_LVDS:
|
||||
|
@ -974,7 +1008,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
|
|||
|
||||
atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id,
|
||||
encoder_mode, radeon_encoder->encoder_id, mode->clock,
|
||||
ref_div, fb_div, frac_fb_div, post_div);
|
||||
ref_div, fb_div, frac_fb_div, post_div, bpc, ss_enabled, &ss);
|
||||
|
||||
if (ss_enabled) {
|
||||
/* calculate ss amount and step size */
|
||||
|
@ -982,7 +1016,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
|
|||
u32 step_size;
|
||||
u32 amount = (((fb_div * 10) + frac_fb_div) * ss.percentage) / 10000;
|
||||
ss.amount = (amount / 10) & ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK;
|
||||
ss.amount |= ((amount - (ss.amount * 10)) << ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT) &
|
||||
ss.amount |= ((amount - (amount / 10)) << ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT) &
|
||||
ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK;
|
||||
if (ss.type & ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD)
|
||||
step_size = (4 * amount * ref_div * (ss.rate * 2048)) /
|
||||
|
@ -1395,11 +1429,19 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
|
|||
uint32_t pll_in_use = 0;
|
||||
|
||||
if (ASIC_IS_DCE4(rdev)) {
|
||||
/* if crtc is driving DP and we have an ext clock, use that */
|
||||
list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) {
|
||||
if (test_encoder->crtc && (test_encoder->crtc == crtc)) {
|
||||
/* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock,
|
||||
* depending on the asic:
|
||||
* DCE4: PPLL or ext clock
|
||||
* DCE5: DCPLL or ext clock
|
||||
*
|
||||
* Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip
|
||||
* PPLL/DCPLL programming and only program the DP DTO for the
|
||||
* crtc virtual pixel clock.
|
||||
*/
|
||||
if (atombios_get_encoder_mode(test_encoder) == ATOM_ENCODER_MODE_DP) {
|
||||
if (rdev->clock.dp_extclk)
|
||||
if (ASIC_IS_DCE5(rdev) || rdev->clock.dp_extclk)
|
||||
return ATOM_PPLL_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -1515,6 +1557,8 @@ static void atombios_crtc_commit(struct drm_crtc *crtc)
|
|||
static void atombios_crtc_disable(struct drm_crtc *crtc)
|
||||
{
|
||||
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
|
||||
struct radeon_atom_ss ss;
|
||||
|
||||
atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
|
||||
|
||||
switch (radeon_crtc->pll_id) {
|
||||
|
@ -1522,7 +1566,7 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)
|
|||
case ATOM_PPLL2:
|
||||
/* disable the ppll */
|
||||
atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id,
|
||||
0, 0, ATOM_DISABLE, 0, 0, 0, 0);
|
||||
0, 0, ATOM_DISABLE, 0, 0, 0, 0, 0, false, &ss);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1578,7 +1578,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
|
|||
u32 sq_stack_resource_mgmt_2;
|
||||
u32 sq_stack_resource_mgmt_3;
|
||||
u32 vgt_cache_invalidation;
|
||||
u32 hdp_host_path_cntl;
|
||||
u32 hdp_host_path_cntl, tmp;
|
||||
int i, j, num_shader_engines, ps_thread_count;
|
||||
|
||||
switch (rdev->family) {
|
||||
|
@ -1933,8 +1933,12 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
|
|||
rdev->config.evergreen.tile_config |= (3 << 0);
|
||||
break;
|
||||
}
|
||||
rdev->config.evergreen.tile_config |=
|
||||
((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
|
||||
/* num banks is 8 on all fusion asics */
|
||||
if (rdev->flags & RADEON_IS_IGP)
|
||||
rdev->config.evergreen.tile_config |= 8 << 4;
|
||||
else
|
||||
rdev->config.evergreen.tile_config |=
|
||||
((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
|
||||
rdev->config.evergreen.tile_config |=
|
||||
((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT) << 8;
|
||||
rdev->config.evergreen.tile_config |=
|
||||
|
@ -2138,6 +2142,10 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
|
|||
for (i = SQ_ALU_CONST_BUFFER_SIZE_HS_0; i < 0x29000; i += 4)
|
||||
WREG32(i, 0);
|
||||
|
||||
tmp = RREG32(HDP_MISC_CNTL);
|
||||
tmp |= HDP_FLUSH_INVALIDATE_CACHE;
|
||||
WREG32(HDP_MISC_CNTL, tmp);
|
||||
|
||||
hdp_host_path_cntl = RREG32(HDP_HOST_PATH_CNTL);
|
||||
WREG32(HDP_HOST_PATH_CNTL, hdp_host_path_cntl);
|
||||
|
||||
|
|
|
@ -64,6 +64,8 @@
|
|||
#define GB_BACKEND_MAP 0x98FC
|
||||
#define DMIF_ADDR_CONFIG 0xBD4
|
||||
#define HDP_ADDR_CONFIG 0x2F48
|
||||
#define HDP_MISC_CNTL 0x2F4C
|
||||
#define HDP_FLUSH_INVALIDATE_CACHE (1 << 0)
|
||||
|
||||
#define CC_SYS_RB_BACKEND_DISABLE 0x3F88
|
||||
#define GC_USER_RB_BACKEND_DISABLE 0x9B7C
|
||||
|
|
|
@ -417,7 +417,7 @@ static u32 cayman_get_tile_pipe_to_backend_map(struct radeon_device *rdev,
|
|||
num_shader_engines = 1;
|
||||
if (num_shader_engines > rdev->config.cayman.max_shader_engines)
|
||||
num_shader_engines = rdev->config.cayman.max_shader_engines;
|
||||
if (num_backends_per_asic > num_shader_engines)
|
||||
if (num_backends_per_asic < num_shader_engines)
|
||||
num_backends_per_asic = num_shader_engines;
|
||||
if (num_backends_per_asic > (rdev->config.cayman.max_backends_per_se * num_shader_engines))
|
||||
num_backends_per_asic = rdev->config.cayman.max_backends_per_se * num_shader_engines;
|
||||
|
@ -829,7 +829,7 @@ static void cayman_gpu_init(struct radeon_device *rdev)
|
|||
rdev->config.cayman.tile_config |=
|
||||
((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
|
||||
rdev->config.cayman.tile_config |=
|
||||
(gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT;
|
||||
((gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT) << 8;
|
||||
rdev->config.cayman.tile_config |=
|
||||
((gb_addr_config & ROW_SIZE_MASK) >> ROW_SIZE_SHIFT) << 12;
|
||||
|
||||
|
@ -931,6 +931,10 @@ static void cayman_gpu_init(struct radeon_device *rdev)
|
|||
WREG32(CB_PERF_CTR3_SEL_0, 0);
|
||||
WREG32(CB_PERF_CTR3_SEL_1, 0);
|
||||
|
||||
tmp = RREG32(HDP_MISC_CNTL);
|
||||
tmp |= HDP_FLUSH_INVALIDATE_CACHE;
|
||||
WREG32(HDP_MISC_CNTL, tmp);
|
||||
|
||||
hdp_host_path_cntl = RREG32(HDP_HOST_PATH_CNTL);
|
||||
WREG32(HDP_HOST_PATH_CNTL, hdp_host_path_cntl);
|
||||
|
||||
|
|
|
@ -136,6 +136,8 @@
|
|||
#define HDP_NONSURFACE_INFO 0x2C08
|
||||
#define HDP_NONSURFACE_SIZE 0x2C0C
|
||||
#define HDP_ADDR_CONFIG 0x2F48
|
||||
#define HDP_MISC_CNTL 0x2F4C
|
||||
#define HDP_FLUSH_INVALIDATE_CACHE (1 << 0)
|
||||
|
||||
#define CC_SYS_RB_BACKEND_DISABLE 0x3F88
|
||||
#define GC_USER_SYS_RB_BACKEND_DISABLE 0x3F8C
|
||||
|
@ -351,7 +353,7 @@
|
|||
#define MULTI_GPU_TILE_SIZE_MASK 0x03000000
|
||||
#define MULTI_GPU_TILE_SIZE_SHIFT 24
|
||||
#define ROW_SIZE(x) ((x) << 28)
|
||||
#define ROW_SIZE_MASK 0x30000007
|
||||
#define ROW_SIZE_MASK 0x30000000
|
||||
#define ROW_SIZE_SHIFT 28
|
||||
#define NUM_LOWER_PIPES(x) ((x) << 30)
|
||||
#define NUM_LOWER_PIPES_MASK 0x40000000
|
||||
|
|
|
@ -782,6 +782,7 @@ static struct radeon_asic evergreen_asic = {
|
|||
.hpd_fini = &evergreen_hpd_fini,
|
||||
.hpd_sense = &evergreen_hpd_sense,
|
||||
.hpd_set_polarity = &evergreen_hpd_set_polarity,
|
||||
.ioctl_wait_idle = r600_ioctl_wait_idle,
|
||||
.gui_idle = &r600_gui_idle,
|
||||
.pm_misc = &evergreen_pm_misc,
|
||||
.pm_prepare = &evergreen_pm_prepare,
|
||||
|
@ -828,6 +829,7 @@ static struct radeon_asic sumo_asic = {
|
|||
.hpd_fini = &evergreen_hpd_fini,
|
||||
.hpd_sense = &evergreen_hpd_sense,
|
||||
.hpd_set_polarity = &evergreen_hpd_set_polarity,
|
||||
.ioctl_wait_idle = r600_ioctl_wait_idle,
|
||||
.gui_idle = &r600_gui_idle,
|
||||
.pm_misc = &evergreen_pm_misc,
|
||||
.pm_prepare = &evergreen_pm_prepare,
|
||||
|
@ -874,6 +876,7 @@ static struct radeon_asic btc_asic = {
|
|||
.hpd_fini = &evergreen_hpd_fini,
|
||||
.hpd_sense = &evergreen_hpd_sense,
|
||||
.hpd_set_polarity = &evergreen_hpd_set_polarity,
|
||||
.ioctl_wait_idle = r600_ioctl_wait_idle,
|
||||
.gui_idle = &r600_gui_idle,
|
||||
.pm_misc = &evergreen_pm_misc,
|
||||
.pm_prepare = &evergreen_pm_prepare,
|
||||
|
@ -920,6 +923,7 @@ static struct radeon_asic cayman_asic = {
|
|||
.hpd_fini = &evergreen_hpd_fini,
|
||||
.hpd_sense = &evergreen_hpd_sense,
|
||||
.hpd_set_polarity = &evergreen_hpd_set_polarity,
|
||||
.ioctl_wait_idle = r600_ioctl_wait_idle,
|
||||
.gui_idle = &r600_gui_idle,
|
||||
.pm_misc = &evergreen_pm_misc,
|
||||
.pm_prepare = &evergreen_pm_prepare,
|
||||
|
|
|
@ -50,20 +50,21 @@ void radeon_connector_hotplug(struct drm_connector *connector)
|
|||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
|
||||
if (radeon_connector->hpd.hpd != RADEON_HPD_NONE)
|
||||
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
|
||||
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
|
||||
|
||||
if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
|
||||
(connector->connector_type == DRM_MODE_CONNECTOR_eDP)) {
|
||||
if ((radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
|
||||
(radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_eDP)) {
|
||||
if (radeon_dp_needs_link_train(radeon_connector)) {
|
||||
if (connector->encoder)
|
||||
dp_link_train(connector->encoder, connector);
|
||||
}
|
||||
}
|
||||
/* powering up/down the eDP panel generates hpd events which
|
||||
* can interfere with modesetting.
|
||||
*/
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
|
||||
return;
|
||||
|
||||
/* pre-r600 did not always have the hpd pins mapped accurately to connectors */
|
||||
if (rdev->family >= CHIP_R600) {
|
||||
if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
|
||||
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
|
||||
else
|
||||
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void radeon_property_change_mode(struct drm_encoder *encoder)
|
||||
|
@ -1054,23 +1055,124 @@ static int radeon_dp_get_modes(struct drm_connector *connector)
|
|||
int ret;
|
||||
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
struct drm_encoder *encoder;
|
||||
struct drm_display_mode *mode;
|
||||
|
||||
if (!radeon_dig_connector->edp_on)
|
||||
atombios_set_edp_panel_power(connector,
|
||||
ATOM_TRANSMITTER_ACTION_POWER_ON);
|
||||
}
|
||||
ret = radeon_ddc_get_modes(radeon_connector);
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
ret = radeon_ddc_get_modes(radeon_connector);
|
||||
if (!radeon_dig_connector->edp_on)
|
||||
atombios_set_edp_panel_power(connector,
|
||||
ATOM_TRANSMITTER_ACTION_POWER_OFF);
|
||||
}
|
||||
|
||||
if (ret > 0) {
|
||||
encoder = radeon_best_single_encoder(connector);
|
||||
if (encoder) {
|
||||
radeon_fixup_lvds_native_mode(encoder, connector);
|
||||
/* add scaled modes */
|
||||
radeon_add_common_modes(encoder, connector);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
encoder = radeon_best_single_encoder(connector);
|
||||
if (!encoder)
|
||||
return 0;
|
||||
|
||||
/* we have no EDID modes */
|
||||
mode = radeon_fp_native_mode(encoder);
|
||||
if (mode) {
|
||||
ret = 1;
|
||||
drm_mode_probed_add(connector, mode);
|
||||
/* add the width/height from vbios tables if available */
|
||||
connector->display_info.width_mm = mode->width_mm;
|
||||
connector->display_info.height_mm = mode->height_mm;
|
||||
/* add scaled modes */
|
||||
radeon_add_common_modes(encoder, connector);
|
||||
}
|
||||
} else
|
||||
ret = radeon_ddc_get_modes(radeon_connector);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_mode_object *obj;
|
||||
struct drm_encoder *encoder;
|
||||
struct radeon_encoder *radeon_encoder;
|
||||
int i;
|
||||
bool found = false;
|
||||
|
||||
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
|
||||
if (connector->encoder_ids[i] == 0)
|
||||
break;
|
||||
|
||||
obj = drm_mode_object_find(connector->dev, connector->encoder_ids[i], DRM_MODE_OBJECT_ENCODER);
|
||||
if (!obj)
|
||||
continue;
|
||||
|
||||
encoder = obj_to_encoder(obj);
|
||||
radeon_encoder = to_radeon_encoder(encoder);
|
||||
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
case ENCODER_OBJECT_ID_TRAVIS:
|
||||
case ENCODER_OBJECT_ID_NUTMEG:
|
||||
found = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_mode_object *obj;
|
||||
struct drm_encoder *encoder;
|
||||
struct radeon_encoder *radeon_encoder;
|
||||
int i;
|
||||
bool found = false;
|
||||
|
||||
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
|
||||
if (connector->encoder_ids[i] == 0)
|
||||
break;
|
||||
|
||||
obj = drm_mode_object_find(connector->dev, connector->encoder_ids[i], DRM_MODE_OBJECT_ENCODER);
|
||||
if (!obj)
|
||||
continue;
|
||||
|
||||
encoder = obj_to_encoder(obj);
|
||||
radeon_encoder = to_radeon_encoder(encoder);
|
||||
if (radeon_encoder->caps & ATOM_ENCODER_CAP_RECORD_HBR2)
|
||||
found = true;
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
bool radeon_connector_is_dp12_capable(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
|
||||
if (ASIC_IS_DCE5(rdev) &&
|
||||
(rdev->clock.dp_extclk >= 53900) &&
|
||||
radeon_connector_encoder_is_hbr2(connector)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
radeon_dp_detect(struct drm_connector *connector, bool force)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
enum drm_connector_status ret = connector_status_disconnected;
|
||||
struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
|
||||
|
@ -1081,6 +1183,15 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
|
|||
}
|
||||
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
struct drm_encoder *encoder = radeon_best_single_encoder(connector);
|
||||
if (encoder) {
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
|
||||
|
||||
/* check if panel is valid */
|
||||
if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240)
|
||||
ret = connector_status_connected;
|
||||
}
|
||||
/* eDP is always DP */
|
||||
radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT;
|
||||
if (!radeon_dig_connector->edp_on)
|
||||
|
@ -1093,12 +1204,18 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
|
|||
ATOM_TRANSMITTER_ACTION_POWER_OFF);
|
||||
} else {
|
||||
radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector);
|
||||
if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
|
||||
if (radeon_dp_getdpcd(radeon_connector))
|
||||
ret = connector_status_connected;
|
||||
if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
|
||||
ret = connector_status_connected;
|
||||
if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT)
|
||||
radeon_dp_getdpcd(radeon_connector);
|
||||
} else {
|
||||
if (radeon_ddc_probe(radeon_connector))
|
||||
ret = connector_status_connected;
|
||||
if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
|
||||
if (radeon_dp_getdpcd(radeon_connector))
|
||||
ret = connector_status_connected;
|
||||
} else {
|
||||
if (radeon_ddc_probe(radeon_connector))
|
||||
ret = connector_status_connected;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1114,11 +1231,38 @@ static int radeon_dp_mode_valid(struct drm_connector *connector,
|
|||
|
||||
/* XXX check mode bandwidth */
|
||||
|
||||
if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
|
||||
(radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
|
||||
return radeon_dp_mode_valid_helper(radeon_connector, mode);
|
||||
else
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
|
||||
struct drm_encoder *encoder = radeon_best_single_encoder(connector);
|
||||
|
||||
if ((mode->hdisplay < 320) || (mode->vdisplay < 240))
|
||||
return MODE_PANEL;
|
||||
|
||||
if (encoder) {
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
|
||||
|
||||
/* AVIVO hardware supports downscaling modes larger than the panel
|
||||
* to the panel size, but I'm not sure this is desirable.
|
||||
*/
|
||||
if ((mode->hdisplay > native_mode->hdisplay) ||
|
||||
(mode->vdisplay > native_mode->vdisplay))
|
||||
return MODE_PANEL;
|
||||
|
||||
/* if scaling is disabled, block non-native modes */
|
||||
if (radeon_encoder->rmx_type == RMX_OFF) {
|
||||
if ((mode->hdisplay != native_mode->hdisplay) ||
|
||||
(mode->vdisplay != native_mode->vdisplay))
|
||||
return MODE_PANEL;
|
||||
}
|
||||
}
|
||||
return MODE_OK;
|
||||
} else {
|
||||
if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
|
||||
(radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
|
||||
return radeon_dp_mode_valid_helper(connector, mode);
|
||||
else
|
||||
return MODE_OK;
|
||||
}
|
||||
}
|
||||
|
||||
struct drm_connector_helper_funcs radeon_dp_connector_helper_funcs = {
|
||||
|
@ -1151,8 +1295,11 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
struct drm_connector *connector;
|
||||
struct radeon_connector *radeon_connector;
|
||||
struct radeon_connector_atom_dig *radeon_dig_connector;
|
||||
struct drm_encoder *encoder;
|
||||
struct radeon_encoder *radeon_encoder;
|
||||
uint32_t subpixel_order = SubPixelNone;
|
||||
bool shared_ddc = false;
|
||||
bool is_dp_bridge = false;
|
||||
|
||||
if (connector_type == DRM_MODE_CONNECTOR_Unknown)
|
||||
return;
|
||||
|
@ -1184,6 +1331,21 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
}
|
||||
}
|
||||
|
||||
/* check if it's a dp bridge */
|
||||
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
|
||||
radeon_encoder = to_radeon_encoder(encoder);
|
||||
if (radeon_encoder->devices & supported_device) {
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
case ENCODER_OBJECT_ID_TRAVIS:
|
||||
case ENCODER_OBJECT_ID_NUTMEG:
|
||||
is_dp_bridge = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
radeon_connector = kzalloc(sizeof(struct radeon_connector), GFP_KERNEL);
|
||||
if (!radeon_connector)
|
||||
return;
|
||||
|
@ -1201,120 +1363,8 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
if (!radeon_connector->router_bus)
|
||||
DRM_ERROR("Failed to assign router i2c bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
switch (connector_type) {
|
||||
case DRM_MODE_CONNECTOR_VGA:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVIA:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVII:
|
||||
case DRM_MODE_CONNECTOR_DVID:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.coherent_mode_property,
|
||||
1);
|
||||
if (ASIC_IS_AVIVO(rdev)) {
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_OFF);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_hborder_property,
|
||||
0);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_vborder_property,
|
||||
0);
|
||||
}
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DVII) {
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
}
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DVII)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_HDMIA:
|
||||
case DRM_MODE_CONNECTOR_HDMIB:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.coherent_mode_property,
|
||||
1);
|
||||
if (ASIC_IS_AVIVO(rdev)) {
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_OFF);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_hborder_property,
|
||||
0);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_vborder_property,
|
||||
0);
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
|
||||
if (is_dp_bridge) {
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
|
@ -1334,11 +1384,18 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.coherent_mode_property,
|
||||
1);
|
||||
if (ASIC_IS_AVIVO(rdev)) {
|
||||
switch (connector_type) {
|
||||
case DRM_MODE_CONNECTOR_VGA:
|
||||
case DRM_MODE_CONNECTOR_DVIA:
|
||||
default:
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVII:
|
||||
case DRM_MODE_CONNECTOR_DVID:
|
||||
case DRM_MODE_CONNECTOR_HDMIA:
|
||||
case DRM_MODE_CONNECTOR_HDMIB:
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_OFF);
|
||||
|
@ -1348,48 +1405,234 @@ radeon_add_atom_connector(struct drm_device *dev,
|
|||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_vborder_property,
|
||||
0);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_LVDS:
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
}
|
||||
connector->interlace_allowed = true;
|
||||
/* in theory with a DP to VGA converter... */
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_SVIDEO:
|
||||
case DRM_MODE_CONNECTOR_Composite:
|
||||
case DRM_MODE_CONNECTOR_9PinDIN:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs);
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.tv_std_property,
|
||||
radeon_atombios_get_tv_info(rdev));
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_LVDS:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
} else {
|
||||
switch (connector_type) {
|
||||
case DRM_MODE_CONNECTOR_VGA:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->polled = DRM_CONNECTOR_POLL_CONNECT;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVIA:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_vga_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = true;
|
||||
connector->doublescan_allowed = true;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DVII:
|
||||
case DRM_MODE_CONNECTOR_DVID:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.coherent_mode_property,
|
||||
1);
|
||||
if (ASIC_IS_AVIVO(rdev)) {
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_OFF);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_hborder_property,
|
||||
0);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_vborder_property,
|
||||
0);
|
||||
}
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DVII) {
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
}
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DVII)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_HDMIA:
|
||||
case DRM_MODE_CONNECTOR_HDMIB:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_dvi_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.coherent_mode_property,
|
||||
1);
|
||||
if (ASIC_IS_AVIVO(rdev)) {
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_OFF);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_hborder_property,
|
||||
0);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_vborder_property,
|
||||
0);
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = true;
|
||||
if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
|
||||
connector->doublescan_allowed = true;
|
||||
else
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
/* add DP i2c bus */
|
||||
radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch");
|
||||
if (!radeon_dig_connector->dp_i2c_bus)
|
||||
DRM_ERROR("DP: Failed to assign dp ddc bus! Check dmesg for i2c errors.\n");
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.coherent_mode_property,
|
||||
1);
|
||||
if (ASIC_IS_AVIVO(rdev)) {
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_property,
|
||||
UNDERSCAN_OFF);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_hborder_property,
|
||||
0);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.underscan_vborder_property,
|
||||
0);
|
||||
}
|
||||
connector->interlace_allowed = true;
|
||||
/* in theory with a DP to VGA converter... */
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
/* add DP i2c bus */
|
||||
radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "eDP-auxch");
|
||||
if (!radeon_dig_connector->dp_i2c_bus)
|
||||
DRM_ERROR("DP: Failed to assign dp ddc bus! Check dmesg for i2c errors.\n");
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_SVIDEO:
|
||||
case DRM_MODE_CONNECTOR_Composite:
|
||||
case DRM_MODE_CONNECTOR_9PinDIN:
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs);
|
||||
radeon_connector->dac_load_detect = true;
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.load_detect_property,
|
||||
1);
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
rdev->mode_info.tv_std_property,
|
||||
radeon_atombios_get_tv_info(rdev));
|
||||
/* no HPD on analog connectors */
|
||||
radeon_connector->hpd.hpd = RADEON_HPD_NONE;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_LVDS:
|
||||
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
|
||||
if (!radeon_dig_connector)
|
||||
goto failed;
|
||||
radeon_dig_connector->igp_lane_info = igp_lane_info;
|
||||
radeon_connector->con_priv = radeon_dig_connector;
|
||||
drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type);
|
||||
drm_connector_helper_add(&radeon_connector->base, &radeon_lvds_connector_helper_funcs);
|
||||
if (i2c_bus->valid) {
|
||||
radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
|
||||
if (!radeon_connector->ddc_bus)
|
||||
DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
|
||||
}
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
}
|
||||
drm_connector_attach_property(&radeon_connector->base,
|
||||
dev->mode_config.scaling_mode_property,
|
||||
DRM_MODE_SCALE_FULLSCREEN);
|
||||
subpixel_order = SubPixelHorizontalRGB;
|
||||
connector->interlace_allowed = false;
|
||||
connector->doublescan_allowed = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) {
|
||||
|
|
|
@ -923,6 +923,9 @@ int radeon_resume_kms(struct drm_device *dev)
|
|||
radeon_fbdev_set_suspend(rdev, 0);
|
||||
console_unlock();
|
||||
|
||||
/* init dig PHYs */
|
||||
if (rdev->is_atom_bios)
|
||||
radeon_atom_encoder_init(rdev);
|
||||
/* reset hpd state */
|
||||
radeon_hpd_init(rdev);
|
||||
/* blat the mode back in */
|
||||
|
|
|
@ -1345,6 +1345,11 @@ int radeon_modeset_init(struct radeon_device *rdev)
|
|||
if (!ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* init dig PHYs */
|
||||
if (rdev->is_atom_bios)
|
||||
radeon_atom_encoder_init(rdev);
|
||||
|
||||
/* initialize hpd */
|
||||
radeon_hpd_init(rdev);
|
||||
|
||||
|
|
|
@ -50,9 +50,10 @@
|
|||
* 2.7.0 - fixups for r600 2D tiling support. (no external ABI change), add eg dyn gpr regs
|
||||
* 2.8.0 - pageflip support, r500 US_FORMAT regs. r500 ARGB2101010 colorbuf, r300->r500 CMASK, clock crystal query
|
||||
* 2.9.0 - r600 tiling (s3tc,rgtc) working, SET_PREDICATION packet 3 on r600 + eg, backend query
|
||||
* 2.10.0 - fusion 2D tiling
|
||||
*/
|
||||
#define KMS_DRIVER_MAJOR 2
|
||||
#define KMS_DRIVER_MINOR 9
|
||||
#define KMS_DRIVER_MINOR 10
|
||||
#define KMS_DRIVER_PATCHLEVEL 0
|
||||
int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
|
||||
int radeon_driver_unload_kms(struct drm_device *dev);
|
||||
|
|
|
@ -229,6 +229,22 @@ radeon_get_connector_for_encoder(struct drm_encoder *encoder)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct drm_connector *
|
||||
radeon_get_connector_for_encoder_init(struct drm_encoder *encoder)
|
||||
{
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct drm_connector *connector;
|
||||
struct radeon_connector *radeon_connector;
|
||||
|
||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||
radeon_connector = to_radeon_connector(connector);
|
||||
if (radeon_encoder->devices & radeon_connector->devices)
|
||||
return connector;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct drm_encoder *radeon_atom_get_external_encoder(struct drm_encoder *encoder)
|
||||
{
|
||||
struct drm_device *dev = encoder->dev;
|
||||
|
@ -250,6 +266,25 @@ struct drm_encoder *radeon_atom_get_external_encoder(struct drm_encoder *encoder
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool radeon_encoder_is_dp_bridge(struct drm_encoder *encoder)
|
||||
{
|
||||
struct drm_encoder *other_encoder = radeon_atom_get_external_encoder(encoder);
|
||||
|
||||
if (other_encoder) {
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(other_encoder);
|
||||
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
case ENCODER_OBJECT_ID_TRAVIS:
|
||||
case ENCODER_OBJECT_ID_NUTMEG:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void radeon_panel_mode_fixup(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
|
@ -621,6 +656,10 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
|||
struct radeon_connector *radeon_connector;
|
||||
struct radeon_connector_atom_dig *dig_connector;
|
||||
|
||||
/* dp bridges are always DP */
|
||||
if (radeon_encoder_is_dp_bridge(encoder))
|
||||
return ATOM_ENCODER_MODE_DP;
|
||||
|
||||
connector = radeon_get_connector_for_encoder(encoder);
|
||||
if (!connector) {
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
|
@ -668,7 +707,6 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
|||
return ATOM_ENCODER_MODE_LVDS;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
dig_connector = radeon_connector->con_priv;
|
||||
if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
|
||||
(dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
|
||||
|
@ -682,6 +720,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
|||
} else
|
||||
return ATOM_ENCODER_MODE_DVI;
|
||||
break;
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
return ATOM_ENCODER_MODE_DP;
|
||||
case DRM_MODE_CONNECTOR_DVIA:
|
||||
case DRM_MODE_CONNECTOR_VGA:
|
||||
return ATOM_ENCODER_MODE_CRT;
|
||||
|
@ -747,7 +787,7 @@ union dig_encoder_control {
|
|||
};
|
||||
|
||||
void
|
||||
atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
|
||||
atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode)
|
||||
{
|
||||
struct drm_device *dev = encoder->dev;
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
|
@ -760,6 +800,7 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
|
|||
int dp_clock = 0;
|
||||
int dp_lane_count = 0;
|
||||
int hpd_id = RADEON_HPD_NONE;
|
||||
int bpc = 8;
|
||||
|
||||
if (connector) {
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
|
@ -769,6 +810,7 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
|
|||
dp_clock = dig_connector->dp_clock;
|
||||
dp_lane_count = dig_connector->dp_lane_count;
|
||||
hpd_id = radeon_connector->hpd.hpd;
|
||||
bpc = connector->display_info.bpc;
|
||||
}
|
||||
|
||||
/* no dig encoder assigned */
|
||||
|
@ -791,7 +833,10 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
|
|||
|
||||
args.v1.ucAction = action;
|
||||
args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
|
||||
args.v1.ucEncoderMode = atombios_get_encoder_mode(encoder);
|
||||
if (action == ATOM_ENCODER_CMD_SETUP_PANEL_MODE)
|
||||
args.v3.ucPanelMode = panel_mode;
|
||||
else
|
||||
args.v1.ucEncoderMode = atombios_get_encoder_mode(encoder);
|
||||
|
||||
if ((args.v1.ucEncoderMode == ATOM_ENCODER_MODE_DP) ||
|
||||
(args.v1.ucEncoderMode == ATOM_ENCODER_MODE_DP_MST))
|
||||
|
@ -810,7 +855,27 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
|
|||
args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V4_DPLINKRATE_5_40GHZ;
|
||||
}
|
||||
args.v4.acConfig.ucDigSel = dig->dig_encoder;
|
||||
args.v4.ucBitPerColor = PANEL_8BIT_PER_COLOR;
|
||||
switch (bpc) {
|
||||
case 0:
|
||||
args.v4.ucBitPerColor = PANEL_BPC_UNDEFINE;
|
||||
break;
|
||||
case 6:
|
||||
args.v4.ucBitPerColor = PANEL_6BIT_PER_COLOR;
|
||||
break;
|
||||
case 8:
|
||||
default:
|
||||
args.v4.ucBitPerColor = PANEL_8BIT_PER_COLOR;
|
||||
break;
|
||||
case 10:
|
||||
args.v4.ucBitPerColor = PANEL_10BIT_PER_COLOR;
|
||||
break;
|
||||
case 12:
|
||||
args.v4.ucBitPerColor = PANEL_12BIT_PER_COLOR;
|
||||
break;
|
||||
case 16:
|
||||
args.v4.ucBitPerColor = PANEL_16BIT_PER_COLOR;
|
||||
break;
|
||||
}
|
||||
if (hpd_id == RADEON_HPD_NONE)
|
||||
args.v4.ucHPD_ID = 0;
|
||||
else
|
||||
|
@ -819,7 +884,27 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
|
|||
if ((args.v1.ucEncoderMode == ATOM_ENCODER_MODE_DP) && (dp_clock == 270000))
|
||||
args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ;
|
||||
args.v3.acConfig.ucDigSel = dig->dig_encoder;
|
||||
args.v3.ucBitPerColor = PANEL_8BIT_PER_COLOR;
|
||||
switch (bpc) {
|
||||
case 0:
|
||||
args.v3.ucBitPerColor = PANEL_BPC_UNDEFINE;
|
||||
break;
|
||||
case 6:
|
||||
args.v3.ucBitPerColor = PANEL_6BIT_PER_COLOR;
|
||||
break;
|
||||
case 8:
|
||||
default:
|
||||
args.v3.ucBitPerColor = PANEL_8BIT_PER_COLOR;
|
||||
break;
|
||||
case 10:
|
||||
args.v3.ucBitPerColor = PANEL_10BIT_PER_COLOR;
|
||||
break;
|
||||
case 12:
|
||||
args.v3.ucBitPerColor = PANEL_12BIT_PER_COLOR;
|
||||
break;
|
||||
case 16:
|
||||
args.v3.ucBitPerColor = PANEL_16BIT_PER_COLOR;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ((args.v1.ucEncoderMode == ATOM_ENCODER_MODE_DP) && (dp_clock == 270000))
|
||||
args.v1.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ;
|
||||
|
@ -859,7 +944,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
|
|||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
|
||||
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
|
||||
struct drm_connector *connector;
|
||||
union dig_transmitter_control args;
|
||||
int index = 0;
|
||||
uint8_t frev, crev;
|
||||
|
@ -870,6 +955,11 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
|
|||
int connector_object_id = 0;
|
||||
int igp_lane_info = 0;
|
||||
|
||||
if (action == ATOM_TRANSMITTER_ACTION_INIT)
|
||||
connector = radeon_get_connector_for_encoder_init(encoder);
|
||||
else
|
||||
connector = radeon_get_connector_for_encoder(encoder);
|
||||
|
||||
if (connector) {
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
struct radeon_connector_atom_dig *dig_connector =
|
||||
|
@ -931,10 +1021,10 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
|
|||
else
|
||||
args.v3.ucLaneNum = 4;
|
||||
|
||||
if (dig->linkb) {
|
||||
if (dig->linkb)
|
||||
args.v3.acConfig.ucLinkSel = 1;
|
||||
if (dig->dig_encoder & 1)
|
||||
args.v3.acConfig.ucEncoderSel = 1;
|
||||
}
|
||||
|
||||
/* Select the PLL for the PHY
|
||||
* DP PHY should be clocked from external src if there is
|
||||
|
@ -946,11 +1036,16 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
|
|||
}
|
||||
|
||||
if (ASIC_IS_DCE5(rdev)) {
|
||||
if (is_dp && rdev->clock.dp_extclk)
|
||||
args.v4.acConfig.ucRefClkSource = 3; /* external src */
|
||||
else
|
||||
/* On DCE5 DCPLL usually generates the DP ref clock */
|
||||
if (is_dp) {
|
||||
if (rdev->clock.dp_extclk)
|
||||
args.v4.acConfig.ucRefClkSource = ENCODER_REFCLK_SRC_EXTCLK;
|
||||
else
|
||||
args.v4.acConfig.ucRefClkSource = ENCODER_REFCLK_SRC_DCPLL;
|
||||
} else
|
||||
args.v4.acConfig.ucRefClkSource = pll_id;
|
||||
} else {
|
||||
/* On DCE4, if there is an external clock, it generates the DP ref clock */
|
||||
if (is_dp && rdev->clock.dp_extclk)
|
||||
args.v3.acConfig.ucRefClkSource = 2; /* external src */
|
||||
else
|
||||
|
@ -1047,7 +1142,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
|
|||
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
atombios_set_edp_panel_power(struct drm_connector *connector, int action)
|
||||
{
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
|
@ -1058,23 +1153,37 @@ atombios_set_edp_panel_power(struct drm_connector *connector, int action)
|
|||
uint8_t frev, crev;
|
||||
|
||||
if (connector->connector_type != DRM_MODE_CONNECTOR_eDP)
|
||||
return;
|
||||
goto done;
|
||||
|
||||
if (!ASIC_IS_DCE4(rdev))
|
||||
return;
|
||||
goto done;
|
||||
|
||||
if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) &&
|
||||
(action != ATOM_TRANSMITTER_ACTION_POWER_OFF))
|
||||
return;
|
||||
goto done;
|
||||
|
||||
if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
|
||||
return;
|
||||
goto done;
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
||||
args.v1.ucAction = action;
|
||||
|
||||
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
|
||||
|
||||
/* wait for the panel to power up */
|
||||
if (action == ATOM_TRANSMITTER_ACTION_POWER_ON) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 300; i++) {
|
||||
if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
|
||||
return true;
|
||||
mdelay(1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
done:
|
||||
return true;
|
||||
}
|
||||
|
||||
union external_encoder_control {
|
||||
|
@ -1092,13 +1201,19 @@ atombios_external_encoder_setup(struct drm_encoder *encoder,
|
|||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct radeon_encoder *ext_radeon_encoder = to_radeon_encoder(ext_encoder);
|
||||
union external_encoder_control args;
|
||||
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
|
||||
struct drm_connector *connector;
|
||||
int index = GetIndexIntoMasterTable(COMMAND, ExternalEncoderControl);
|
||||
u8 frev, crev;
|
||||
int dp_clock = 0;
|
||||
int dp_lane_count = 0;
|
||||
int connector_object_id = 0;
|
||||
u32 ext_enum = (ext_radeon_encoder->encoder_enum & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
|
||||
int bpc = 8;
|
||||
|
||||
if (action == EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT)
|
||||
connector = radeon_get_connector_for_encoder_init(encoder);
|
||||
else
|
||||
connector = radeon_get_connector_for_encoder(encoder);
|
||||
|
||||
if (connector) {
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
|
@ -1109,6 +1224,7 @@ atombios_external_encoder_setup(struct drm_encoder *encoder,
|
|||
dp_lane_count = dig_connector->dp_lane_count;
|
||||
connector_object_id =
|
||||
(radeon_connector->connector_object_id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
|
||||
bpc = connector->display_info.bpc;
|
||||
}
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
@ -1166,7 +1282,27 @@ atombios_external_encoder_setup(struct drm_encoder *encoder,
|
|||
args.v3.sExtEncoder.ucConfig |= EXTERNAL_ENCODER_CONFIG_V3_ENCODER3;
|
||||
break;
|
||||
}
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_8BIT_PER_COLOR;
|
||||
switch (bpc) {
|
||||
case 0:
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_BPC_UNDEFINE;
|
||||
break;
|
||||
case 6:
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_6BIT_PER_COLOR;
|
||||
break;
|
||||
case 8:
|
||||
default:
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_8BIT_PER_COLOR;
|
||||
break;
|
||||
case 10:
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_10BIT_PER_COLOR;
|
||||
break;
|
||||
case 12:
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_12BIT_PER_COLOR;
|
||||
break;
|
||||
case 16:
|
||||
args.v3.sExtEncoder.ucBitPerColor = PANEL_16BIT_PER_COLOR;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
DRM_ERROR("Unknown table version: %d, %d\n", frev, crev);
|
||||
|
@ -1307,9 +1443,11 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
|
|||
ATOM_TRANSMITTER_ACTION_POWER_ON);
|
||||
radeon_dig_connector->edp_on = true;
|
||||
}
|
||||
dp_link_train(encoder, connector);
|
||||
if (ASIC_IS_DCE4(rdev))
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF, 0);
|
||||
radeon_dp_link_train(encoder, connector);
|
||||
if (ASIC_IS_DCE4(rdev))
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
|
||||
}
|
||||
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0);
|
||||
|
@ -1322,7 +1460,7 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
|
|||
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
|
||||
|
||||
if (ASIC_IS_DCE4(rdev))
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF, 0);
|
||||
if (connector &&
|
||||
(connector->connector_type == DRM_MODE_CONNECTOR_eDP)) {
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
|
@ -1601,12 +1739,9 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder)
|
|||
/* DCE4/5 */
|
||||
if (ASIC_IS_DCE4(rdev)) {
|
||||
dig = radeon_encoder->enc_priv;
|
||||
if (ASIC_IS_DCE41(rdev)) {
|
||||
if (dig->linkb)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
} else {
|
||||
if (ASIC_IS_DCE41(rdev))
|
||||
return radeon_crtc->crtc_id;
|
||||
else {
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
|
||||
if (dig->linkb)
|
||||
|
@ -1662,6 +1797,34 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* This only needs to be called once at startup */
|
||||
void
|
||||
radeon_atom_encoder_init(struct radeon_device *rdev)
|
||||
{
|
||||
struct drm_device *dev = rdev->ddev;
|
||||
struct drm_encoder *encoder;
|
||||
|
||||
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
|
||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct drm_encoder *ext_encoder = radeon_atom_get_external_encoder(encoder);
|
||||
|
||||
switch (radeon_encoder->encoder_id) {
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA:
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_INIT, 0, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (ext_encoder && ASIC_IS_DCE41(rdev))
|
||||
atombios_external_encoder_setup(encoder, ext_encoder,
|
||||
EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *mode,
|
||||
|
@ -1696,19 +1859,17 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
|
|||
/* disable the transmitter */
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
|
||||
/* setup and enable the encoder */
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_SETUP, 0);
|
||||
|
||||
/* init and enable the transmitter */
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_INIT, 0, 0);
|
||||
/* enable the transmitter */
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
|
||||
} else {
|
||||
/* disable the encoder and transmitter */
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_DISABLE);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_DISABLE, 0);
|
||||
|
||||
/* setup and enable the encoder and transmitter */
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENABLE);
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_INIT, 0, 0);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
|
||||
}
|
||||
|
@ -1733,12 +1894,10 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
|
|||
}
|
||||
|
||||
if (ext_encoder) {
|
||||
if (ASIC_IS_DCE41(rdev)) {
|
||||
atombios_external_encoder_setup(encoder, ext_encoder,
|
||||
EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT);
|
||||
if (ASIC_IS_DCE41(rdev))
|
||||
atombios_external_encoder_setup(encoder, ext_encoder,
|
||||
EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
|
||||
} else
|
||||
else
|
||||
atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE);
|
||||
}
|
||||
|
||||
|
@ -1845,8 +2004,9 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder)
|
|||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
|
||||
|
||||
if (radeon_encoder->active_device &
|
||||
(ATOM_DEVICE_DFP_SUPPORT | ATOM_DEVICE_LCD_SUPPORT)) {
|
||||
if ((radeon_encoder->active_device &
|
||||
(ATOM_DEVICE_DFP_SUPPORT | ATOM_DEVICE_LCD_SUPPORT)) ||
|
||||
radeon_encoder_is_dp_bridge(encoder)) {
|
||||
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
|
||||
if (dig)
|
||||
dig->dig_encoder = radeon_atom_pick_dig_encoder(encoder);
|
||||
|
@ -1855,11 +2015,17 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder)
|
|||
radeon_atom_output_lock(encoder, true);
|
||||
radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
|
||||
|
||||
/* select the clock/data port if it uses a router */
|
||||
if (connector) {
|
||||
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
|
||||
|
||||
/* select the clock/data port if it uses a router */
|
||||
if (radeon_connector->router.cd_valid)
|
||||
radeon_router_select_cd_port(radeon_connector);
|
||||
|
||||
/* turn eDP panel on for mode set */
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
|
||||
atombios_set_edp_panel_power(connector,
|
||||
ATOM_TRANSMITTER_ACTION_POWER_ON);
|
||||
}
|
||||
|
||||
/* this is needed for the pll/ss setup to work correctly in some cases */
|
||||
|
@ -1914,7 +2080,7 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder)
|
|||
else {
|
||||
/* disable the encoder and transmitter */
|
||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_DISABLE);
|
||||
atombios_dig_encoder_setup(encoder, ATOM_DISABLE, 0);
|
||||
}
|
||||
break;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_DDI:
|
||||
|
|
|
@ -464,22 +464,27 @@ radeon_atombios_get_tv_info(struct radeon_device *rdev);
|
|||
extern struct drm_connector *
|
||||
radeon_get_connector_for_encoder(struct drm_encoder *encoder);
|
||||
|
||||
extern bool radeon_encoder_is_dp_bridge(struct drm_encoder *encoder);
|
||||
extern bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector);
|
||||
extern bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector);
|
||||
extern bool radeon_connector_is_dp12_capable(struct drm_connector *connector);
|
||||
|
||||
extern void radeon_connector_hotplug(struct drm_connector *connector);
|
||||
extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector);
|
||||
extern int radeon_dp_mode_valid_helper(struct radeon_connector *radeon_connector,
|
||||
extern int radeon_dp_mode_valid_helper(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode);
|
||||
extern void radeon_dp_set_link_config(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode);
|
||||
extern void dp_link_train(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector);
|
||||
extern void radeon_dp_link_train(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector);
|
||||
extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
|
||||
extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
|
||||
extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action);
|
||||
extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode);
|
||||
extern void radeon_atom_encoder_init(struct radeon_device *rdev);
|
||||
extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder,
|
||||
int action, uint8_t lane_num,
|
||||
uint8_t lane_set);
|
||||
extern int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
|
||||
uint8_t write_byte, uint8_t *read_byte);
|
||||
u8 write_byte, u8 *read_byte);
|
||||
|
||||
extern void radeon_i2c_init(struct radeon_device *rdev);
|
||||
extern void radeon_i2c_fini(struct radeon_device *rdev);
|
||||
|
@ -545,7 +550,7 @@ struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, i
|
|||
extern void atombios_dvo_setup(struct drm_encoder *encoder, int action);
|
||||
extern void atombios_digital_setup(struct drm_encoder *encoder, int action);
|
||||
extern int atombios_get_encoder_mode(struct drm_encoder *encoder);
|
||||
extern void atombios_set_edp_panel_power(struct drm_connector *connector, int action);
|
||||
extern bool atombios_set_edp_panel_power(struct drm_connector *connector, int action);
|
||||
extern void radeon_encoder_set_active_device(struct drm_encoder *encoder);
|
||||
|
||||
extern void radeon_crtc_load_lut(struct drm_crtc *crtc);
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
|
||||
#define DP_MAX_LANE_COUNT 0x002
|
||||
# define DP_MAX_LANE_COUNT_MASK 0x1f
|
||||
# define DP_TPS3_SUPPORTED (1 << 6)
|
||||
# define DP_ENHANCED_FRAME_CAP (1 << 7)
|
||||
|
||||
#define DP_MAX_DOWNSPREAD 0x003
|
||||
|
@ -71,10 +72,13 @@
|
|||
|
||||
#define DP_MAIN_LINK_CHANNEL_CODING 0x006
|
||||
|
||||
#define DP_TRAINING_AUX_RD_INTERVAL 0x00e
|
||||
|
||||
/* link configuration */
|
||||
#define DP_LINK_BW_SET 0x100
|
||||
# define DP_LINK_BW_1_62 0x06
|
||||
# define DP_LINK_BW_2_7 0x0a
|
||||
# define DP_LINK_BW_5_4 0x14
|
||||
|
||||
#define DP_LANE_COUNT_SET 0x101
|
||||
# define DP_LANE_COUNT_MASK 0x0f
|
||||
|
@ -84,6 +88,7 @@
|
|||
# define DP_TRAINING_PATTERN_DISABLE 0
|
||||
# define DP_TRAINING_PATTERN_1 1
|
||||
# define DP_TRAINING_PATTERN_2 2
|
||||
# define DP_TRAINING_PATTERN_3 3
|
||||
# define DP_TRAINING_PATTERN_MASK 0x3
|
||||
|
||||
# define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user