[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231102221309.1971910-5-hsinyi@chromium.org>
Date: Thu, 2 Nov 2023 14:47:50 -0700
From: Hsin-Yi Wang <hsinyi@...omium.org>
To: Douglas Anderson <dianders@...omium.org>
Cc: Neil Armstrong <neil.armstrong@...aro.org>,
Jessica Zhang <quic_jesszhan@...cinc.com>,
Sam Ravnborg <sam@...nborg.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 4/4] drm/panel-edp: Choose correct preferred mode
If a non generic edp-panel is under aux-bus, the mode read from edid would
still be selected as preferred and results in multiple preferred modes,
which is ambiguous.
If a hard-coded mode is present, unset the preferred bit of the modes read
from edid.
Signed-off-by: Hsin-Yi Wang <hsinyi@...omium.org>
---
v1->v2: split patches from drm_modes.
---
drivers/gpu/drm/panel/panel-edp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
index 0fb439b5efb1..021322ff9f65 100644
--- a/drivers/gpu/drm/panel/panel-edp.c
+++ b/drivers/gpu/drm/panel/panel-edp.c
@@ -622,10 +622,13 @@ static int panel_edp_get_modes(struct drm_panel *panel,
* and no modes (the generic edp-panel case) because it will clobber
* the display_info that was already set by drm_add_edid_modes().
*/
- if (p->desc->num_timings || p->desc->num_modes)
+ if (p->desc->num_timings || p->desc->num_modes) {
+ /* hard-coded modes present, unset preferred modes from edid. */
+ drm_mode_unset_preferred_modes(connector);
num += panel_edp_get_non_edid_modes(p, connector);
- else if (!num)
+ } else if (!num) {
dev_warn(p->base.dev, "No display modes\n");
+ }
/*
* TODO: Remove once all drm drivers call
--
2.42.0.869.gea05f2083d-goog
Powered by blists - more mailing lists