diff mbox series

[1/1] drm/bridge: tc358767: respect (e)DP output resolution limits

Message ID 20231128133933.2923307-1-alexander.stein@ew.tq-group.com (mailing list archive)
State New, archived
Headers show
Series [1/1] drm/bridge: tc358767: respect (e)DP output resolution limits | expand

Commit Message

Alexander Stein Nov. 28, 2023, 1:39 p.m. UTC
From: Markus Niebel <Markus.Niebel@ew.tq-group.com>

Modes S21/P21, (e)DP output, support only resolutions up to 1920x1200.
Filter out modes from EDID larger than this limit. This especially
important for 4k monitors.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/gpu/drm/bridge/tc358767.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 019b8f1432a7d..88bdd9dca41d0 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1646,9 +1646,17 @@  tc_connector_detect(struct drm_connector *connector, bool force)
 		return connector_status_unknown;
 }
 
+static int tc_fill_modes(struct drm_connector *connector, uint32_t maxX,
+			 uint32_t maxY)
+{
+	return drm_helper_probe_single_connector_modes(connector,
+						       min(maxX, 1920U),
+						       min(maxY, 1200U));
+}
+
 static const struct drm_connector_funcs tc_connector_funcs = {
 	.detect = tc_connector_detect,
-	.fill_modes = drm_helper_probe_single_connector_modes,
+	.fill_modes = tc_fill_modes,
 	.destroy = drm_connector_cleanup,
 	.reset = drm_atomic_helper_connector_reset,
 	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,