From 0f70cafb91e2001871a55d007c5072b5abc7a1de Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 10 Jul 2023 15:34:36 +0200 Subject: [PATCH] intel/display: handle all connectors disabled case If all connectors are set to disabled by configuration, the connectors stayed enabled since the new configuration reveals no preferred or minimal resolution/mode. Instead, use the last set resolution in order to get to the disabling code. --- repos/pc/run/intel_fb.run | 2 +- .../src/drivers/framebuffer/intel/pc/lx_user.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/repos/pc/run/intel_fb.run b/repos/pc/run/intel_fb.run index 664d464a7b..e78129fdd9 100644 --- a/repos/pc/run/intel_fb.run +++ b/repos/pc/run/intel_fb.run @@ -262,7 +262,7 @@ append config { } -append_if $use_fb_controller { +append_if $use_fb_controller config { diff --git a/repos/pc/src/drivers/framebuffer/intel/pc/lx_user.c b/repos/pc/src/drivers/framebuffer/intel/pc/lx_user.c index a39589a753..4f35bb43ce 100644 --- a/repos/pc/src/drivers/framebuffer/intel/pc/lx_user.c +++ b/repos/pc/src/drivers/framebuffer/intel/pc/lx_user.c @@ -153,7 +153,7 @@ static void preferred_mode(struct drm_device const * const dev, } drm_connector_list_iter_end(&conn_iter); - /* no modes on any connector, happens during early bootup */ + /* no mode due to early bootup or all connectors are disabled by config */ if (!min_mode->hdisplay || !min_mode->vdisplay) return; @@ -245,9 +245,17 @@ static bool reconfigure(struct drm_client_dev * const dev) preferred_mode(dev->dev, &mode_preferred, &mode_minimum); - /* no valid modes on any connector on early boot */ - if (!mode_minimum.hdisplay || !mode_minimum.vdisplay) - return false; + if (!mode_minimum.hdisplay || !mode_minimum.vdisplay) { + /* no valid modes on any connector on early boot */ + if (!dumb_fb.fb_id) + return false; + + /* valid connectors but all are disabled by config */ + mode_minimum.hdisplay = dumb_fb.width; + mode_minimum.vdisplay = dumb_fb.height; + mode_preferred = mode_minimum; + } + if (mode_larger(&mode_preferred, &mode_minimum)) mode_real = mode_preferred;