@@ -635,6 +635,17 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);
+ if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
+ connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+ enum drm_mode_subconnector subconnector = DRM_MODE_SUBCONNECTOR_Unknown;
+
+ if (conn_status == connector_status_connected && nv_encoder)
+ subconnector = nv_encoder->dp.subconnector;
+ drm_object_property_set_value(&connector->base,
+ connector->dev->mode_config.dp_subconnector_property,
+ subconnector);
+ }
+
return conn_status;
}
@@ -1359,6 +1370,8 @@ nouveau_connector_create(struct drm_device *dev,
kfree(nv_connector);
return ERR_PTR(ret);
}
+
+ drm_mode_add_dp_subconnector_property(connector);
funcs = &nouveau_connector_funcs;
break;
default:
@@ -62,6 +62,7 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)
struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_i2c_aux *aux;
u8 dpcd[8];
+ u8 port_cap[DP_MAX_DOWNSTREAM_PORTS] = {};
int ret;
aux = nv_encoder->aux;
@@ -72,6 +73,14 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)
if (ret)
return ret;
+ if (dpcd[DP_DPCD_REV] > 0x10) {
+ ret = nvkm_rdaux(aux, DP_DOWNSTREAM_PORT_0,
+ port_cap, DP_MAX_DOWNSTREAM_PORTS);
+ if (ret)
+ memset(port_cap, 0, DP_MAX_DOWNSTREAM_PORTS);
+ }
+ nv_encoder->dp.subconnector = drm_dp_subconnector_type(dpcd, port_cap);
+
nv_encoder->dp.link_bw = 27000 * dpcd[1];
nv_encoder->dp.link_nr = dpcd[2] & DP_MAX_LANE_COUNT_MASK;
@@ -63,6 +63,7 @@ struct nouveau_encoder {
struct nv50_mstm *mstm;
int link_nr;
int link_bw;
+ enum drm_mode_subconnector subconnector;
} dp;
};