radeon_hd: Add missing load detection on DIG encoders

This commit is contained in:
Alexander von Gluck IV 2012-03-13 05:09:13 -05:00
parent 32ef94aa91
commit 119cd5e1c1
2 changed files with 56 additions and 0 deletions

View File

@ -904,6 +904,20 @@ encoder_analog_load_detect(uint32 connectorIndex)
{
TRACE("%s\n", __func__);
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
if (encoder_is_external(encoderID))
return encoder_dig_load_detect(connectorIndex);
return encoder_dac_load_detect(connectorIndex);
}
bool
encoder_dac_load_detect(uint32 connectorIndex)
{
TRACE("%s\n", __func__);
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
@ -994,6 +1008,46 @@ encoder_analog_load_detect(uint32 connectorIndex)
}
bool
encoder_dig_load_detect(uint32 connectorIndex)
{
TRACE("%s\n", __func__);
radeon_shared_info &info = *gInfo->shared_info;
if (info.dceMajor < 4) {
ERROR("%s: Strange: External DIG encoder on DCE < 4?\n", __func__);
return false;
}
encoder_external_setup(connectorIndex, 0,
EXTERNAL_ENCODER_ACTION_V3_DACLOAD_DETECTION);
uint32 biosScratch0 = Read32(OUT, R600_BIOS_0_SCRATCH);
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
if ((encoderFlags & ATOM_DEVICE_CRT1_SUPPORT) != 0)
if ((biosScratch0 & ATOM_S0_CRT1_MASK) != 0)
return true;
if ((encoderFlags & ATOM_DEVICE_CRT2_SUPPORT) != 0)
if ((biosScratch0 & ATOM_S0_CRT2_MASK) != 0)
return true;
if ((encoderFlags & ATOM_DEVICE_CV_SUPPORT) != 0)
if ((biosScratch0 & (ATOM_S0_CV_MASK | ATOM_S0_CV_MASK_A)) != 0)
return true;
if ((encoderFlags & ATOM_DEVICE_TV1_SUPPORT) != 0) {
if ((biosScratch0
& (ATOM_S0_TV1_COMPOSITE | ATOM_S0_TV1_COMPOSITE_A)) != 0)
return true; /* Composite connected */
else if ((biosScratch0
& (ATOM_S0_TV1_SVIDEO | ATOM_S0_TV1_SVIDEO_A)) != 0)
return true; /* S-Video connected */
}
return false;
}
status_t
transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
uint8 laneNumber, uint8 laneSet, int command)

View File

@ -30,6 +30,8 @@ status_t encoder_tv_setup(uint32 connectorIndex,
uint32 pixelClock, int command);
bool encoder_analog_load_detect(uint32 connectorIndex);
bool encoder_dac_load_detect(uint32 connectorIndex);
bool encoder_dig_load_detect(uint32 connectorIndex);
void encoder_output_lock(bool lock);
status_t transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
uint8 laneNumber, uint8 laneSet, int command);