Revert "radeon_hd: Convert encoders to pointers"
This reverts commit 5a1f9f0f16.
* Thinking on this a bit more, this is really a silly change as
I know the upper limit for number of valid encoders.
* Resolves a app_server crash introduced as well due to not
allocating encoder pointer.
This commit is contained in:
@@ -168,7 +168,7 @@ typedef struct {
|
|||||||
uint32 flags;
|
uint32 flags;
|
||||||
uint32 lvdsFlags;
|
uint32 lvdsFlags;
|
||||||
uint16 gpioID;
|
uint16 gpioID;
|
||||||
encoder_info* encoder;
|
struct encoder_info encoder;
|
||||||
// TODO struct radeon_hpd hpd;
|
// TODO struct radeon_hpd hpd;
|
||||||
} connector_info;
|
} connector_info;
|
||||||
|
|
||||||
|
|||||||
@@ -439,18 +439,18 @@ connector_probe_legacy()
|
|||||||
uint32 encoderObject = encoder_object_lookup((1 << i), dac);
|
uint32 encoderObject = encoder_object_lookup((1 << i), dac);
|
||||||
uint32 encoderID = (encoderObject & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
|
uint32 encoderID = (encoderObject & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
|
||||||
|
|
||||||
encoder_info* encoder = gConnector[connectorIndex]->encoder;
|
|
||||||
|
|
||||||
gConnector[connectorIndex]->valid = true;
|
gConnector[connectorIndex]->valid = true;
|
||||||
encoder->flags = (1 << i);
|
gConnector[connectorIndex]->encoder.flags = (1 << i);
|
||||||
encoder->valid = true;
|
gConnector[connectorIndex]->encoder.valid = true;
|
||||||
encoder->objectID = encoderID;
|
gConnector[connectorIndex]->encoder.objectID = encoderID;
|
||||||
encoder->type = encoder_type_lookup(encoderID, (1 << i));
|
gConnector[connectorIndex]->encoder.type
|
||||||
encoder->isExternal = encoder_is_external(encoderID);
|
= encoder_type_lookup(encoderID, (1 << i));
|
||||||
|
gConnector[connectorIndex]->encoder.isExternal
|
||||||
|
= encoder_is_external(encoderID);
|
||||||
|
|
||||||
connector_attach_gpio(connectorIndex, ci.sucI2cId.ucAccess);
|
connector_attach_gpio(connectorIndex, ci.sucI2cId.ucAccess);
|
||||||
|
|
||||||
pll_limit_probe(&encoder->pll);
|
pll_limit_probe(&gConnector[connectorIndex]->encoder.pll);
|
||||||
|
|
||||||
connectorIndex++;
|
connectorIndex++;
|
||||||
}
|
}
|
||||||
@@ -579,14 +579,12 @@ connector_probe()
|
|||||||
// = (B_LENDIAN_TO_HOST_INT16(path->usGraphicObjIds[j]) &
|
// = (B_LENDIAN_TO_HOST_INT16(path->usGraphicObjIds[j]) &
|
||||||
// ENUM_ID_MASK) >> ENUM_ID_SHIFT;
|
// ENUM_ID_MASK) >> ENUM_ID_SHIFT;
|
||||||
uint8 graphicObjectType
|
uint8 graphicObjectType
|
||||||
= (B_LENDIAN_TO_HOST_INT16(path->usGraphicObjIds[j])
|
= (B_LENDIAN_TO_HOST_INT16(path->usGraphicObjIds[j]) &
|
||||||
& OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
|
OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
|
||||||
|
|
||||||
if (graphicObjectType == GRAPH_OBJECT_TYPE_ENCODER) {
|
if (graphicObjectType == GRAPH_OBJECT_TYPE_ENCODER) {
|
||||||
// Found an encoder
|
// Found an encoder
|
||||||
// TODO: it may be possible to have more then one encoder
|
// TODO: it may be possible to have more then one encoder
|
||||||
encoder_info* encoder = connector->encoder;
|
|
||||||
|
|
||||||
int32 k;
|
int32 k;
|
||||||
for (k = 0; k < encoderObject->ucNumberOfObjects; k++) {
|
for (k = 0; k < encoderObject->ucNumberOfObjects; k++) {
|
||||||
uint16 encoderObjectRaw
|
uint16 encoderObjectRaw
|
||||||
@@ -631,19 +629,20 @@ connector_probe()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
encoder->valid = true;
|
// Set up found connector
|
||||||
encoder->flags = connectorFlags;
|
connector->encoder.valid = true;
|
||||||
encoder->objectID = encoderID;
|
connector->encoder.flags = connectorFlags;
|
||||||
encoder->type = encoderType;
|
connector->encoder.objectID = encoderID;
|
||||||
encoder->linkEnumeration
|
connector->encoder.type = encoderType;
|
||||||
|
connector->encoder.linkEnumeration
|
||||||
= (encoderObjectRaw & ENUM_ID_MASK)
|
= (encoderObjectRaw & ENUM_ID_MASK)
|
||||||
>> ENUM_ID_SHIFT;
|
>> ENUM_ID_SHIFT;
|
||||||
encoder->isExternal
|
connector->encoder.isExternal
|
||||||
= encoder_is_external(encoderID);
|
= encoder_is_external(encoderID);
|
||||||
encoder->isDPBridge
|
connector->encoder.isDPBridge
|
||||||
= encoder_is_dp_bridge(encoderID);
|
= encoder_is_dp_bridge(encoderID);
|
||||||
|
|
||||||
pll_limit_probe(&encoder->pll);
|
pll_limit_probe(&connector->encoder.pll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// END if object is encoder
|
// END if object is encoder
|
||||||
@@ -702,18 +701,18 @@ connector_probe()
|
|||||||
connector->type = connectorType;
|
connector->type = connectorType;
|
||||||
connector->objectID = connectorObjectID;
|
connector->objectID = connectorObjectID;
|
||||||
|
|
||||||
connector->encoder->isTV = false;
|
connector->encoder.isTV = false;
|
||||||
connector->encoder->isHDMI = false;
|
connector->encoder.isHDMI = false;
|
||||||
|
|
||||||
switch (connectorType) {
|
switch (connectorType) {
|
||||||
case VIDEO_CONNECTOR_COMPOSITE:
|
case VIDEO_CONNECTOR_COMPOSITE:
|
||||||
case VIDEO_CONNECTOR_SVIDEO:
|
case VIDEO_CONNECTOR_SVIDEO:
|
||||||
case VIDEO_CONNECTOR_9DIN:
|
case VIDEO_CONNECTOR_9DIN:
|
||||||
connector->encoder->isTV = true;
|
connector->encoder.isTV = true;
|
||||||
break;
|
break;
|
||||||
case VIDEO_CONNECTOR_HDMIA:
|
case VIDEO_CONNECTOR_HDMIA:
|
||||||
case VIDEO_CONNECTOR_HDMIB:
|
case VIDEO_CONNECTOR_HDMIB:
|
||||||
connector->encoder->isHDMI = true;
|
connector->encoder.isHDMI = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -730,7 +729,7 @@ connector_is_dp(uint32 connectorIndex)
|
|||||||
{
|
{
|
||||||
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_DP
|
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_DP
|
||||||
|| gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP
|
|| gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP
|
||||||
|| gConnector[connectorIndex]->encoder->isDPBridge == true) {
|
|| gConnector[connectorIndex]->encoder.isDPBridge == true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -744,10 +743,9 @@ debug_connectors()
|
|||||||
for (uint32 id = 0; id < ATOM_MAX_SUPPORTED_DEVICE; id++) {
|
for (uint32 id = 0; id < ATOM_MAX_SUPPORTED_DEVICE; id++) {
|
||||||
if (gConnector[id]->valid == true) {
|
if (gConnector[id]->valid == true) {
|
||||||
uint32 connectorType = gConnector[id]->type;
|
uint32 connectorType = gConnector[id]->type;
|
||||||
encoder_info* encoder = gConnector[id]->encoder;
|
uint32 encoderType = gConnector[id]->encoder.type;
|
||||||
uint32 encoderType = encoder->type;
|
uint16 encoderID = gConnector[id]->encoder.objectID;
|
||||||
uint16 encoderID = encoder->objectID;
|
uint32 encoderFlags = gConnector[id]->encoder.flags;
|
||||||
uint32 encoderFlags = encoder->flags;
|
|
||||||
uint16 gpioID = gConnector[id]->gpioID;
|
uint16 gpioID = gConnector[id]->gpioID;
|
||||||
|
|
||||||
ERROR("Connector #%" B_PRIu32 ")\n", id);
|
ERROR("Connector #%" B_PRIu32 ")\n", id);
|
||||||
@@ -762,23 +760,23 @@ debug_connectors()
|
|||||||
ERROR(" - type: %s\n",
|
ERROR(" - type: %s\n",
|
||||||
encoder_name_lookup(encoderID));
|
encoder_name_lookup(encoderID));
|
||||||
ERROR(" - enumeration: %" B_PRIu32 "\n",
|
ERROR(" - enumeration: %" B_PRIu32 "\n",
|
||||||
encoder->linkEnumeration);
|
gConnector[id]->encoder.linkEnumeration);
|
||||||
|
|
||||||
bool attribute = false;
|
bool attribute = false;
|
||||||
ERROR(" - attributes:\n");
|
ERROR(" - attributes:\n");
|
||||||
if (encoder->isExternal == true) {
|
if (gConnector[id]->encoder.isExternal == true) {
|
||||||
attribute = true;
|
attribute = true;
|
||||||
ERROR(" * is external\n");
|
ERROR(" * is external\n");
|
||||||
}
|
}
|
||||||
if (encoder->isHDMI == true) {
|
if (gConnector[id]->encoder.isHDMI == true) {
|
||||||
attribute = true;
|
attribute = true;
|
||||||
ERROR(" * is HDMI\n");
|
ERROR(" * is HDMI\n");
|
||||||
}
|
}
|
||||||
if (encoder->isTV == true) {
|
if (gConnector[id]->encoder.isTV == true) {
|
||||||
attribute = true;
|
attribute = true;
|
||||||
ERROR(" * is TV\n");
|
ERROR(" * is TV\n");
|
||||||
}
|
}
|
||||||
if (encoder->isDPBridge == true) {
|
if (gConnector[id]->encoder.isDPBridge == true) {
|
||||||
attribute = true;
|
attribute = true;
|
||||||
ERROR(" * is DisplayPort bridge\n");
|
ERROR(" * is DisplayPort bridge\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,8 +282,8 @@ detect_displays()
|
|||||||
gDisplay[displayIndex]->attached =
|
gDisplay[displayIndex]->attached =
|
||||||
connector_read_edid(id, &gDisplay[displayIndex]->edid_info);
|
connector_read_edid(id, &gDisplay[displayIndex]->edid_info);
|
||||||
|
|
||||||
if (gConnector[id]->encoder->type == VIDEO_ENCODER_TVDAC
|
if (gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC
|
||||||
|| gConnector[id]->encoder->type == VIDEO_ENCODER_DAC) {
|
|| gConnector[id]->encoder.type == VIDEO_ENCODER_DAC) {
|
||||||
// analog? with valid EDID? lets make sure there is load.
|
// analog? with valid EDID? lets make sure there is load.
|
||||||
// There is only one ddc communications path on DVI-I
|
// There is only one ddc communications path on DVI-I
|
||||||
if (encoder_analog_load_detect(id) != true) {
|
if (encoder_analog_load_detect(id) != true) {
|
||||||
@@ -324,7 +324,7 @@ detect_displays()
|
|||||||
" Injecting first connector as a last resort.\n", __func__);
|
" Injecting first connector as a last resort.\n", __func__);
|
||||||
for (uint32 id = 0; id < ATOM_MAX_SUPPORTED_DEVICE; id++) {
|
for (uint32 id = 0; id < ATOM_MAX_SUPPORTED_DEVICE; id++) {
|
||||||
// skip TV DAC connectors as likely fallback isn't for TV
|
// skip TV DAC connectors as likely fallback isn't for TV
|
||||||
if (gConnector[id]->encoder->type == VIDEO_ENCODER_TVDAC)
|
if (gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC)
|
||||||
continue;
|
continue;
|
||||||
gDisplay[0]->attached = true;
|
gDisplay[0]->attached = true;
|
||||||
gDisplay[0]->connectorIndex = id;
|
gDisplay[0]->connectorIndex = id;
|
||||||
@@ -357,7 +357,7 @@ debug_displays()
|
|||||||
|
|
||||||
if (gDisplay[id]->attached) {
|
if (gDisplay[id]->attached) {
|
||||||
uint32 connectorType = gConnector[connectorIndex]->type;
|
uint32 connectorType = gConnector[connectorIndex]->type;
|
||||||
uint32 encoderType = gConnector[connectorIndex]->encoder->type;
|
uint32 encoderType = gConnector[connectorIndex]->encoder.type;
|
||||||
ERROR(" + connector ID: %" B_PRIu32 "\n", connectorIndex);
|
ERROR(" + connector ID: %" B_PRIu32 "\n", connectorIndex);
|
||||||
ERROR(" + connector type: %s\n", get_connector_name(connectorType));
|
ERROR(" + connector type: %s\n", get_connector_name(connectorType));
|
||||||
ERROR(" + encoder type: %s\n", get_encoder_name(encoderType));
|
ERROR(" + encoder type: %s\n", get_encoder_name(encoderType));
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ dp_aux_set_i2c_byte(uint32 hwPin, uint16 address, uint8* data, bool end)
|
|||||||
uint32
|
uint32
|
||||||
dp_get_link_clock(uint32 connectorIndex)
|
dp_get_link_clock(uint32 connectorIndex)
|
||||||
{
|
{
|
||||||
uint16 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint16 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
|
|
||||||
if (encoderID == ENCODER_OBJECT_ID_NUTMEG)
|
if (encoderID == ENCODER_OBJECT_ID_NUTMEG)
|
||||||
return 270000;
|
return 270000;
|
||||||
@@ -690,7 +690,7 @@ dp_link_train(uint8 crtcID, display_mode* mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 linkEnumeration
|
uint32 linkEnumeration
|
||||||
= gConnector[connectorIndex]->encoder->linkEnumeration;
|
= gConnector[connectorIndex]->encoder.linkEnumeration;
|
||||||
uint32 gpioID = gConnector[connectorIndex]->gpioID;
|
uint32 gpioID = gConnector[connectorIndex]->gpioID;
|
||||||
uint32 hwPin = gGPIOInfo[gpioID]->hwPin;
|
uint32 hwPin = gGPIOInfo[gpioID]->hwPin;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ encoder_init()
|
|||||||
if (gConnector[id]->valid == false)
|
if (gConnector[id]->valid == false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch (gConnector[id]->encoder->objectID) {
|
switch (gConnector[id]->encoder.objectID) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
|
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
|
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
|
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
|
||||||
@@ -56,7 +56,7 @@ encoder_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((info.chipsetFlags & CHIP_APU) != 0
|
if ((info.chipsetFlags & CHIP_APU) != 0
|
||||||
&& gConnector[id]->encoder->isExternal) {
|
&& gConnector[id]->encoder.isExternal) {
|
||||||
encoder_external_setup(id, 0,
|
encoder_external_setup(id, 0,
|
||||||
EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT);
|
EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT);
|
||||||
}
|
}
|
||||||
@@ -79,8 +79,8 @@ encoder_assign_crtc(uint8 crtcID)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
uint16 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint16 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint16 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint16 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
uint16 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint16 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
// Prepare AtomBIOS command arguments
|
// Prepare AtomBIOS command arguments
|
||||||
union crtcSourceParam {
|
union crtcSourceParam {
|
||||||
@@ -215,7 +215,7 @@ encoder_pick_dig(uint32 connectorIndex)
|
|||||||
{
|
{
|
||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
radeon_shared_info &info = *gInfo->shared_info;
|
radeon_shared_info &info = *gInfo->shared_info;
|
||||||
uint32 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
|
|
||||||
// obtain assigned CRT
|
// obtain assigned CRT
|
||||||
uint32 crtcID;
|
uint32 crtcID;
|
||||||
@@ -226,7 +226,7 @@ encoder_pick_dig(uint32 connectorIndex)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool linkB = gConnector[connectorIndex]->encoder->linkEnumeration
|
bool linkB = gConnector[connectorIndex]->encoder.linkEnumeration
|
||||||
== GRAPH_OBJECT_ENUM_ID2 ? true : false;
|
== GRAPH_OBJECT_ENUM_ID2 ? true : false;
|
||||||
|
|
||||||
uint32 dceVersion = (info.dceMajor * 100) + info.dceMinor;
|
uint32 dceVersion = (info.dceMajor * 100) + info.dceMinor;
|
||||||
@@ -268,7 +268,7 @@ encoder_apply_quirks(uint8 crtcID)
|
|||||||
radeon_shared_info &info = *gInfo->shared_info;
|
radeon_shared_info &info = *gInfo->shared_info;
|
||||||
register_info* regs = gDisplay[crtcID]->regs;
|
register_info* regs = gDisplay[crtcID]->regs;
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint16 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint16 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
// Setting the scaler clears this on some chips...
|
// Setting the scaler clears this on some chips...
|
||||||
if (info.dceMajor >= 3
|
if (info.dceMajor >= 3
|
||||||
@@ -286,9 +286,9 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
|||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
radeon_shared_info &info = *gInfo->shared_info;
|
radeon_shared_info &info = *gInfo->shared_info;
|
||||||
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
uint32 connectorIndex = gDisplay[id]->connectorIndex;
|
||||||
uint16 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint16 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
switch (gConnector[connectorIndex]->encoder->objectID) {
|
switch (gConnector[connectorIndex]->encoder.objectID) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
|
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
|
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_DAC2:
|
case ENCODER_OBJECT_ID_INTERNAL_DAC2:
|
||||||
@@ -352,7 +352,7 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gConnector[connectorIndex]->encoder->isExternal == true) {
|
if (gConnector[connectorIndex]->encoder.isExternal == true) {
|
||||||
if ((info.chipsetFlags & CHIP_APU) != 0) {
|
if ((info.chipsetFlags & CHIP_APU) != 0) {
|
||||||
// aka DCE 4.1
|
// aka DCE 4.1
|
||||||
encoder_external_setup(connectorIndex, pixelClock,
|
encoder_external_setup(connectorIndex, pixelClock,
|
||||||
@@ -370,7 +370,7 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
|||||||
status_t
|
status_t
|
||||||
encoder_tv_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
encoder_tv_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
||||||
{
|
{
|
||||||
uint16 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint16 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
TV_ENCODER_CONTROL_PS_ALLOCATION args;
|
TV_ENCODER_CONTROL_PS_ALLOCATION args;
|
||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
@@ -398,9 +398,9 @@ encoder_digital_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
|||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
uint16 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint16 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
switch (gConnector[connectorIndex]->encoder->objectID) {
|
switch (gConnector[connectorIndex]->encoder.objectID) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
||||||
index = GetIndexIntoMasterTable(COMMAND, LVDSEncoderControl);
|
index = GetIndexIntoMasterTable(COMMAND, LVDSEncoderControl);
|
||||||
break;
|
break;
|
||||||
@@ -427,7 +427,7 @@ encoder_digital_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 lvdsFlags = gConnector[connectorIndex]->lvdsFlags;
|
uint32 lvdsFlags = gConnector[connectorIndex]->lvdsFlags;
|
||||||
bool isHdmi = gConnector[connectorIndex]->encoder->isHDMI;
|
bool isHdmi = gConnector[connectorIndex]->encoder.isHDMI;
|
||||||
|
|
||||||
// Prepare AtomBIOS command arguments
|
// Prepare AtomBIOS command arguments
|
||||||
union lvdsEncoderControl {
|
union lvdsEncoderControl {
|
||||||
@@ -560,10 +560,10 @@ encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
|||||||
union digEncoderControl args;
|
union digEncoderControl args;
|
||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
|
|
||||||
uint32 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
bool isDPBridge = gConnector[connectorIndex]->encoder->isDPBridge;
|
bool isDPBridge = gConnector[connectorIndex]->encoder.isDPBridge;
|
||||||
|
|
||||||
bool linkB = gConnector[connectorIndex]->encoder->linkEnumeration
|
bool linkB = gConnector[connectorIndex]->encoder.linkEnumeration
|
||||||
== GRAPH_OBJECT_ENUM_ID2 ? true : false;
|
== GRAPH_OBJECT_ENUM_ID2 ? true : false;
|
||||||
|
|
||||||
// determine DP panel mode
|
// determine DP panel mode
|
||||||
@@ -579,7 +579,7 @@ encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
|||||||
panelMode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
|
panelMode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
uint32 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP) {
|
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP) {
|
||||||
uint8 temp = dpcd_read_reg(hwPin, DP_EDP_CONFIGURATION_CAP);
|
uint8 temp = dpcd_read_reg(hwPin, DP_EDP_CONFIGURATION_CAP);
|
||||||
if ((temp & 1) != 0)
|
if ((temp & 1) != 0)
|
||||||
@@ -786,7 +786,7 @@ encoder_external_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 encoderFlags
|
uint16 encoderFlags
|
||||||
= gConnector[connectorIndex]->encoder->flags;
|
= gConnector[connectorIndex]->encoder.flags;
|
||||||
switch ((encoderFlags & ENUM_ID_MASK) >> ENUM_ID_SHIFT) {
|
switch ((encoderFlags & ENUM_ID_MASK) >> ENUM_ID_SHIFT) {
|
||||||
case GRAPH_OBJECT_ENUM_ID1:
|
case GRAPH_OBJECT_ENUM_ID1:
|
||||||
TRACE("%s: external encoder 1\n", __func__);
|
TRACE("%s: external encoder 1\n", __func__);
|
||||||
@@ -859,13 +859,13 @@ encoder_analog_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
|||||||
{
|
{
|
||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
DAC_ENCODER_CONTROL_PS_ALLOCATION args;
|
DAC_ENCODER_CONTROL_PS_ALLOCATION args;
|
||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
|
|
||||||
switch (gConnector[connectorIndex]->encoder->objectID) {
|
switch (gConnector[connectorIndex]->encoder.objectID) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
|
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
|
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
|
||||||
index = GetIndexIntoMasterTable(COMMAND, DAC1EncoderControl);
|
index = GetIndexIntoMasterTable(COMMAND, DAC1EncoderControl);
|
||||||
@@ -904,7 +904,7 @@ encoder_analog_load_detect(uint32 connectorIndex)
|
|||||||
{
|
{
|
||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
uint32 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
|
|
||||||
if (encoder_is_external(encoderID))
|
if (encoder_is_external(encoderID))
|
||||||
return encoder_dig_load_detect(connectorIndex);
|
return encoder_dig_load_detect(connectorIndex);
|
||||||
@@ -918,8 +918,8 @@ encoder_dac_load_detect(uint32 connectorIndex)
|
|||||||
{
|
{
|
||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
uint32 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
|
|
||||||
if ((encoderFlags & ATOM_DEVICE_TV_SUPPORT) == 0
|
if ((encoderFlags & ATOM_DEVICE_TV_SUPPORT) == 0
|
||||||
&& (encoderFlags & ATOM_DEVICE_CV_SUPPORT) == 0
|
&& (encoderFlags & ATOM_DEVICE_CV_SUPPORT) == 0
|
||||||
@@ -1024,7 +1024,7 @@ encoder_dig_load_detect(uint32 connectorIndex)
|
|||||||
|
|
||||||
uint32 biosScratch0 = Read32(OUT, R600_BIOS_0_SCRATCH);
|
uint32 biosScratch0 = Read32(OUT, R600_BIOS_0_SCRATCH);
|
||||||
|
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
if ((encoderFlags & ATOM_DEVICE_CRT1_SUPPORT) != 0)
|
if ((encoderFlags & ATOM_DEVICE_CRT1_SUPPORT) != 0)
|
||||||
if ((biosScratch0 & ATOM_S0_CRT1_MASK) != 0)
|
if ((biosScratch0 & ATOM_S0_CRT1_MASK) != 0)
|
||||||
@@ -1054,7 +1054,7 @@ transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
|||||||
{
|
{
|
||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
uint16 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint16 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
int index;
|
int index;
|
||||||
switch (encoderID) {
|
switch (encoderID) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1:
|
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1:
|
||||||
@@ -1105,13 +1105,13 @@ transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
|||||||
int connectorObjectID
|
int connectorObjectID
|
||||||
= (gConnector[connectorIndex]->objectID & OBJECT_ID_MASK)
|
= (gConnector[connectorIndex]->objectID & OBJECT_ID_MASK)
|
||||||
>> OBJECT_ID_SHIFT;
|
>> OBJECT_ID_SHIFT;
|
||||||
uint32 encoderObjectID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderObjectID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
uint32 digEncoderID = encoder_pick_dig(connectorIndex);
|
uint32 digEncoderID = encoder_pick_dig(connectorIndex);
|
||||||
|
|
||||||
pll_info* pll = &gConnector[connectorIndex]->encoder->pll;
|
pll_info* pll = &gConnector[connectorIndex]->encoder.pll;
|
||||||
|
|
||||||
bool isDP = connector_is_dp(connectorIndex);
|
bool isDP = connector_is_dp(connectorIndex);
|
||||||
bool linkB = gConnector[connectorIndex]->encoder->linkEnumeration
|
bool linkB = gConnector[connectorIndex]->encoder.linkEnumeration
|
||||||
== GRAPH_OBJECT_ENUM_ID2 ? true : false;
|
== GRAPH_OBJECT_ENUM_ID2 ? true : false;
|
||||||
|
|
||||||
uint8 dpClock = 0;
|
uint8 dpClock = 0;
|
||||||
@@ -1191,7 +1191,7 @@ transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
|||||||
|
|
||||||
if (isDP)
|
if (isDP)
|
||||||
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_COHERENT;
|
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_COHERENT;
|
||||||
else if ((gConnector[connectorIndex]->encoder->flags
|
else if ((gConnector[connectorIndex]->encoder.flags
|
||||||
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
||||||
if (1) {
|
if (1) {
|
||||||
// if coherentMode, i've only ever seen it true
|
// if coherentMode, i've only ever seen it true
|
||||||
@@ -1244,7 +1244,7 @@ transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
|||||||
if (isDP) {
|
if (isDP) {
|
||||||
args.v2.acConfig.fCoherentMode = 1;
|
args.v2.acConfig.fCoherentMode = 1;
|
||||||
args.v2.acConfig.fDPConnector = 1;
|
args.v2.acConfig.fDPConnector = 1;
|
||||||
} else if ((gConnector[connectorIndex]->encoder->flags
|
} else if ((gConnector[connectorIndex]->encoder.flags
|
||||||
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
||||||
if (1) {
|
if (1) {
|
||||||
// if coherentMode, i've only ever seen it true
|
// if coherentMode, i've only ever seen it true
|
||||||
@@ -1311,7 +1311,7 @@ transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
|||||||
|
|
||||||
if (isDP)
|
if (isDP)
|
||||||
args.v3.acConfig.fCoherentMode = 1;
|
args.v3.acConfig.fCoherentMode = 1;
|
||||||
else if ((gConnector[connectorIndex]->encoder->flags
|
else if ((gConnector[connectorIndex]->encoder.flags
|
||||||
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
||||||
if (1) {
|
if (1) {
|
||||||
// if coherentMode, i've only ever seen it true
|
// if coherentMode, i've only ever seen it true
|
||||||
@@ -1382,7 +1382,7 @@ transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
|||||||
|
|
||||||
if (isDP)
|
if (isDP)
|
||||||
args.v4.acConfig.fCoherentMode = 1;
|
args.v4.acConfig.fCoherentMode = 1;
|
||||||
else if ((gConnector[connectorIndex]->encoder->flags
|
else if ((gConnector[connectorIndex]->encoder.flags
|
||||||
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
& ATOM_DEVICE_DFP_SUPPORT) != 0) {
|
||||||
if (1) {
|
if (1) {
|
||||||
// if coherentMode, i've only ever seen it true
|
// if coherentMode, i've only ever seen it true
|
||||||
@@ -1410,7 +1410,7 @@ encoder_crtc_scratch(uint8 crtcID)
|
|||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
// TODO: r500
|
// TODO: r500
|
||||||
uint32 biosScratch3 = Read32(OUT, R600_BIOS_3_SCRATCH);
|
uint32 biosScratch3 = Read32(OUT, R600_BIOS_3_SCRATCH);
|
||||||
@@ -1459,7 +1459,7 @@ encoder_dpms_scratch(uint8 crtcID, bool power)
|
|||||||
TRACE("%s\n", __func__);
|
TRACE("%s\n", __func__);
|
||||||
|
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
// TODO: r500
|
// TODO: r500
|
||||||
uint32 biosScratch2 = Read32(OUT, R600_BIOS_2_SCRATCH);
|
uint32 biosScratch2 = Read32(OUT, R600_BIOS_2_SCRATCH);
|
||||||
@@ -1540,8 +1540,8 @@ encoder_dpms_set(uint8 crtcID, int mode)
|
|||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
|
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
uint16 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint16 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
|
|
||||||
switch (encoderID) {
|
switch (encoderID) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
|
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
|
||||||
@@ -1637,8 +1637,8 @@ encoder_dpms_set_dig(uint8 crtcID, int mode)
|
|||||||
|
|
||||||
radeon_shared_info &info = *gInfo->shared_info;
|
radeon_shared_info &info = *gInfo->shared_info;
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
pll_info* pll = &gConnector[connectorIndex]->encoder->pll;
|
pll_info* pll = &gConnector[connectorIndex]->encoder.pll;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case B_DPMS_ON:
|
case B_DPMS_ON:
|
||||||
@@ -1713,7 +1713,7 @@ encoder_dpms_set_external(uint8 crtcID, int mode)
|
|||||||
|
|
||||||
radeon_shared_info &info = *gInfo->shared_info;
|
radeon_shared_info &info = *gInfo->shared_info;
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
pll_info* pll = &gConnector[connectorIndex]->encoder->pll;
|
pll_info* pll = &gConnector[connectorIndex]->encoder.pll;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case B_DPMS_ON:
|
case B_DPMS_ON:
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ pll_setup_flags(pll_info* pll, uint8 crtcID)
|
|||||||
{
|
{
|
||||||
radeon_shared_info &info = *gInfo->shared_info;
|
radeon_shared_info &info = *gInfo->shared_info;
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
|
|
||||||
if ((info.dceMajor >= 3 && info.dceMinor >= 2)
|
if ((info.dceMajor >= 3 && info.dceMinor >= 2)
|
||||||
&& pll->pixelClock > 200000) {
|
&& pll->pixelClock > 200000) {
|
||||||
@@ -342,10 +342,10 @@ pll_adjust(pll_info* pll, uint8 crtcID)
|
|||||||
// original as pixel_clock will be adjusted
|
// original as pixel_clock will be adjusted
|
||||||
|
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
uint32 encoderID = gConnector[connectorIndex]->encoder->objectID;
|
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID;
|
||||||
uint32 encoderMode = display_get_encoder_mode(connectorIndex);
|
uint32 encoderMode = display_get_encoder_mode(connectorIndex);
|
||||||
uint32 encoderFlags = gConnector[connectorIndex]->encoder->flags;
|
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags;
|
||||||
bool dpBridge = gConnector[connectorIndex]->encoder->isDPBridge;
|
bool dpBridge = gConnector[connectorIndex]->encoder.isDPBridge;
|
||||||
|
|
||||||
if (info.dceMajor >= 3) {
|
if (info.dceMajor >= 3) {
|
||||||
|
|
||||||
@@ -481,7 +481,7 @@ status_t
|
|||||||
pll_set(uint8 pllID, uint32 pixelClock, uint8 crtcID)
|
pll_set(uint8 pllID, uint32 pixelClock, uint8 crtcID)
|
||||||
{
|
{
|
||||||
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
|
||||||
pll_info* pll = &gConnector[connectorIndex]->encoder->pll;
|
pll_info* pll = &gConnector[connectorIndex]->encoder.pll;
|
||||||
|
|
||||||
pll->pixelClock = pixelClock;
|
pll->pixelClock = pixelClock;
|
||||||
pll->id = pllID;
|
pll->id = pllID;
|
||||||
@@ -553,7 +553,7 @@ pll_set(uint8 pllID, uint32 pixelClock, uint8 crtcID)
|
|||||||
// if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
|
// if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
|
||||||
// args.v3.ucMiscInfo |= PIXEL_CLOCK_MISC_REF_DIV_SRC;
|
// args.v3.ucMiscInfo |= PIXEL_CLOCK_MISC_REF_DIV_SRC;
|
||||||
args.v3.ucTransmitterId
|
args.v3.ucTransmitterId
|
||||||
= gConnector[connectorIndex]->encoder->objectID;
|
= gConnector[connectorIndex]->encoder.objectID;
|
||||||
args.v3.ucEncoderMode = display_get_encoder_mode(connectorIndex);
|
args.v3.ucEncoderMode = display_get_encoder_mode(connectorIndex);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
@@ -578,7 +578,7 @@ pll_set(uint8 pllID, uint32 pixelClock, uint8 crtcID)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
args.v5.ucTransmitterID
|
args.v5.ucTransmitterID
|
||||||
= gConnector[connectorIndex]->encoder->objectID;
|
= gConnector[connectorIndex]->encoder.objectID;
|
||||||
args.v5.ucEncoderMode
|
args.v5.ucEncoderMode
|
||||||
= display_get_encoder_mode(connectorIndex);
|
= display_get_encoder_mode(connectorIndex);
|
||||||
args.v5.ucPpll = pllID;
|
args.v5.ucPpll = pllID;
|
||||||
@@ -610,7 +610,7 @@ pll_set(uint8 pllID, uint32 pixelClock, uint8 crtcID)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
args.v6.ucTransmitterID
|
args.v6.ucTransmitterID
|
||||||
= gConnector[connectorIndex]->encoder->objectID;
|
= gConnector[connectorIndex]->encoder.objectID;
|
||||||
args.v6.ucEncoderMode = display_get_encoder_mode(connectorIndex);
|
args.v6.ucEncoderMode = display_get_encoder_mode(connectorIndex);
|
||||||
args.v6.ucPpll = pllID;
|
args.v6.ucPpll = pllID;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user