Commit 5137ee94 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms: rework encoder handling

On most newer asics, digital encoders have two links each
and they can be used independantly.  As such, treat them as
separate encoders otherwise the individual links will not
get programmed properly at modeset time.
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent fbee67a6
...@@ -610,7 +610,7 @@ void dp_link_train(struct drm_encoder *encoder, ...@@ -610,7 +610,7 @@ void dp_link_train(struct drm_encoder *encoder,
enc_id |= ATOM_DP_CONFIG_DIG2_ENCODER; enc_id |= ATOM_DP_CONFIG_DIG2_ENCODER;
else else
enc_id |= ATOM_DP_CONFIG_DIG1_ENCODER; enc_id |= ATOM_DP_CONFIG_DIG1_ENCODER;
if (dig_connector->linkb) if (dig->linkb)
enc_id |= ATOM_DP_CONFIG_LINK_B; enc_id |= ATOM_DP_CONFIG_LINK_B;
else else
enc_id |= ATOM_DP_CONFIG_LINK_A; enc_id |= ATOM_DP_CONFIG_LINK_A;
......
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
/* from radeon_encoder.c */ /* from radeon_encoder.c */
extern uint32_t extern uint32_t
radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device,
uint8_t dac); uint8_t dac);
extern void radeon_link_encoder_connector(struct drm_device *dev); extern void radeon_link_encoder_connector(struct drm_device *dev);
extern void extern void
radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
uint32_t supported_device); uint32_t supported_device);
/* from radeon_connector.c */ /* from radeon_connector.c */
...@@ -46,14 +46,14 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -46,14 +46,14 @@ radeon_add_atom_connector(struct drm_device *dev,
uint32_t supported_device, uint32_t supported_device,
int connector_type, int connector_type,
struct radeon_i2c_bus_rec *i2c_bus, struct radeon_i2c_bus_rec *i2c_bus,
bool linkb, uint32_t igp_lane_info, uint32_t igp_lane_info,
uint16_t connector_object_id, uint16_t connector_object_id,
struct radeon_hpd *hpd, struct radeon_hpd *hpd,
struct radeon_router *router); struct radeon_router *router);
/* from radeon_legacy_encoder.c */ /* from radeon_legacy_encoder.c */
extern void extern void
radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
uint32_t supported_device); uint32_t supported_device);
union atom_supported_devices { union atom_supported_devices {
...@@ -479,7 +479,6 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -479,7 +479,6 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
int i, j, k, path_size, device_support; int i, j, k, path_size, device_support;
int connector_type; int connector_type;
u16 igp_lane_info, conn_id, connector_object_id; u16 igp_lane_info, conn_id, connector_object_id;
bool linkb;
struct radeon_i2c_bus_rec ddc_bus; struct radeon_i2c_bus_rec ddc_bus;
struct radeon_router router; struct radeon_router router;
struct radeon_gpio_rec gpio; struct radeon_gpio_rec gpio;
...@@ -512,7 +511,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -512,7 +511,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
addr += path_size; addr += path_size;
path = (ATOM_DISPLAY_OBJECT_PATH *) addr; path = (ATOM_DISPLAY_OBJECT_PATH *) addr;
path_size += le16_to_cpu(path->usSize); path_size += le16_to_cpu(path->usSize);
linkb = false;
if (device_support & le16_to_cpu(path->usDeviceTag)) { if (device_support & le16_to_cpu(path->usDeviceTag)) {
uint8_t con_obj_id, con_obj_num, con_obj_type; uint8_t con_obj_id, con_obj_num, con_obj_type;
...@@ -603,13 +602,10 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -603,13 +602,10 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
if (grph_obj_type == GRAPH_OBJECT_TYPE_ENCODER) { if (grph_obj_type == GRAPH_OBJECT_TYPE_ENCODER) {
if (grph_obj_num == 2) u16 encoder_obj = le16_to_cpu(path->usGraphicObjIds[j]);
linkb = true;
else
linkb = false;
radeon_add_atom_encoder(dev, radeon_add_atom_encoder(dev,
grph_obj_id, encoder_obj,
le16_to_cpu le16_to_cpu
(path-> (path->
usDeviceTag)); usDeviceTag));
...@@ -746,7 +742,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) ...@@ -746,7 +742,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
le16_to_cpu(path-> le16_to_cpu(path->
usDeviceTag), usDeviceTag),
connector_type, &ddc_bus, connector_type, &ddc_bus,
linkb, igp_lane_info, igp_lane_info,
connector_object_id, connector_object_id,
&hpd, &hpd,
&router); &router);
...@@ -935,13 +931,13 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct ...@@ -935,13 +931,13 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
if (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom) if (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom)
radeon_add_atom_encoder(dev, radeon_add_atom_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
(1 << i), (1 << i),
dac), dac),
(1 << i)); (1 << i));
else else
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
(1 << i), (1 << i),
dac), dac),
(1 << i)); (1 << i));
...@@ -998,7 +994,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct ...@@ -998,7 +994,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
bios_connectors[i]. bios_connectors[i].
connector_type, connector_type,
&bios_connectors[i].ddc_bus, &bios_connectors[i].ddc_bus,
false, 0, 0,
connector_object_id, connector_object_id,
&bios_connectors[i].hpd, &bios_connectors[i].hpd,
&router); &router);
...@@ -1307,6 +1303,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct ...@@ -1307,6 +1303,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
union lvds_info *lvds_info; union lvds_info *lvds_info;
uint8_t frev, crev; uint8_t frev, crev;
struct radeon_encoder_atom_dig *lvds = NULL; struct radeon_encoder_atom_dig *lvds = NULL;
int encoder_enum = (encoder->encoder_enum & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
if (atom_parse_data_header(mode_info->atom_context, index, NULL, if (atom_parse_data_header(mode_info->atom_context, index, NULL,
&frev, &crev, &data_offset)) { &frev, &crev, &data_offset)) {
...@@ -1370,6 +1367,12 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct ...@@ -1370,6 +1367,12 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
} }
encoder->native_mode = lvds->native_mode; encoder->native_mode = lvds->native_mode;
if (encoder_enum == 2)
lvds->linkb = true;
else
lvds->linkb = false;
} }
return lvds; return lvds;
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
/* from radeon_encoder.c */ /* from radeon_encoder.c */
extern uint32_t extern uint32_t
radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device,
uint8_t dac); uint8_t dac);
extern void radeon_link_encoder_connector(struct drm_device *dev); extern void radeon_link_encoder_connector(struct drm_device *dev);
...@@ -55,7 +55,7 @@ radeon_add_legacy_connector(struct drm_device *dev, ...@@ -55,7 +55,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
/* from radeon_legacy_encoder.c */ /* from radeon_legacy_encoder.c */
extern void extern void
radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
uint32_t supported_device); uint32_t supported_device);
/* old legacy ATI BIOS routines */ /* old legacy ATI BIOS routines */
...@@ -1505,7 +1505,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1505,7 +1505,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1520,7 +1520,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1520,7 +1520,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_NONE_DETECTED, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_NONE_DETECTED, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
...@@ -1535,7 +1535,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1535,7 +1535,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1550,12 +1550,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1550,12 +1550,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
hpd.hpd = RADEON_HPD_1; hpd.hpd = RADEON_HPD_1;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -1571,7 +1571,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1571,7 +1571,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1588,7 +1588,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1588,7 +1588,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1607,7 +1607,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1607,7 +1607,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
...@@ -1619,7 +1619,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1619,7 +1619,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -1631,7 +1631,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1631,7 +1631,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1648,7 +1648,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1648,7 +1648,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
...@@ -1660,12 +1660,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1660,12 +1660,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_2; /* ??? */ hpd.hpd = RADEON_HPD_2; /* ??? */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP2_SUPPORT, ATOM_DEVICE_DFP2_SUPPORT,
0), 0),
ATOM_DEVICE_DFP2_SUPPORT); ATOM_DEVICE_DFP2_SUPPORT);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1680,7 +1680,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1680,7 +1680,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1697,7 +1697,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1697,7 +1697,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
...@@ -1709,12 +1709,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1709,12 +1709,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_1; /* ??? */ hpd.hpd = RADEON_HPD_1; /* ??? */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1728,7 +1728,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1728,7 +1728,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1745,7 +1745,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1745,7 +1745,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
...@@ -1757,7 +1757,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1757,7 +1757,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1769,7 +1769,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1769,7 +1769,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1786,12 +1786,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1786,12 +1786,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
hpd.hpd = RADEON_HPD_2; /* ??? */ hpd.hpd = RADEON_HPD_2; /* ??? */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP2_SUPPORT, ATOM_DEVICE_DFP2_SUPPORT,
0), 0),
ATOM_DEVICE_DFP2_SUPPORT); ATOM_DEVICE_DFP2_SUPPORT);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -1806,7 +1806,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1806,7 +1806,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1823,12 +1823,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1823,12 +1823,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
hpd.hpd = RADEON_HPD_1; /* ??? */ hpd.hpd = RADEON_HPD_1; /* ??? */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -1842,7 +1842,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1842,7 +1842,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1859,7 +1859,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1859,7 +1859,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
hpd.hpd = RADEON_HPD_1; /* ??? */ hpd.hpd = RADEON_HPD_1; /* ??? */
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
...@@ -1871,7 +1871,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1871,7 +1871,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -1883,7 +1883,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1883,7 +1883,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1900,7 +1900,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1900,7 +1900,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1912,7 +1912,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1912,7 +1912,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -1924,7 +1924,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1924,7 +1924,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c.valid = false; ddc_i2c.valid = false;
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
ATOM_DEVICE_TV1_SUPPORT); ATOM_DEVICE_TV1_SUPPORT);
...@@ -1941,7 +1941,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1941,7 +1941,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -1952,7 +1952,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) ...@@ -1952,7 +1952,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0); ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
ATOM_DEVICE_CRT2_SUPPORT); ATOM_DEVICE_CRT2_SUPPORT);
...@@ -2109,7 +2109,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2109,7 +2109,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
else else
devices = ATOM_DEVICE_DFP1_SUPPORT; devices = ATOM_DEVICE_DFP1_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, devices, 0), (dev, devices, 0),
devices); devices);
radeon_add_legacy_connector(dev, i, devices, radeon_add_legacy_connector(dev, i, devices,
...@@ -2123,7 +2123,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2123,7 +2123,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
if (tmp & 0x1) { if (tmp & 0x1) {
devices = ATOM_DEVICE_CRT2_SUPPORT; devices = ATOM_DEVICE_CRT2_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
...@@ -2131,7 +2131,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2131,7 +2131,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
} else { } else {
devices = ATOM_DEVICE_CRT1_SUPPORT; devices = ATOM_DEVICE_CRT1_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
...@@ -2151,7 +2151,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2151,7 +2151,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
if (tmp & 0x1) { if (tmp & 0x1) {
devices |= ATOM_DEVICE_CRT2_SUPPORT; devices |= ATOM_DEVICE_CRT2_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_CRT2_SUPPORT, ATOM_DEVICE_CRT2_SUPPORT,
2), 2),
...@@ -2159,7 +2159,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2159,7 +2159,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
} else { } else {
devices |= ATOM_DEVICE_CRT1_SUPPORT; devices |= ATOM_DEVICE_CRT1_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
...@@ -2168,7 +2168,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2168,7 +2168,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
if ((tmp >> 4) & 0x1) { if ((tmp >> 4) & 0x1) {
devices |= ATOM_DEVICE_DFP2_SUPPORT; devices |= ATOM_DEVICE_DFP2_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_DFP2_SUPPORT, ATOM_DEVICE_DFP2_SUPPORT,
0), 0),
...@@ -2177,7 +2177,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2177,7 +2177,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
} else { } else {
devices |= ATOM_DEVICE_DFP1_SUPPORT; devices |= ATOM_DEVICE_DFP1_SUPPORT;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
...@@ -2202,7 +2202,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2202,7 +2202,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
} }
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, devices, 0), (dev, devices, 0),
devices); devices);
radeon_add_legacy_connector(dev, i, devices, radeon_add_legacy_connector(dev, i, devices,
...@@ -2215,7 +2215,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2215,7 +2215,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
case CONNECTOR_CTV_LEGACY: case CONNECTOR_CTV_LEGACY:
case CONNECTOR_STV_LEGACY: case CONNECTOR_STV_LEGACY:
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
...@@ -2242,12 +2242,12 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2242,12 +2242,12 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
DRM_DEBUG_KMS("Found DFP table, assuming DVI connector\n"); DRM_DEBUG_KMS("Found DFP table, assuming DVI connector\n");
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_DFP1_SUPPORT, ATOM_DEVICE_DFP1_SUPPORT,
0), 0),
ATOM_DEVICE_DFP1_SUPPORT); ATOM_DEVICE_DFP1_SUPPORT);
...@@ -2268,7 +2268,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2268,7 +2268,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
DRM_DEBUG_KMS("Found CRT table, assuming VGA connector\n"); DRM_DEBUG_KMS("Found CRT table, assuming VGA connector\n");
if (crt_info) { if (crt_info) {
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_CRT1_SUPPORT, ATOM_DEVICE_CRT1_SUPPORT,
1), 1),
ATOM_DEVICE_CRT1_SUPPORT); ATOM_DEVICE_CRT1_SUPPORT);
...@@ -2297,7 +2297,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2297,7 +2297,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
COMBIOS_LCD_DDC_INFO_TABLE); COMBIOS_LCD_DDC_INFO_TABLE);
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id(dev, radeon_get_encoder_enum(dev,
ATOM_DEVICE_LCD1_SUPPORT, ATOM_DEVICE_LCD1_SUPPORT,
0), 0),
ATOM_DEVICE_LCD1_SUPPORT); ATOM_DEVICE_LCD1_SUPPORT);
...@@ -2351,7 +2351,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) ...@@ -2351,7 +2351,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
hpd.hpd = RADEON_HPD_NONE; hpd.hpd = RADEON_HPD_NONE;
ddc_i2c.valid = false; ddc_i2c.valid = false;
radeon_add_legacy_encoder(dev, radeon_add_legacy_encoder(dev,
radeon_get_encoder_id radeon_get_encoder_enum
(dev, (dev,
ATOM_DEVICE_TV1_SUPPORT, ATOM_DEVICE_TV1_SUPPORT,
2), 2),
......
...@@ -1037,7 +1037,6 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1037,7 +1037,6 @@ radeon_add_atom_connector(struct drm_device *dev,
uint32_t supported_device, uint32_t supported_device,
int connector_type, int connector_type,
struct radeon_i2c_bus_rec *i2c_bus, struct radeon_i2c_bus_rec *i2c_bus,
bool linkb,
uint32_t igp_lane_info, uint32_t igp_lane_info,
uint16_t connector_object_id, uint16_t connector_object_id,
struct radeon_hpd *hpd, struct radeon_hpd *hpd,
...@@ -1128,7 +1127,6 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1128,7 +1127,6 @@ radeon_add_atom_connector(struct drm_device *dev,
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
if (!radeon_dig_connector) if (!radeon_dig_connector)
goto failed; goto failed;
radeon_dig_connector->linkb = linkb;
radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_dig_connector->igp_lane_info = igp_lane_info;
radeon_connector->con_priv = radeon_dig_connector; radeon_connector->con_priv = radeon_dig_connector;
drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type);
...@@ -1158,7 +1156,6 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1158,7 +1156,6 @@ radeon_add_atom_connector(struct drm_device *dev,
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
if (!radeon_dig_connector) if (!radeon_dig_connector)
goto failed; goto failed;
radeon_dig_connector->linkb = linkb;
radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_dig_connector->igp_lane_info = igp_lane_info;
radeon_connector->con_priv = radeon_dig_connector; radeon_connector->con_priv = radeon_dig_connector;
drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); drm_connector_init(dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type);
...@@ -1182,7 +1179,6 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1182,7 +1179,6 @@ radeon_add_atom_connector(struct drm_device *dev,
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
if (!radeon_dig_connector) if (!radeon_dig_connector)
goto failed; goto failed;
radeon_dig_connector->linkb = linkb;
radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_dig_connector->igp_lane_info = igp_lane_info;
radeon_connector->con_priv = radeon_dig_connector; radeon_connector->con_priv = radeon_dig_connector;
drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type); drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
...@@ -1229,7 +1225,6 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1229,7 +1225,6 @@ radeon_add_atom_connector(struct drm_device *dev,
radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL);
if (!radeon_dig_connector) if (!radeon_dig_connector)
goto failed; goto failed;
radeon_dig_connector->linkb = linkb;
radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_dig_connector->igp_lane_info = igp_lane_info;
radeon_connector->con_priv = radeon_dig_connector; radeon_connector->con_priv = radeon_dig_connector;
drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type);
......
...@@ -81,7 +81,7 @@ void radeon_setup_encoder_clones(struct drm_device *dev) ...@@ -81,7 +81,7 @@ void radeon_setup_encoder_clones(struct drm_device *dev)
} }
uint32_t uint32_t
radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t dac) radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device, uint8_t dac)
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
uint32_t ret = 0; uint32_t ret = 0;
...@@ -97,59 +97,59 @@ radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t ...@@ -97,59 +97,59 @@ radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t
if ((rdev->family == CHIP_RS300) || if ((rdev->family == CHIP_RS300) ||
(rdev->family == CHIP_RS400) || (rdev->family == CHIP_RS400) ||
(rdev->family == CHIP_RS480)) (rdev->family == CHIP_RS480))
ret = ENCODER_OBJECT_ID_INTERNAL_DAC2; ret = ENCODER_INTERNAL_DAC2_ENUM_ID1;
else if (ASIC_IS_AVIVO(rdev)) else if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1; ret = ENCODER_INTERNAL_KLDSCP_DAC1_ENUM_ID1;
else else
ret = ENCODER_OBJECT_ID_INTERNAL_DAC1; ret = ENCODER_INTERNAL_DAC1_ENUM_ID1;
break; break;
case 2: /* dac b */ case 2: /* dac b */
if (ASIC_IS_AVIVO(rdev)) if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2; ret = ENCODER_INTERNAL_KLDSCP_DAC2_ENUM_ID1;
else { else {
/*if (rdev->family == CHIP_R200) /*if (rdev->family == CHIP_R200)
ret = ENCODER_OBJECT_ID_INTERNAL_DVO1; ret = ENCODER_INTERNAL_DVO1_ENUM_ID1;
else*/ else*/
ret = ENCODER_OBJECT_ID_INTERNAL_DAC2; ret = ENCODER_INTERNAL_DAC2_ENUM_ID1;
} }
break; break;
case 3: /* external dac */ case 3: /* external dac */
if (ASIC_IS_AVIVO(rdev)) if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1; ret = ENCODER_INTERNAL_KLDSCP_DVO1_ENUM_ID1;
else else
ret = ENCODER_OBJECT_ID_INTERNAL_DVO1; ret = ENCODER_INTERNAL_DVO1_ENUM_ID1;
break; break;
} }
break; break;
case ATOM_DEVICE_LCD1_SUPPORT: case ATOM_DEVICE_LCD1_SUPPORT:
if (ASIC_IS_AVIVO(rdev)) if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_OBJECT_ID_INTERNAL_LVTM1; ret = ENCODER_INTERNAL_LVTM1_ENUM_ID1;
else else
ret = ENCODER_OBJECT_ID_INTERNAL_LVDS; ret = ENCODER_INTERNAL_LVDS_ENUM_ID1;
break; break;
case ATOM_DEVICE_DFP1_SUPPORT: case ATOM_DEVICE_DFP1_SUPPORT:
if ((rdev->family == CHIP_RS300) || if ((rdev->family == CHIP_RS300) ||
(rdev->family == CHIP_RS400) || (rdev->family == CHIP_RS400) ||
(rdev->family == CHIP_RS480)) (rdev->family == CHIP_RS480))
ret = ENCODER_OBJECT_ID_INTERNAL_DVO1; ret = ENCODER_INTERNAL_DVO1_ENUM_ID1;
else if (ASIC_IS_AVIVO(rdev)) else if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1; ret = ENCODER_INTERNAL_KLDSCP_TMDS1_ENUM_ID1;
else else
ret = ENCODER_OBJECT_ID_INTERNAL_TMDS1; ret = ENCODER_INTERNAL_TMDS1_ENUM_ID1;
break; break;
case ATOM_DEVICE_LCD2_SUPPORT: case ATOM_DEVICE_LCD2_SUPPORT:
case ATOM_DEVICE_DFP2_SUPPORT: case ATOM_DEVICE_DFP2_SUPPORT:
if ((rdev->family == CHIP_RS600) || if ((rdev->family == CHIP_RS600) ||
(rdev->family == CHIP_RS690) || (rdev->family == CHIP_RS690) ||
(rdev->family == CHIP_RS740)) (rdev->family == CHIP_RS740))
ret = ENCODER_OBJECT_ID_INTERNAL_DDI; ret = ENCODER_INTERNAL_DDI_ENUM_ID1;
else if (ASIC_IS_AVIVO(rdev)) else if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1; ret = ENCODER_INTERNAL_KLDSCP_DVO1_ENUM_ID1;
else else
ret = ENCODER_OBJECT_ID_INTERNAL_DVO1; ret = ENCODER_INTERNAL_DVO1_ENUM_ID1;
break; break;
case ATOM_DEVICE_DFP3_SUPPORT: case ATOM_DEVICE_DFP3_SUPPORT:
ret = ENCODER_OBJECT_ID_INTERNAL_LVTM1; ret = ENCODER_INTERNAL_LVTM1_ENUM_ID1;
break; break;
} }
...@@ -562,7 +562,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) ...@@ -562,7 +562,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action)
if (dig->lvds_misc & ATOM_PANEL_MISC_888RGB) if (dig->lvds_misc & ATOM_PANEL_MISC_888RGB)
args.v1.ucMisc |= (1 << 1); args.v1.ucMisc |= (1 << 1);
} else { } else {
if (dig_connector->linkb) if (dig->linkb)
args.v1.ucMisc |= PANEL_ENCODER_MISC_TMDS_LINKB; args.v1.ucMisc |= PANEL_ENCODER_MISC_TMDS_LINKB;
if (radeon_encoder->pixel_clock > 165000) if (radeon_encoder->pixel_clock > 165000)
args.v1.ucMisc |= PANEL_ENCODER_MISC_DUAL; args.v1.ucMisc |= PANEL_ENCODER_MISC_DUAL;
...@@ -601,7 +601,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) ...@@ -601,7 +601,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action)
args.v2.ucTemporal |= PANEL_ENCODER_TEMPORAL_LEVEL_4; args.v2.ucTemporal |= PANEL_ENCODER_TEMPORAL_LEVEL_4;
} }
} else { } else {
if (dig_connector->linkb) if (dig->linkb)
args.v2.ucMisc |= PANEL_ENCODER_MISC_TMDS_LINKB; args.v2.ucMisc |= PANEL_ENCODER_MISC_TMDS_LINKB;
if (radeon_encoder->pixel_clock > 165000) if (radeon_encoder->pixel_clock > 165000)
args.v2.ucMisc |= PANEL_ENCODER_MISC_DUAL; args.v2.ucMisc |= PANEL_ENCODER_MISC_DUAL;
...@@ -781,7 +781,7 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action) ...@@ -781,7 +781,7 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
args.v1.ucConfig = ATOM_ENCODER_CONFIG_V2_TRANSMITTER3; args.v1.ucConfig = ATOM_ENCODER_CONFIG_V2_TRANSMITTER3;
break; break;
} }
if (dig_connector->linkb) if (dig->linkb)
args.v1.ucConfig |= ATOM_ENCODER_CONFIG_LINKB; args.v1.ucConfig |= ATOM_ENCODER_CONFIG_LINKB;
else else
args.v1.ucConfig |= ATOM_ENCODER_CONFIG_LINKA; args.v1.ucConfig |= ATOM_ENCODER_CONFIG_LINKA;
...@@ -864,7 +864,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -864,7 +864,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
else else
args.v3.ucLaneNum = 4; args.v3.ucLaneNum = 4;
if (dig_connector->linkb) { if (dig->linkb) {
args.v3.acConfig.ucLinkSel = 1; args.v3.acConfig.ucLinkSel = 1;
args.v3.acConfig.ucEncoderSel = 1; args.v3.acConfig.ucEncoderSel = 1;
} }
...@@ -904,7 +904,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -904,7 +904,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
} }
} else if (ASIC_IS_DCE32(rdev)) { } else if (ASIC_IS_DCE32(rdev)) {
args.v2.acConfig.ucEncoderSel = dig->dig_encoder; args.v2.acConfig.ucEncoderSel = dig->dig_encoder;
if (dig_connector->linkb) if (dig->linkb)
args.v2.acConfig.ucLinkSel = 1; args.v2.acConfig.ucLinkSel = 1;
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
...@@ -954,7 +954,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -954,7 +954,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
} }
} }
if (dig_connector->linkb) if (dig->linkb)
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKB; args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKB;
else else
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA; args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA;
...@@ -1290,24 +1290,22 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder) ...@@ -1290,24 +1290,22 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder)
uint32_t dig_enc_in_use = 0; uint32_t dig_enc_in_use = 0;
if (ASIC_IS_DCE4(rdev)) { if (ASIC_IS_DCE4(rdev)) {
struct radeon_connector_atom_dig *dig_connector = dig = radeon_encoder->enc_priv;
radeon_get_atom_connector_priv_from_encoder(encoder);
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
if (dig_connector->linkb) if (dig->linkb)
return 1; return 1;
else else
return 0; return 0;
break; break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
if (dig_connector->linkb) if (dig->linkb)
return 3; return 3;
else else
return 2; return 2;
break; break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
if (dig_connector->linkb) if (dig->linkb)
return 5; return 5;
else else
return 4; return 4;
...@@ -1641,6 +1639,7 @@ radeon_atombios_set_dac_info(struct radeon_encoder *radeon_encoder) ...@@ -1641,6 +1639,7 @@ radeon_atombios_set_dac_info(struct radeon_encoder *radeon_encoder)
struct radeon_encoder_atom_dig * struct radeon_encoder_atom_dig *
radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder) radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder)
{ {
int encoder_enum = (radeon_encoder->encoder_enum & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
struct radeon_encoder_atom_dig *dig = kzalloc(sizeof(struct radeon_encoder_atom_dig), GFP_KERNEL); struct radeon_encoder_atom_dig *dig = kzalloc(sizeof(struct radeon_encoder_atom_dig), GFP_KERNEL);
if (!dig) if (!dig)
...@@ -1650,11 +1649,16 @@ radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder) ...@@ -1650,11 +1649,16 @@ radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder)
dig->coherent_mode = true; dig->coherent_mode = true;
dig->dig_encoder = -1; dig->dig_encoder = -1;
if (encoder_enum == 2)
dig->linkb = true;
else
dig->linkb = false;
return dig; return dig;
} }
void void
radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t supported_device) radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t supported_device)
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -1663,7 +1667,7 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su ...@@ -1663,7 +1667,7 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su
/* see if we already added it */ /* see if we already added it */
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
radeon_encoder = to_radeon_encoder(encoder); radeon_encoder = to_radeon_encoder(encoder);
if (radeon_encoder->encoder_id == encoder_id) { if (radeon_encoder->encoder_enum == encoder_enum) {
radeon_encoder->devices |= supported_device; radeon_encoder->devices |= supported_device;
return; return;
} }
...@@ -1691,7 +1695,8 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su ...@@ -1691,7 +1695,8 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su
radeon_encoder->enc_priv = NULL; radeon_encoder->enc_priv = NULL;
radeon_encoder->encoder_id = encoder_id; radeon_encoder->encoder_enum = encoder_enum;
radeon_encoder->encoder_id = (encoder_enum & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
radeon_encoder->devices = supported_device; radeon_encoder->devices = supported_device;
radeon_encoder->rmx_type = RMX_OFF; radeon_encoder->rmx_type = RMX_OFF;
radeon_encoder->underscan_type = UNDERSCAN_OFF; radeon_encoder->underscan_type = UNDERSCAN_OFF;
......
...@@ -1345,7 +1345,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra ...@@ -1345,7 +1345,7 @@ static struct radeon_encoder_ext_tmds *radeon_legacy_get_ext_tmds_info(struct ra
} }
void void
radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t supported_device) radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t supported_device)
{ {
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -1354,7 +1354,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t ...@@ -1354,7 +1354,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t
/* see if we already added it */ /* see if we already added it */
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
radeon_encoder = to_radeon_encoder(encoder); radeon_encoder = to_radeon_encoder(encoder);
if (radeon_encoder->encoder_id == encoder_id) { if (radeon_encoder->encoder_enum == encoder_enum) {
radeon_encoder->devices |= supported_device; radeon_encoder->devices |= supported_device;
return; return;
} }
...@@ -1374,7 +1374,8 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t ...@@ -1374,7 +1374,8 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t
radeon_encoder->enc_priv = NULL; radeon_encoder->enc_priv = NULL;
radeon_encoder->encoder_id = encoder_id; radeon_encoder->encoder_enum = encoder_enum;
radeon_encoder->encoder_id = (encoder_enum & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
radeon_encoder->devices = supported_device; radeon_encoder->devices = supported_device;
radeon_encoder->rmx_type = RMX_OFF; radeon_encoder->rmx_type = RMX_OFF;
......
...@@ -342,6 +342,7 @@ struct radeon_atom_ss { ...@@ -342,6 +342,7 @@ struct radeon_atom_ss {
}; };
struct radeon_encoder_atom_dig { struct radeon_encoder_atom_dig {
bool linkb;
/* atom dig */ /* atom dig */
bool coherent_mode; bool coherent_mode;
int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB */ int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB */
...@@ -360,6 +361,7 @@ struct radeon_encoder_atom_dac { ...@@ -360,6 +361,7 @@ struct radeon_encoder_atom_dac {
struct radeon_encoder { struct radeon_encoder {
struct drm_encoder base; struct drm_encoder base;
uint32_t encoder_enum;
uint32_t encoder_id; uint32_t encoder_id;
uint32_t devices; uint32_t devices;
uint32_t active_device; uint32_t active_device;
...@@ -378,7 +380,6 @@ struct radeon_encoder { ...@@ -378,7 +380,6 @@ struct radeon_encoder {
struct radeon_connector_atom_dig { struct radeon_connector_atom_dig {
uint32_t igp_lane_info; uint32_t igp_lane_info;
bool linkb;
/* displayport */ /* displayport */
struct radeon_i2c_chan *dp_i2c_bus; struct radeon_i2c_chan *dp_i2c_bus;
u8 dpcd[8]; u8 dpcd[8];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment