* move encoder info into own struct
* rename some connector / encoder struct members * improve debugging in connector / encoder AtomBIOS walking git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42815 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -164,15 +164,24 @@ typedef struct {
|
|||||||
} gpio_info;
|
} gpio_info;
|
||||||
|
|
||||||
|
|
||||||
|
struct encoder_info {
|
||||||
|
bool valid;
|
||||||
|
uint32 type;
|
||||||
|
uint16 object_id;
|
||||||
|
uint32 flags;
|
||||||
|
bool is_hdmi;
|
||||||
|
bool is_tv;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool valid;
|
bool valid;
|
||||||
|
uint32 type;
|
||||||
|
uint16 object_id;
|
||||||
|
uint32 flags;
|
||||||
uint16 line_mux;
|
uint16 line_mux;
|
||||||
uint16 connector_flags;
|
uint16 gpio_id;
|
||||||
uint32 connector_type;
|
struct encoder_info encoder;
|
||||||
uint16 connector_object_id;
|
|
||||||
uint16 connector_gpio_id;
|
|
||||||
uint32 encoder_type;
|
|
||||||
uint16 encoder_object_id;
|
|
||||||
// TODO struct radeon_hpd hpd;
|
// TODO struct radeon_hpd hpd;
|
||||||
} connector_info;
|
} connector_info;
|
||||||
|
|
||||||
|
|||||||
@@ -267,11 +267,11 @@ detect_connectors_legacy()
|
|||||||
ATOM_CONNECTOR_INFO_I2C ci
|
ATOM_CONNECTOR_INFO_I2C ci
|
||||||
= supported_devices->info.asConnInfo[i];
|
= supported_devices->info.asConnInfo[i];
|
||||||
|
|
||||||
gConnector[i]->connector_type
|
gConnector[i]->type
|
||||||
= connector_convert_legacy[
|
= connector_convert_legacy[
|
||||||
ci.sucConnectorInfo.sbfAccess.bfConnectorType];
|
ci.sucConnectorInfo.sbfAccess.bfConnectorType];
|
||||||
|
|
||||||
if (gConnector[i]->connector_type == VIDEO_CONNECTOR_UNKNOWN) {
|
if (gConnector[i]->type == VIDEO_CONNECTOR_UNKNOWN) {
|
||||||
TRACE("%s: skipping unknown connector at %" B_PRId32
|
TRACE("%s: skipping unknown connector at %" B_PRId32
|
||||||
" of 0x%" B_PRIX8 "\n", __func__, i,
|
" of 0x%" B_PRIX8 "\n", __func__, i,
|
||||||
ci.sucConnectorInfo.sbfAccess.bfConnectorType);
|
ci.sucConnectorInfo.sbfAccess.bfConnectorType);
|
||||||
@@ -287,10 +287,10 @@ detect_connectors_legacy()
|
|||||||
// Always set CRT1 and CRT2 as VGA, some cards incorrectly set
|
// Always set CRT1 and CRT2 as VGA, some cards incorrectly set
|
||||||
// VGA ports as DVI
|
// VGA ports as DVI
|
||||||
if (i == ATOM_DEVICE_CRT1_INDEX || i == ATOM_DEVICE_CRT2_INDEX)
|
if (i == ATOM_DEVICE_CRT1_INDEX || i == ATOM_DEVICE_CRT2_INDEX)
|
||||||
gConnector[i]->connector_type = VIDEO_CONNECTOR_VGA;
|
gConnector[i]->type = VIDEO_CONNECTOR_VGA;
|
||||||
|
|
||||||
gConnector[i]->valid = true;
|
gConnector[i]->valid = true;
|
||||||
gConnector[i]->connector_flags = (1 << i);
|
gConnector[i]->encoder.flags = (1 << i);
|
||||||
|
|
||||||
// TODO : add the encoder
|
// TODO : add the encoder
|
||||||
#if 0
|
#if 0
|
||||||
@@ -310,7 +310,7 @@ detect_connectors_legacy()
|
|||||||
for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE_INFO; i++) {
|
for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE_INFO; i++) {
|
||||||
if (gConnector[i]->valid == true) {
|
if (gConnector[i]->valid == true) {
|
||||||
TRACE("%s: connector #%" B_PRId32 " is %s\n", __func__, i,
|
TRACE("%s: connector #%" B_PRId32 " is %s\n", __func__, i,
|
||||||
get_connector_name(gConnector[i]->connector_type));
|
get_connector_name(gConnector[i]->type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,13 +410,11 @@ detect_connectors()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (connector_type == VIDEO_CONNECTOR_UNKNOWN) {
|
if (connector_type == VIDEO_CONNECTOR_UNKNOWN) {
|
||||||
TRACE("%s: Path #%" B_PRId32 ": skipping unknown connector.\n",
|
ERROR("%s: Path #%" B_PRId32 ": skipping unknown connector.\n",
|
||||||
__func__, i);
|
__func__, i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 encoder_type = VIDEO_ENCODER_NONE;
|
|
||||||
uint16 encoder_object_id = 0;
|
|
||||||
int32 j;
|
int32 j;
|
||||||
for (j = 0; j < ((B_LENDIAN_TO_HOST_INT16(path->usSize) - 8) / 2);
|
for (j = 0; j < ((B_LENDIAN_TO_HOST_INT16(path->usSize) - 8) / 2);
|
||||||
j++) {
|
j++) {
|
||||||
@@ -464,6 +462,7 @@ detect_connectors()
|
|||||||
uint32 encoder_id = (encoder_obj & OBJECT_ID_MASK)
|
uint32 encoder_id = (encoder_obj & OBJECT_ID_MASK)
|
||||||
>> OBJECT_ID_SHIFT;
|
>> OBJECT_ID_SHIFT;
|
||||||
|
|
||||||
|
uint32 encoder_type = VIDEO_ENCODER_NONE;
|
||||||
switch(encoder_id) {
|
switch(encoder_id) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
|
case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
|
||||||
@@ -525,7 +524,24 @@ detect_connectors()
|
|||||||
// drm_encoder_helper_add
|
// drm_encoder_helper_add
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
encoder_object_id = encoder_id;
|
|
||||||
|
if (encoder_type == VIDEO_ENCODER_NONE) {
|
||||||
|
ERROR("%s: Path #%" B_PRId32 ":"
|
||||||
|
"skipping unknown encoder.\n",
|
||||||
|
__func__, i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up encoder on connector if valid
|
||||||
|
TRACE("%s: Path #%" B_PRId32 ": Found encoder "
|
||||||
|
"%s\n", __func__, i,
|
||||||
|
get_encoder_name(encoder_type));
|
||||||
|
gConnector[connector_index]->encoder.valid
|
||||||
|
= true;
|
||||||
|
gConnector[connector_index]->encoder.object_id
|
||||||
|
= encoder_id;
|
||||||
|
gConnector[connector_index]->encoder.type
|
||||||
|
= encoder_type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (grph_obj_type == GRAPH_OBJECT_TYPE_ROUTER) {
|
} else if (grph_obj_type == GRAPH_OBJECT_TYPE_ROUTER) {
|
||||||
@@ -581,27 +597,13 @@ detect_connectors()
|
|||||||
TRACE("%s: Path #%" B_PRId32 ": Found %s (0x%" B_PRIX32 ")\n",
|
TRACE("%s: Path #%" B_PRId32 ": Found %s (0x%" B_PRIX32 ")\n",
|
||||||
__func__, i, get_connector_name(connector_type),
|
__func__, i, get_connector_name(connector_type),
|
||||||
connector_type);
|
connector_type);
|
||||||
TRACE("%s: Path #%" B_PRId32 ": Found encoder %s\n", __func__,
|
|
||||||
i, get_encoder_name(encoder_type));
|
|
||||||
|
|
||||||
gConnector[connector_index]->valid = true;
|
gConnector[connector_index]->valid = true;
|
||||||
|
gConnector[connector_index]->flags = connector_flags;
|
||||||
gConnector[connector_index]->connector_flags = connector_flags;
|
gConnector[connector_index]->type = connector_type;
|
||||||
gConnector[connector_index]->connector_type = connector_type;
|
gConnector[connector_index]->object_id
|
||||||
gConnector[connector_index]->connector_object_id
|
|
||||||
= connector_object_id;
|
= connector_object_id;
|
||||||
gConnector[connector_index]->encoder_type = encoder_type;
|
|
||||||
gConnector[connector_index]->encoder_object_id = encoder_object_id;
|
|
||||||
connector_index++;
|
connector_index++;
|
||||||
|
|
||||||
// radeon_add_atom_connector(dev,
|
|
||||||
// conn_id,
|
|
||||||
// le16_to_cpu(path-> usDeviceTag),
|
|
||||||
// connector_type, &ddc_bus,
|
|
||||||
// igp_lane_info,
|
|
||||||
// connector_object_id,
|
|
||||||
// &hpd,
|
|
||||||
// &router);
|
|
||||||
}
|
}
|
||||||
} // end for each display path
|
} // end for each display path
|
||||||
|
|
||||||
@@ -645,7 +647,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]->active = true;
|
gDisplay[0]->active = true;
|
||||||
gDisplay[0]->connector_index = id;
|
gDisplay[0]->connector_index = id;
|
||||||
@@ -672,8 +674,8 @@ debug_displays()
|
|||||||
uint32 connector_index = gDisplay[id]->connector_index;
|
uint32 connector_index = gDisplay[id]->connector_index;
|
||||||
|
|
||||||
if (gDisplay[id]->active) {
|
if (gDisplay[id]->active) {
|
||||||
uint32 connector_type = gConnector[connector_index]->connector_type;
|
uint32 connector_type = gConnector[connector_index]->type;
|
||||||
uint32 encoder_type = gConnector[connector_index]->encoder_type;
|
uint32 encoder_type = gConnector[connector_index]->encoder.type;
|
||||||
ERROR(" + connector: %s\n", get_connector_name(connector_type));
|
ERROR(" + connector: %s\n", get_connector_name(connector_type));
|
||||||
ERROR(" + encoder: %s\n", get_encoder_name(encoder_type));
|
ERROR(" + encoder: %s\n", get_encoder_name(encoder_type));
|
||||||
|
|
||||||
@@ -694,9 +696,9 @@ debug_connectors()
|
|||||||
ERROR("Currently detected connectors=============\n");
|
ERROR("Currently detected connectors=============\n");
|
||||||
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 connector_type = gConnector[id]->connector_type;
|
uint32 connector_type = gConnector[id]->type;
|
||||||
uint32 encoder_type = gConnector[id]->encoder_type;
|
uint32 encoder_type = gConnector[id]->encoder.type;
|
||||||
uint16 gpio_id = gConnector[id]->connector_gpio_id;
|
uint16 gpio_id = gConnector[id]->gpio_id;
|
||||||
ERROR("Connector #%" B_PRIu32 ")\n", id);
|
ERROR("Connector #%" B_PRIu32 ")\n", id);
|
||||||
ERROR(" + connector: %s\n", get_connector_name(connector_type));
|
ERROR(" + connector: %s\n", get_connector_name(connector_type));
|
||||||
ERROR(" + encoder: %s\n", get_encoder_name(encoder_type));
|
ERROR(" + encoder: %s\n", get_encoder_name(encoder_type));
|
||||||
@@ -714,7 +716,7 @@ debug_connectors()
|
|||||||
uint32
|
uint32
|
||||||
display_get_encoder_mode(uint32 connector_index)
|
display_get_encoder_mode(uint32 connector_index)
|
||||||
{
|
{
|
||||||
uint32 connector_type = gConnector[connector_index]->connector_type;
|
uint32 connector_type = gConnector[connector_index]->type;
|
||||||
switch (connector_type) {
|
switch (connector_type) {
|
||||||
case VIDEO_CONNECTOR_DVII:
|
case VIDEO_CONNECTOR_DVII:
|
||||||
case VIDEO_CONNECTOR_HDMIB: /* HDMI-B is DL-DVI; analog works fine */
|
case VIDEO_CONNECTOR_HDMIB: /* HDMI-B is DL-DVI; analog works fine */
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ encoder_assign_crtc(uint8 id)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
uint16 connector_index = gDisplay[id]->connector_index;
|
uint16 connector_index = gDisplay[id]->connector_index;
|
||||||
uint16 encoder_id = gConnector[connector_index]->encoder_object_id;
|
uint16 encoder_id = gConnector[connector_index]->encoder.object_id;
|
||||||
|
|
||||||
switch (frev) {
|
switch (frev) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -177,7 +177,7 @@ encoder_mode_set(uint8 id, uint32 pixelClock)
|
|||||||
{
|
{
|
||||||
uint32 connector_index = gDisplay[id]->connector_index;
|
uint32 connector_index = gDisplay[id]->connector_index;
|
||||||
|
|
||||||
switch (gConnector[connector_index]->encoder_object_id) {
|
switch (gConnector[connector_index]->encoder.object_id) {
|
||||||
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:
|
||||||
@@ -225,9 +225,9 @@ encoder_digital_setup(uint8 id, uint32 pixelClock, int command)
|
|||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
uint16 connector_flags = gConnector[connector_index]->connector_flags;
|
uint16 connector_flags = gConnector[connector_index]->encoder.flags;
|
||||||
|
|
||||||
switch (gConnector[connector_index]->encoder_object_id) {
|
switch (gConnector[connector_index]->encoder.object_id) {
|
||||||
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
case ENCODER_OBJECT_ID_INTERNAL_LVDS:
|
||||||
index = GetIndexIntoMasterTable(COMMAND, LVDSEncoderControl);
|
index = GetIndexIntoMasterTable(COMMAND, LVDSEncoderControl);
|
||||||
break;
|
break;
|
||||||
@@ -343,7 +343,7 @@ encoder_analog_setup(uint8 id, uint32 pixelClock, int command)
|
|||||||
DAC_ENCODER_CONTROL_PS_ALLOCATION args;
|
DAC_ENCODER_CONTROL_PS_ALLOCATION args;
|
||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
|
|
||||||
switch (gConnector[connector_index]->encoder_object_id) {
|
switch (gConnector[connector_index]->encoder.object_id) {
|
||||||
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);
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ bool
|
|||||||
radeon_gpu_read_edid(uint32 connector, edid1_info *edid)
|
radeon_gpu_read_edid(uint32 connector, edid1_info *edid)
|
||||||
{
|
{
|
||||||
// ensure things are sane
|
// ensure things are sane
|
||||||
uint32 gpio_id = gConnector[connector]->connector_gpio_id;
|
uint32 gpio_id = gConnector[connector]->gpio_id;
|
||||||
if (gGPIOInfo[gpio_id]->valid == false)
|
if (gGPIOInfo[gpio_id]->valid == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -399,11 +399,11 @@ radeon_gpu_read_edid(uint32 connector, edid1_info *edid)
|
|||||||
status_t
|
status_t
|
||||||
radeon_gpu_i2c_attach(uint32 id, uint8 hw_line)
|
radeon_gpu_i2c_attach(uint32 id, uint8 hw_line)
|
||||||
{
|
{
|
||||||
gConnector[id]->connector_gpio_id = 0;
|
gConnector[id]->gpio_id = 0;
|
||||||
for (uint32 i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) {
|
for (uint32 i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) {
|
||||||
if (gGPIOInfo[i]->hw_line != hw_line)
|
if (gGPIOInfo[i]->hw_line != hw_line)
|
||||||
continue;
|
continue;
|
||||||
gConnector[id]->connector_gpio_id = i;
|
gConnector[id]->gpio_id = i;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ radeon_set_display_mode(display_mode *mode)
|
|||||||
|
|
||||||
// *** encoder prep
|
// *** encoder prep
|
||||||
encoder_output_lock(true);
|
encoder_output_lock(true);
|
||||||
encoder_dpms_set(gConnector[connector_index]->encoder_object_id,
|
encoder_dpms_set(gConnector[connector_index]->encoder.object_id,
|
||||||
B_DPMS_OFF);
|
B_DPMS_OFF);
|
||||||
encoder_assign_crtc(id);
|
encoder_assign_crtc(id);
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ radeon_set_display_mode(display_mode *mode)
|
|||||||
display_crtc_lock(id, ATOM_DISABLE);
|
display_crtc_lock(id, ATOM_DISABLE);
|
||||||
|
|
||||||
// *** encoder commit
|
// *** encoder commit
|
||||||
encoder_dpms_set(gConnector[connector_index]->encoder_object_id,
|
encoder_dpms_set(gConnector[connector_index]->encoder.object_id,
|
||||||
B_DPMS_ON);
|
B_DPMS_ON);
|
||||||
encoder_output_lock(false);
|
encoder_output_lock(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ pll_set(uint8 pll_id, uint32 pixelClock, uint8 crtc_id)
|
|||||||
// 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[connector_index]->encoder_object_id;
|
= gConnector[connector_index]->encoder.object_id;
|
||||||
args.v3.ucEncoderMode = display_get_encoder_mode(connector_index);
|
args.v3.ucEncoderMode = display_get_encoder_mode(connector_index);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user