Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1218903rdd; Wed, 10 Jan 2024 12:20:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaaAaYb+5sASnkLohtk314KK8W14NUf2pY+plrM9RzjYf89ZusWla6eR46tYnY0T7DTujy X-Received: by 2002:a05:620a:298c:b0:783:22ff:6907 with SMTP id r12-20020a05620a298c00b0078322ff6907mr211558qkp.94.1704918025197; Wed, 10 Jan 2024 12:20:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704918025; cv=none; d=google.com; s=arc-20160816; b=erKWfF2vUyDnIjP1MYIP7iPZQIVnpZk9tIgko95RrOu8dZ7esraGnkga8GBnkD+vhW cE0axF17atA/0IsDFXA+0bbN1MaAM6fsKmOJtcK228L7w8hLzWV+NEUIvezdYtvXnOdH yeLkHcncSR1nRQV+jgPfp4y8OXUBNHTCp3W89VlWZczjfBEUSD+8qwG1iQTUbaoOPBE8 euo0Hj2vcHbHQXXpaECk/wa+Eay/CppXaDr9tRWeGjtw1Rz2/mORT/Dc4h9PTNQGS5sF 02OtpUcPEF6f3MnT0Mg6w3YWKsCUCHXWMaSJ3+dWiZkL3cThTgT1e4wzkIeVnOCKPkN5 lfDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=9d90W4iJWF7jqcBZ4FKEQANwVRt3HQPhs2xgEDbD1y8=; fh=WdvorNt9W2LCUPiGPsn75/bW5381IkpXRxF82JgZV7c=; b=tL5jEYchzmiOB/9tOv1kGJdQzEeJ6Db5QWXMbBKwMgrvEC4ZLbiCM3raqhKz4Ojqpu e1eJHOqTHKxY+vvG8fOtl1EW4qeE2lN2I7kRtP4WNqNinFYZD6uOPle77ANhPBucRAAj lEJIdwwJzIuNwaTknuNgek38nsWC1kO7PqTyce4BCTWrZjjdtli3a2qGxw1aQY0cIde1 xlTonnEDD3S2eJ7+CJ0ccD5svbT8ycxEk/1lvdSdyq5bb7wcKRa0+6FWIbiGhrZBIZRg rS20Z2Pki277dKTVgId5/3P+tkZCLXVwT5eZO6ie5vboOYU2gTqpRnql/jl8PXHGCC+2 Ob5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=U+RFZJhg; spf=pass (google.com: domain of linux-kernel+bounces-22720-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l10-20020a05620a28ca00b007833cc59684si608224qkp.742.2024.01.10.12.20.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 12:20:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22720-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=U+RFZJhg; spf=pass (google.com: domain of linux-kernel+bounces-22720-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EE27F1C20F90 for ; Wed, 10 Jan 2024 20:20:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BFF24F8B3; Wed, 10 Jan 2024 20:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="U+RFZJhg" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 657AC4F8A6; Wed, 10 Jan 2024 20:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40AE7q6b023231; Wed, 10 Jan 2024 20:19:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=9d90W4iJWF7jqcBZ4FKEQANwVRt3HQPhs2xgEDbD1y8=; b=U+ RFZJhgLwImXzLAjBH7Usng05ZRt44yg91qs7cKKvxB0Rsuai79siRTsjJN1GiGF1 BHgbfLWHwsrMyuqDpOnAiZkW3g+F6e4wSdrrubI8lwzRU3YUy3DPN0b3HOaPlirr IC9lPnLeqXgL/4ATc6Ev0izswCR39X6yJ3c//qPI0wJCiLapxBCP6w/47S7OYMnI xWdj5sJJGw5ypXP4Cy892tnwjJAbDX4yLh1JBCsUqvCTwD23iDV9BmxzQoFIpXM5 t/yzL1jZceP+MMgTL0AOn2fOFVpT8Ol965LLMuEN2PARKb1TZCjJAdA8ud04Q/61 akAcOblTYJvkeVFGLIJg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vhvqw0ved-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 20:19:02 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40AKJ1kb003610 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 20:19:01 GMT Received: from khsieh-linux1.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 10 Jan 2024 12:19:01 -0800 From: Kuogee Hsieh To: , , , , , , , , , , CC: Kuogee Hsieh , , , , , , , Subject: [PATCH v1] drm/msms/dp: fixed link clock divider bits be over written in BPC unknown case Date: Wed, 10 Jan 2024 12:18:51 -0800 Message-ID: <1704917931-30133-1-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: uKZ18sJxBgQjss57yMUqgS4tHL3X3cq3 X-Proofpoint-ORIG-GUID: uKZ18sJxBgQjss57yMUqgS4tHL3X3cq3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401100161 Since the value of DP_TEST_BIT_DEPTH_8 is already left shifted, in the BPC unknown case, the additional shift causes spill over to the other bits of the [DP_CONFIGURATION_CTRL] register. Fix this by changing the return value of dp_link_get_test_bits_depth() in the BPC unknown case to (DP_TEST_BIT_DEPTH_8 >> DP_TEST_BIT_DEPTH_SHIFT). Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_ctrl.c | 5 ----- drivers/gpu/drm/msm/dp/dp_link.c | 10 +++++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index 77a8d93..fb588fd 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -135,11 +135,6 @@ static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl) tbd = dp_link_get_test_bits_depth(ctrl->link, ctrl->panel->dp_mode.bpp); - if (tbd == DP_TEST_BIT_DEPTH_UNKNOWN) { - pr_debug("BIT_DEPTH not set. Configure default\n"); - tbd = DP_TEST_BIT_DEPTH_8; - } - config |= tbd << DP_CONFIGURATION_CTRL_BPC_SHIFT; /* Num of Lanes */ diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c index 98427d4..b8caa5b 100644 --- a/drivers/gpu/drm/msm/dp/dp_link.c +++ b/drivers/gpu/drm/msm/dp/dp_link.c @@ -1179,6 +1179,9 @@ void dp_link_reset_phy_params_vx_px(struct dp_link *dp_link) u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp) { u32 tbd; + struct dp_link_private *link; + + link = container_of(dp_link, struct dp_link_private, dp_link); /* * Few simplistic rules and assumptions made here: @@ -1196,12 +1199,13 @@ u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp) tbd = DP_TEST_BIT_DEPTH_10; break; default: - tbd = DP_TEST_BIT_DEPTH_UNKNOWN; + drm_dbg_dp(link->drm_dev, "bpp=%d not supported, use bpc=8\n", + bpp); + tbd = DP_TEST_BIT_DEPTH_8; break; } - if (tbd != DP_TEST_BIT_DEPTH_UNKNOWN) - tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT); + tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT); return tbd; } -- 2.7.4