Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp519065pxb; Wed, 3 Mar 2021 08:45:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+Ad3994anzdgydIGtbifiuYg6bTGfT7crhBxpavFZfBRVfIS9NCOE5lpVWtYBtObvAFQT X-Received: by 2002:a50:e14d:: with SMTP id i13mr175543edl.106.1614789915247; Wed, 03 Mar 2021 08:45:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614789915; cv=none; d=google.com; s=arc-20160816; b=AfldS49ojEAs7CgM3T3hx0cPRt8mAQQYw+SKZOre/HhEtibBYVa/jaLnsewiEBVIa1 s/YOXoDiPl5zJ0qpwz9LmqXOejIaFTfOwQsmio56yKwOBxrpAdT/+toRjk2CFD0Su69r 8JcwUUXnnRlYpIT1pWKq7h6gcCq5CRV8cntAUVJebCwXwS4u7ob7Xv35MR0D4HMODZGR jT8tPeoHFUuWa76TG/VWsZA17YnbxnHQNH9U0M/9KY4VmVHnybG/YRn74OvwJZn35ih8 6D06LxTyzmGEIEJOi8j8Xev0gES4eIyn6hbe83HO+1cRqHxFq3SImBy90/Ee/OiUnV9Z 98Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u6TiPMXxPSixPa0s5KiJuqjbN+uGdJzo7Em4rqEIP3c=; b=Phi1w4vFrqtxIsYRtyItm/m6QlOzCLgXP4bs32nhRQ4R1lDrp2T6/L7AVAO5cszw14 9bZkTJIc1LuE70pOnokRNXLhAmJwUUrS+YEfwZzKvE01pIq/Etdex9yso/STdskta8WG 0BpTrId1KnHlQP3Np8TEhBL8k5LLMNSOSyJ3/Fvvx/1n8LmdHz/wFMD4y+p8cvbf3JHD LhxwL4/yuMH+N7lvU9QXPSU5wGVgoUPeD4rn/u0lkVw6PqKqGEzlyVhiaIFtJxJ9KsH2 qda2+2wmvpoMWubj4heoaR6n+i4PZi9DoitAAqqY/MAGKNBeJN1wFRrXGi9+RezrX0Jp Qr1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NDhmzQGX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se21si10882253ejb.558.2021.03.03.08.44.36; Wed, 03 Mar 2021 08:45:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NDhmzQGX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344785AbhCBAQh (ORCPT + 99 others); Mon, 1 Mar 2021 19:16:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:39702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239455AbhCASXi (ORCPT ); Mon, 1 Mar 2021 13:23:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 495A36519C; Mon, 1 Mar 2021 17:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618701; bh=NWJZ+y+RcQaxdN11nhfvGskzmOpwM2ZJooPyHvgrX6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NDhmzQGX13aZZIEV5SUky8iYi1ci1pNNKDsmIwC3d3vlIWII5GF1bqgJBvjkr5fSR nHsjw+sgf+PtkJnRmyPsktWF+cjOiGcdUTXufE3AOe6+iVd/K8pjFxDOhECaYzbywG bWzL318yMXD8Adxf0OIO9H8ejsOxKZQOehNkA/gU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mario Kleiner , Harry Wentland , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 185/663] drm/amd/display: Fix 10/12 bpc setup in DCE output bit depth reduction. Date: Mon, 1 Mar 2021 17:07:13 +0100 Message-Id: <20210301161150.932586476@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mario Kleiner [ Upstream commit 1916866dfa4aaceba1a70db83fde569387649d93 ] In set_clamp(), the comments and definitions for the COLOR_DEPTH_101010 and COLOR_DEPTH_121212 cases directly contradict the code comment which explains how this should work, whereas the COLOR_DEPTH_888 case is consistent with the code comments. Comment says the bitmask should be chosen to align to the top-most 10 or 12 MSB's on a 14 bit bus, but the implementation contradicts that: 10 bit case sets a mask for 12 bpc clamping, whereas 12 bit case sets a mask for 14 bpc clamping. Note that during my limited testing on DCE-8.3 (HDMI deep color) and DCE-11.2 (DP deep color), this didn't have any obvious ill effects, neither did fixing it change anything obvious for the better, so this fix may be inconsequential on DCE, and just reduce the confusion of innocent bystanders when reading the code and trying to investigate problems with 10 bpc+ output. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Mario Kleiner Cc: Harry Wentland Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c index 2a32b66959ba2..e2e79025825f8 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c @@ -601,12 +601,12 @@ static void set_clamp( clamp_max = 0x3FC0; break; case COLOR_DEPTH_101010: - /* 10bit MSB aligned on 14 bit bus '11 1111 1111 1100' */ - clamp_max = 0x3FFC; + /* 10bit MSB aligned on 14 bit bus '11 1111 1111 0000' */ + clamp_max = 0x3FF0; break; case COLOR_DEPTH_121212: - /* 12bit MSB aligned on 14 bit bus '11 1111 1111 1111' */ - clamp_max = 0x3FFF; + /* 12bit MSB aligned on 14 bit bus '11 1111 1111 1100' */ + clamp_max = 0x3FFC; break; default: clamp_max = 0x3FC0; -- 2.27.0