From: Adam Jackson Date: Tue, 8 Sep 2009 01:51:46 +0000 (+1000) Subject: drm: prune modes when output is disconnected. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=620f37811dcc9e0f97ee79fbf8908fcc097deaee;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: prune modes when output is disconnected. When an output was disconnected, its mode list would remain. If you later plugged into a sink with no EDID (projector, etc), you'd inherit the mode list from the old sink, which is not what you want. taken from Fedora kernel Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index c9a50c729330..ff447f175a56 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -95,8 +95,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, if (connector->status == connector_status_disconnected) { DRM_DEBUG_KMS("%s is disconnected\n", drm_get_connector_name(connector)); - /* TODO set EDID to NULL */ - return 0; + goto prune; } count = (*connector_funcs->get_modes)(connector); @@ -124,6 +123,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, mode); } +prune: drm_mode_prune_invalid(dev, &connector->modes, true); if (list_empty(&connector->modes))