From patchwork Tue Nov 28 13:39:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13471164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14014C4167B for ; Tue, 28 Nov 2023 13:39:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C71910E530; Tue, 28 Nov 2023 13:39:39 +0000 (UTC) Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7625210E53B for ; Tue, 28 Nov 2023 13:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1701178777; x=1732714777; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cBeN1PG9grbiECe7yaAUxlwcMB543KTle/ixoOM9pmc=; b=ngjspOeK8aQDZ91iLT10KQIV2R/guI0XQYAZTHQeWMfKduQ5W8K8YbE8 LAXfq5Lm8mERRAT9jyniYNcAr/R0Pxj0vAJ5akI2cOe7wx3PNml0L4sVf VHldio6JCeLl36Ig9hIEWmUa2xI4EyG3uiCiBIE6OH8YhfjXx/YGHM2KT CjeLffkry+CRx1KbpO7sonp3CGmBmkDty4pEkQTPf2+qbaMpPZTu43IvN 1QO4EchV1hm4UKy0KoPtC0cA/gfurhm7zGIaEvnQ/MUn3OVYAXjpQnlnh zd+oUxlLDujbPr+DuvnRjDKgBLnlZSV4racvZJrxmapJgkOb4C7/kIx4F g==; X-IronPort-AV: E=Sophos;i="6.04,233,1695679200"; d="scan'208";a="34216336" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 28 Nov 2023 14:39:35 +0100 Received: from steina-w.tq-net.de (steina-w.tq-net.de [10.123.53.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 8F7C0280075; Tue, 28 Nov 2023 14:39:35 +0100 (CET) From: Alexander Stein To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter Subject: [PATCH 1/1] drm/bridge: tc358767: respect (e)DP output resolution limits Date: Tue, 28 Nov 2023 14:39:33 +0100 Message-Id: <20231128133933.2923307-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Stein , Markus Niebel , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Markus Niebel 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 Signed-off-by: Alexander Stein --- drivers/gpu/drm/bridge/tc358767.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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,