More work towards DP support.
* add DPBridge encoder flag and set during connector detection * if external bridge found, do external DDC setup * pass connectorIndex vs displayIndex to encoder_*_setup * some of the DP AUX channel stuff should go into accelerant common code some day like i2c.
This commit is contained in:
@@ -134,6 +134,7 @@ struct encoder_info {
|
||||
uint32 type;
|
||||
uint32 flags;
|
||||
bool isExternal;
|
||||
bool isDPBridge;
|
||||
bool isHDMI;
|
||||
bool isTV;
|
||||
struct pll_info pll;
|
||||
|
||||
@@ -914,6 +914,8 @@ connector_probe()
|
||||
= encoderType;
|
||||
gConnector[connectorIndex]->encoder.isExternal
|
||||
= encoder_is_external(encoderID);
|
||||
gConnector[connectorIndex]->encoder.isDPBridge
|
||||
= encoder_is_dp_bridge(encoderID);
|
||||
|
||||
pll_limit_probe(
|
||||
&gConnector[connectorIndex]->encoder.pll);
|
||||
@@ -995,6 +997,12 @@ connector_probe()
|
||||
break;
|
||||
}
|
||||
|
||||
if (gConnector[connectorIndex]->encoder.isDPBridge == true) {
|
||||
TRACE("%s: is bridge, performing bridge DDC setup\n", __func__);
|
||||
encoder_external_setup(connectorIndex, 0,
|
||||
EXTERNAL_ENCODER_ACTION_V3_DDC_SETUP);
|
||||
}
|
||||
|
||||
connectorIndex++;
|
||||
} // END for each valid connector
|
||||
} // end for each display path
|
||||
|
||||
@@ -206,19 +206,20 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_DAC2:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2:
|
||||
encoder_analog_setup(id, pixelClock, ATOM_ENABLE);
|
||||
encoder_analog_setup(connectorIndex, pixelClock, ATOM_ENABLE);
|
||||
if ((encoderFlags
|
||||
& (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) != 0) {
|
||||
encoder_tv_setup(id, pixelClock, ATOM_ENABLE);
|
||||
encoder_tv_setup(connectorIndex, pixelClock, ATOM_ENABLE);
|
||||
} else {
|
||||
encoder_tv_setup(id, pixelClock, ATOM_DISABLE);
|
||||
encoder_tv_setup(connectorIndex, pixelClock, ATOM_DISABLE);
|
||||
}
|
||||
break;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_LVTM1:
|
||||
encoder_digital_setup(id, pixelClock, PANEL_ENCODER_ACTION_ENABLE);
|
||||
encoder_digital_setup(connectorIndex, pixelClock,
|
||||
PANEL_ENCODER_ACTION_ENABLE);
|
||||
break;
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
|
||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
|
||||
@@ -228,7 +229,8 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
||||
//atombios_dig_transmitter_setup(encoder,
|
||||
// ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
|
||||
// TODO: Disable the dig transmitter
|
||||
encoder_dig_setup(id, pixelClock, ATOM_ENCODER_CMD_SETUP);
|
||||
encoder_dig_setup(connectorIndex, pixelClock,
|
||||
ATOM_ENCODER_CMD_SETUP);
|
||||
// Setup and enable the dig encoder
|
||||
|
||||
//atombios_dig_transmitter_setup(encoder,
|
||||
@@ -238,11 +240,11 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
||||
//atombios_dig_transmitter_setup(encoder,
|
||||
// ATOM_TRANSMITTER_ACTION_DISABLE, 0, 0);
|
||||
// Disable the dig transmitter
|
||||
encoder_dig_setup(id, pixelClock, ATOM_DISABLE);
|
||||
encoder_dig_setup(connectorIndex, pixelClock, ATOM_DISABLE);
|
||||
// Disable the dig encoder
|
||||
|
||||
/* setup and enable the encoder and transmitter */
|
||||
encoder_dig_setup(id, pixelClock, ATOM_ENABLE);
|
||||
encoder_dig_setup(connectorIndex, pixelClock, ATOM_ENABLE);
|
||||
// Setup and enable the dig encoder
|
||||
|
||||
//atombios_dig_transmitter_setup(encoder,
|
||||
@@ -275,10 +277,10 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
||||
case ENCODER_OBJECT_ID_VT1623:
|
||||
case ENCODER_OBJECT_ID_HDMI_SI1930:
|
||||
if (info.dceMajor >= 4 && info.dceMinor >= 1) {
|
||||
encoder_external_setup(id, pixelClock,
|
||||
encoder_external_setup(connectorIndex, pixelClock,
|
||||
EXTERNAL_ENCODER_ACTION_V3_ENCODER_SETUP);
|
||||
} else {
|
||||
encoder_external_setup(id, pixelClock,
|
||||
encoder_external_setup(connectorIndex, pixelClock,
|
||||
ATOM_ENABLE);
|
||||
}
|
||||
break;
|
||||
@@ -291,9 +293,8 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
||||
|
||||
|
||||
status_t
|
||||
encoder_tv_setup(uint8 id, uint32 pixelClock, int command)
|
||||
encoder_tv_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
||||
{
|
||||
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
||||
uint16 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||
|
||||
TV_ENCODER_CONTROL_PS_ALLOCATION args;
|
||||
@@ -323,12 +324,10 @@ union lvds_encoder_control {
|
||||
|
||||
|
||||
status_t
|
||||
encoder_digital_setup(uint8 id, uint32 pixelClock, int command)
|
||||
encoder_digital_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
||||
{
|
||||
TRACE("%s\n", __func__);
|
||||
|
||||
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
||||
|
||||
union lvds_encoder_control args;
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
||||
@@ -455,11 +454,10 @@ union dig_encoder_control {
|
||||
|
||||
|
||||
status_t
|
||||
encoder_dig_setup(uint8 id, uint32 pixelClock, int command)
|
||||
encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
||||
{
|
||||
radeon_shared_info &info = *gInfo->shared_info;
|
||||
|
||||
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
||||
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||
|
||||
union dig_encoder_control args;
|
||||
@@ -612,7 +610,7 @@ union external_encoder_control {
|
||||
|
||||
|
||||
status_t
|
||||
encoder_external_setup(uint8 id, uint32 pixelClock, int command)
|
||||
encoder_external_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
||||
{
|
||||
TRACE("%s\n", __func__);
|
||||
|
||||
@@ -620,7 +618,6 @@ encoder_external_setup(uint8 id, uint32 pixelClock, int command)
|
||||
union external_encoder_control args;
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
||||
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
||||
int connectorObjectID
|
||||
= (gConnector[connectorIndex]->objectID & OBJECT_ID_MASK)
|
||||
>> OBJECT_ID_SHIFT;
|
||||
@@ -764,12 +761,10 @@ encoder_external_setup(uint8 id, uint32 pixelClock, int command)
|
||||
|
||||
|
||||
status_t
|
||||
encoder_analog_setup(uint8 id, uint32 pixelClock, int command)
|
||||
encoder_analog_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
||||
{
|
||||
TRACE("%s\n", __func__);
|
||||
|
||||
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
||||
|
||||
int index = 0;
|
||||
DAC_ENCODER_CONTROL_PS_ALLOCATION args;
|
||||
memset(&args, 0, sizeof(args));
|
||||
@@ -797,7 +792,7 @@ encoder_analog_setup(uint8 id, uint32 pixelClock, int command)
|
||||
|
||||
|
||||
bool
|
||||
encoder_analog_load_detect(uint8 connectorIndex)
|
||||
encoder_analog_load_detect(uint32 connectorIndex)
|
||||
{
|
||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||
|
||||
@@ -9,15 +9,21 @@
|
||||
#define RADEON_HD_ENCODER_H
|
||||
|
||||
|
||||
void encoder_assign_crtc(uint8 crt_id);
|
||||
void encoder_assign_crtc(uint8 crtID);
|
||||
void encoder_apply_quirks(uint8 crtcID);
|
||||
void encoder_mode_set(uint8 id, uint32 pixelClock);
|
||||
status_t encoder_analog_setup(uint8 id, uint32 pixelClock, int command);
|
||||
status_t encoder_digital_setup(uint8 id, uint32 pixelClock, int command);
|
||||
status_t encoder_dig_setup(uint8 id, uint32 pixelClock, int command);
|
||||
status_t encoder_external_setup(uint8 id, uint32 pixelClock, int command);
|
||||
status_t encoder_tv_setup(uint8 id, uint32 pixelClock, int command);
|
||||
bool encoder_analog_load_detect(uint8 connectorIndex);
|
||||
status_t encoder_analog_setup(uint32 connectorIndex,
|
||||
uint32 pixelClock, int command);
|
||||
status_t encoder_digital_setup(uint32 connectorIndex,
|
||||
uint32 pixelClock, int command);
|
||||
status_t encoder_dig_setup(uint32 connectorIndex,
|
||||
uint32 pixelClock, int command);
|
||||
status_t encoder_external_setup(uint32 connectorIndex,
|
||||
uint32 pixelClock, int command);
|
||||
status_t encoder_tv_setup(uint32 connectorIndex,
|
||||
uint32 pixelClock, int command);
|
||||
|
||||
bool encoder_analog_load_detect(uint32 connectorIndex);
|
||||
void encoder_output_lock(bool lock);
|
||||
void encoder_crtc_scratch(uint8 crtcID);
|
||||
void encoder_dpms_scratch(uint8 crtcID, bool power);
|
||||
|
||||
Reference in New Issue
Block a user