From mboxrd@z Thu Jan 1 00:00:00 1970 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 4C28DD262B7 for ; Wed, 21 Jan 2026 04:09:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BC1910E6B5; Wed, 21 Jan 2026 04:09:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Ksfflvs2"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7EB3510E6B2; Wed, 21 Jan 2026 04:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768968573; x=1800504573; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w1v6G3kPCkFcH4ZLvqZ21zwb8ZQmiCRfACE3w9WkKBc=; b=Ksfflvs2T2k+Xi7dKFscxBpcZH2PSxDtHTc7+6pSXKLxu1k//1DFF9Gi y2weGx8Y/FdTVuUuZalu1b61XXBBeeCFBrFIiiWm8DAdOuSU3v681J+Aj Dff22vw1q1RXiBYeoFoM+1ldD44yrZgbu4Z18Xvecs/dWKwtumUEXQC2S WVNA9S1fF4YEjo73xSn/nidNg2ekZDetUNkWcJuLlrnQt3bT4Y2c1iOFl p+gx6Ee93PpzSp5dpGqkcI/LqMu/WmtT1S5STTlVZX4yv27ewmn8Bh3lQ zEntH+zVdxQOlrZ0x3KLzUE+BiH9edphp63HgIhyCj15TNrhFzDam4INt A==; X-CSE-ConnectionGUID: VjxLY73dQwy9W5k4dP8kWA== X-CSE-MsgGUID: xI1kGU53Sc+Kn6tIrz96PA== X-IronPort-AV: E=McAfee;i="6800,10657,11677"; a="81299954" X-IronPort-AV: E=Sophos;i="6.21,242,1763452800"; d="scan'208";a="81299954" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2026 20:09:33 -0800 X-CSE-ConnectionGUID: ZVDqv1MYTROSyIY+irMEKA== X-CSE-MsgGUID: IN+V1rxcQ5e/qBfH0LTZMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,242,1763452800"; d="scan'208";a="211330953" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2026 20:09:33 -0800 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: imre.deak@intel.com, Ankit Nautiyal Subject: [PATCH 06/14] drm/i915/dp_mst: Move the check for dotclock at the end Date: Wed, 21 Jan 2026 09:23:22 +0530 Message-ID: <20260121035330.2793386-7-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260121035330.2793386-1-ankit.k.nautiyal@intel.com> References: <20260121035330.2793386-1-ankit.k.nautiyal@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Refactor the mode_valid to have all joiner dependent stuff together and place the check for dotclock limit at the very end. This will help in the following refactor to iterate over the joiner candidates and find the best joiner candidate that satisfy all checks and limits. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 24f8e60df9ac..31e2eae6e4b3 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -1470,20 +1470,19 @@ mst_connector_mode_valid_ctx(struct drm_connector *_connector, * corresponding link capabilities of the sink) in case the * stream is uncompressed for it by the last branch device. */ - num_joined_pipes = intel_dp_num_joined_pipes(intel_dp, connector, - mode->hdisplay, target_clock); - max_dotclk *= num_joined_pipes; - ret = drm_modeset_lock(&mgr->base.lock, ctx); if (ret) return ret; - if (mode_rate > max_rate || mode->clock > max_dotclk || + if (mode_rate > max_rate || drm_dp_calc_pbn_mode(mode->clock, min_bpp << 4) > port->full_pbn) { *status = MODE_CLOCK_HIGH; return 0; } + num_joined_pipes = intel_dp_num_joined_pipes(intel_dp, connector, + mode->hdisplay, target_clock); + if (intel_dp_has_dsc(connector) && drm_dp_sink_supports_fec(connector->dp.fec_capability)) { /* * TBD pass the connector BPC, @@ -1513,6 +1512,15 @@ mst_connector_mode_valid_ctx(struct drm_connector *_connector, } *status = intel_mode_valid_max_plane_size(display, mode, num_joined_pipes); + + if (*status != MODE_OK) + return 0; + + max_dotclk *= num_joined_pipes; + + if (mode->clock <= max_dotclk) + *status = MODE_OK; + return 0; } -- 2.45.2