@@ -551,6 +551,17 @@ static int ast_dp501_connector_helper_get_modes(struct drm_connector *connector)
count = drm_edid_connector_add_modes(connector);
drm_edid_free(drm_edid);
+ if (!count) {
+ /*
+ * There's no EDID data without a connected monitor. Set BMC-
+ * compatible modes in this case. The XGA default resolution
+ * should work well for all BMCs.
+ */
+ count = drm_add_modes_noedid(connector, 4096, 4096);
+ if (count)
+ drm_set_preferred_mode(connector, 1024, 768);
+ }
+
return count;
}
@@ -559,10 +570,18 @@ static int ast_dp501_connector_helper_detect_ctx(struct drm_connector *connector
bool force)
{
struct ast_device *ast = to_ast_device(connector->dev);
+ enum drm_connector_status status = connector_status_disconnected;
+ enum drm_connector_status old_status = connector_status_disconnected;
+
+ if (connector->edid_blob_ptr)
+ old_status = connector_status_connected;
if (ast_dp501_is_connected(ast))
- return connector_status_connected;
- return connector_status_disconnected;
+ status = connector_status_connected;
+
+ if (status != old_status)
+ ++connector->epoch_counter;
+ return connector_status_connected;
}
static const struct drm_connector_helper_funcs ast_dp501_connector_helper_funcs = {
Permanently set the connector status to 'connected'. Return BMC modes for connector if no display is attached to the physical DP connector. Otherwise use EDID modes as before. If the status of the physical connector changes, the driver still generates a hotplug event. DRM clients will then reconfigure their output to a mode appropriate for either physical display or BMC. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/gpu/drm/ast/ast_dp501.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)