From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D660D281349; Thu, 13 Feb 2025 14:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739457734; cv=none; b=cfmlht/y3IKewnt6rcY2beKbjY5fbdZM/cOX1YlNLNzYaXiF0OmGoK6jhxKaMsGehSX4ZTQIFr5cwiIxoR6f2dProRLxYrc0CObConANz74Y3pi6KVD2D8NDBWe8qkbMFVExD/HkrDCrBzYPRY7Xe2VDjz9zzYzhI/MVldfZhEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739457734; c=relaxed/simple; bh=u99RCkfBcaYhHWoFSxgeT1FzRgn3YFgfkCdOJqhzM4w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GFKlOjTe3sQu+X1YqLJymUhNygArDak0tvkP6kQ1nF79i0eFClMT+ojz9gnHSof3h3LzUtwi53VHA8v9t1QScjvZwDe5rSTcUfN0JstNNBsU9Z27YVYSuI5hba0U4PnhEZlGsr3u0pY9rDBT1CG1pCztKokCNYFG+9aWS/2oTQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gbCAPzbl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gbCAPzbl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4322BC4CED1; Thu, 13 Feb 2025 14:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739457734; bh=u99RCkfBcaYhHWoFSxgeT1FzRgn3YFgfkCdOJqhzM4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbCAPzblqHKwTiHRpbRlaoUsnajcQdjgE8eTX/SRKEVQatySGq3StdSRZlcmW6oIP AyxuOY1vnV/CdM5q685NBEysDbHZjDmBFiaZIyzZbUYLfhy3JWYhKXUUK/daWmFum6 IM9rNQI3eK93PQ2+2KP6JGcbJ1Gd4v3D7tmmu5jU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ankit Nautiyal , Imre Deak , Jani Nikula , Rodrigo Vivi Subject: [PATCH 6.12 166/422] drm/i915/dp: Iterate DSC BPP from high to low on all platforms Date: Thu, 13 Feb 2025 15:25:15 +0100 Message-ID: <20250213142442.949162438@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213142436.408121546@linuxfoundation.org> References: <20250213142436.408121546@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jani Nikula commit 230b19bc2bcc5897d0e20b4ce7e9790a469a2db0 upstream. Commit 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best compressed bpp") tries to find the best compressed bpp for the link. However, it iterates from max to min bpp on display 13+, and from min to max on other platforms. This presumably leads to minimum compressed bpp always being chosen on display 11-12. Iterate from high to low on all platforms to actually use the best possible compressed bpp. Fixes: 1c56e9a39833 ("drm/i915/dp: Get optimal link config to have best compressed bpp") Cc: Ankit Nautiyal Cc: Imre Deak Cc: # v6.7+ Reviewed-by: Imre Deak Reviewed-by: Ankit Nautiyal Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/3bba67923cbcd13a59d26ef5fa4bb042b13c8a9b.1738327620.git.jani.nikula@intel.com (cherry picked from commit 56b0337d429356c3b9ecc36a03023c8cc856b196) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_dp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2022,11 +2022,10 @@ icl_dsc_compute_link_config(struct intel /* Compressed BPP should be less than the Input DSC bpp */ dsc_max_bpp = min(dsc_max_bpp, pipe_bpp - 1); - for (i = 0; i < ARRAY_SIZE(valid_dsc_bpp); i++) { - if (valid_dsc_bpp[i] < dsc_min_bpp) + for (i = ARRAY_SIZE(valid_dsc_bpp) - 1; i >= 0; i--) { + if (valid_dsc_bpp[i] < dsc_min_bpp || + valid_dsc_bpp[i] > dsc_max_bpp) continue; - if (valid_dsc_bpp[i] > dsc_max_bpp) - break; ret = dsc_compute_link_config(intel_dp, pipe_config,