drm/fb: add support for not enabling fbcon on non-desktop displays [v2]
authorDave Airlie <airlied@redhat.com>
Mon, 16 Oct 2017 04:08:39 +0000 (05:08 +0100)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:55:57 +0000 (14:55 -0500)
We don't want fbcon to get used on non-desktop dislays,
don't pass them as enabled connectors to the fb helper setup.

This prevents my HMD from getting disorted fbcon, and from
affecting other displays console.

v2: Change description from non-standard to non-desktop

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
(cherry-picked b5f053882ff19a8ce from git://people.freedesktop.org/~airlied/linux)

drivers/gpu/drm/drm_fb_helper.c

index 6a48d66..a3dc4a7 100644 (file)
@@ -1815,6 +1815,9 @@ static bool drm_connector_enabled(struct drm_connector *connector, bool strict)
 {
        bool enable;
 
+       if (connector->display_info.non_desktop)
+               return false;
+
        if (strict)
                enable = connector->status == connector_status_connected;
        else
@@ -1834,7 +1837,8 @@ static void drm_enable_connectors(struct drm_fb_helper *fb_helper,
                connector = fb_helper->connector_info[i]->connector;
                enabled[i] = drm_connector_enabled(connector, true);
                DRM_DEBUG_KMS("connector %d enabled? %s\n", connector->base.id,
-                         enabled[i] ? "yes" : "no");
+                             connector->display_info.non_desktop ? "non desktop" : enabled[i] ? "yes" : "no");
+
                any_enabled |= enabled[i];
        }