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 A2E81D49C7C for ; Fri, 30 Jan 2026 08:34:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5210510E93A; Fri, 30 Jan 2026 08:34:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="gxr1RGdV"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 45FEB10E92D; Fri, 30 Jan 2026 08:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769762060; x=1801298060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gqWVPd5DRpINfDh7uwV6GWsuP2tGGdCCicL+Hm0qxTM=; b=gxr1RGdVpIBVJWqpXDHQEi+ZeBn5z/NQ7UaJzQObO6Pqmhbyldo4n3CQ 9kjBE1RUD8TqoNmds5CVWOLZi0a7Y44u2WuIzMnby6Itejx/4gg6tZl9w WKl79Ys7XyOolfwmKEfAV6UGOFYas0MMfRVQZzsT0xk7APEYP6yiZkW8b tYQcnECHgU8rcnAiZMkqvdCvX3/Mv2V4EhOR0EYsLhJZsOdAUqpXTnxvj vPlbaYFnY3U5A1oFuGkyN9ugraLae/wYd7UsaRNTopvc8bgO9i/z8T04N vxqf91dcNj21MomsTphMuYoDqhQNqff1WZ0oLAB3nddwhGOOVmXj3N2j9 w==; X-CSE-ConnectionGUID: L1z+Km5ISDmMO4IVPevm4A== X-CSE-MsgGUID: jCaEl3FySmmi/+BY2LF19w== X-IronPort-AV: E=McAfee;i="6800,10657,11686"; a="74636638" X-IronPort-AV: E=Sophos;i="6.21,262,1763452800"; d="scan'208";a="74636638" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2026 00:34:12 -0800 X-CSE-ConnectionGUID: yX6dYfmcT+2s6kRnGhVFag== X-CSE-MsgGUID: e/QVe6dWScmc//x1AQWnyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,262,1763452800"; d="scan'208";a="208910066" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2026 00:34:10 -0800 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@linux.intel.com, imre.deak@intel.com, Ankit Nautiyal Subject: [PATCH 06/17] drm/i915/dp_mst: Move the check for dotclock at the end Date: Fri, 30 Jan 2026 13:48:01 +0530 Message-ID: <20260130081812.32087-7-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260130081812.32087-1-ankit.k.nautiyal@intel.com> References: <20260130081812.32087-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. v2: Update status to MODE_CLOCK_HIGH if max_dotclock check fails. (Imre) v3: Drop redundant MODE_OK assignment and return. (Imre) Signed-off-by: Ankit Nautiyal Reviewed-by: Imre Deak --- 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..ec6882af0631 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_CLOCK_HIGH; + return 0; } -- 2.45.2