Commit 196c58d2 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms: add support for eDP (embedded DisplayPort)

This is displayport used for internal connections such
as laptop panels and systems with integrated monitors.
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 7970e677
...@@ -468,7 +468,8 @@ void radeon_dp_set_link_config(struct drm_connector *connector, ...@@ -468,7 +468,8 @@ void radeon_dp_set_link_config(struct drm_connector *connector,
struct radeon_connector *radeon_connector; struct radeon_connector *radeon_connector;
struct radeon_connector_atom_dig *dig_connector; struct radeon_connector_atom_dig *dig_connector;
if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) if ((connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) ||
(connector->connector_type != DRM_MODE_CONNECTOR_eDP))
return; return;
radeon_connector = to_radeon_connector(connector); radeon_connector = to_radeon_connector(connector);
...@@ -582,7 +583,8 @@ void dp_link_train(struct drm_encoder *encoder, ...@@ -582,7 +583,8 @@ void dp_link_train(struct drm_encoder *encoder,
u8 train_set[4]; u8 train_set[4];
int i; int i;
if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) if ((connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) ||
(connector->connector_type != DRM_MODE_CONNECTOR_eDP))
return; return;
if (!radeon_encoder->enc_priv) if (!radeon_encoder->enc_priv)
......
...@@ -346,7 +346,9 @@ const int object_connector_convert[] = { ...@@ -346,7 +346,9 @@ const int object_connector_convert[] = {
DRM_MODE_CONNECTOR_Unknown, DRM_MODE_CONNECTOR_Unknown,
DRM_MODE_CONNECTOR_Unknown, DRM_MODE_CONNECTOR_Unknown,
DRM_MODE_CONNECTOR_Unknown, DRM_MODE_CONNECTOR_Unknown,
DRM_MODE_CONNECTOR_DisplayPort DRM_MODE_CONNECTOR_DisplayPort,
DRM_MODE_CONNECTOR_eDP,
DRM_MODE_CONNECTOR_Unknown
}; };
bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
......
...@@ -49,8 +49,10 @@ void radeon_connector_hotplug(struct drm_connector *connector) ...@@ -49,8 +49,10 @@ void radeon_connector_hotplug(struct drm_connector *connector)
if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) if (radeon_connector->hpd.hpd != RADEON_HPD_NONE)
radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd); radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd);
if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
if (radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_DISPLAYPORT) { (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) {
if ((radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
(radeon_dp_getsinktype(radeon_connector) == CONNECTOR_OBJECT_ID_eDP)) {
if (radeon_dp_needs_link_train(radeon_connector)) { if (radeon_dp_needs_link_train(radeon_connector)) {
if (connector->encoder) if (connector->encoder)
dp_link_train(connector->encoder, connector); dp_link_train(connector->encoder, connector);
...@@ -967,7 +969,8 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto ...@@ -967,7 +969,8 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto
} }
sink_type = radeon_dp_getsinktype(radeon_connector); sink_type = radeon_dp_getsinktype(radeon_connector);
if (sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { if ((sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
(sink_type == CONNECTOR_OBJECT_ID_eDP)) {
if (radeon_dp_getdpcd(radeon_connector)) { if (radeon_dp_getdpcd(radeon_connector)) {
radeon_dig_connector->dp_sink_type = sink_type; radeon_dig_connector->dp_sink_type = sink_type;
ret = connector_status_connected; ret = connector_status_connected;
...@@ -992,7 +995,8 @@ static int radeon_dp_mode_valid(struct drm_connector *connector, ...@@ -992,7 +995,8 @@ static int radeon_dp_mode_valid(struct drm_connector *connector,
/* XXX check mode bandwidth */ /* XXX check mode bandwidth */
if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
(radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
return radeon_dp_mode_valid_helper(radeon_connector, mode); return radeon_dp_mode_valid_helper(radeon_connector, mode);
else else
return MODE_OK; return MODE_OK;
...@@ -1145,6 +1149,7 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1145,6 +1149,7 @@ radeon_add_atom_connector(struct drm_device *dev,
subpixel_order = SubPixelHorizontalRGB; subpixel_order = SubPixelHorizontalRGB;
break; break;
case DRM_MODE_CONNECTOR_DisplayPort: case DRM_MODE_CONNECTOR_DisplayPort:
case DRM_MODE_CONNECTOR_eDP:
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;
...@@ -1157,10 +1162,16 @@ radeon_add_atom_connector(struct drm_device *dev, ...@@ -1157,10 +1162,16 @@ radeon_add_atom_connector(struct drm_device *dev,
goto failed; goto failed;
if (i2c_bus->valid) { if (i2c_bus->valid) {
/* add DP i2c bus */ /* add DP i2c bus */
radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch"); if (connector_type == DRM_MODE_CONNECTOR_eDP)
radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "eDP-auxch");
else
radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch");
if (!radeon_dig_connector->dp_i2c_bus) if (!radeon_dig_connector->dp_i2c_bus)
goto failed; goto failed;
radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DP"); if (connector_type == DRM_MODE_CONNECTOR_eDP)
radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "eDP");
else
radeon_connector->ddc_bus = radeon_i2c_create(dev, i2c_bus, "DP");
if (!radeon_connector->ddc_bus) if (!radeon_connector->ddc_bus)
goto failed; goto failed;
} }
......
...@@ -234,7 +234,7 @@ static const char *encoder_names[34] = { ...@@ -234,7 +234,7 @@ static const char *encoder_names[34] = {
"INTERNAL_UNIPHY2", "INTERNAL_UNIPHY2",
}; };
static const char *connector_names[13] = { static const char *connector_names[15] = {
"Unknown", "Unknown",
"VGA", "VGA",
"DVI-I", "DVI-I",
...@@ -248,6 +248,8 @@ static const char *connector_names[13] = { ...@@ -248,6 +248,8 @@ static const char *connector_names[13] = {
"DisplayPort", "DisplayPort",
"HDMI-A", "HDMI-A",
"HDMI-B", "HDMI-B",
"TV",
"eDP",
}; };
static const char *hpd_names[7] = { static const char *hpd_names[7] = {
...@@ -352,7 +354,8 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) ...@@ -352,7 +354,8 @@ int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
{ {
int ret = 0; int ret = 0;
if (radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) { if ((radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
(radeon_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP)) {
struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; struct radeon_connector_atom_dig *dig = radeon_connector->con_priv;
if (dig->dp_i2c_bus) if (dig->dp_i2c_bus)
radeon_connector->edid = drm_get_edid(&radeon_connector->base, &dig->dp_i2c_bus->adapter); radeon_connector->edid = drm_get_edid(&radeon_connector->base, &dig->dp_i2c_bus->adapter);
......
...@@ -596,8 +596,10 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) ...@@ -596,8 +596,10 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
return ATOM_ENCODER_MODE_LVDS; return ATOM_ENCODER_MODE_LVDS;
break; break;
case DRM_MODE_CONNECTOR_DisplayPort: case DRM_MODE_CONNECTOR_DisplayPort:
case DRM_MODE_CONNECTOR_eDP:
radeon_dig_connector = radeon_connector->con_priv; radeon_dig_connector = radeon_connector->con_priv;
if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
(radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
return ATOM_ENCODER_MODE_DP; return ATOM_ENCODER_MODE_DP;
else if (drm_detect_hdmi_monitor(radeon_connector->edid)) else if (drm_detect_hdmi_monitor(radeon_connector->edid))
return ATOM_ENCODER_MODE_HDMI; return ATOM_ENCODER_MODE_HDMI;
......
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