From patchwork Wed Jan 17 17:54:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuogee Hsieh X-Patchwork-Id: 764308 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 C703723749; Wed, 17 Jan 2024 17:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705514094; cv=none; b=YJjJOrg4uWsHeq0bLIqmckPgO4I+8fsEU95Nz5sSdCNQJdvOd8/UaXGaLGsikh6Xd5cmrfnMb3sbvVl0+OfzZgKJTsxKI+tg0246DS7iWt5iWkPXO1zwcKq6/oczU0zQsFT1riNcXp/Mg2nLJSGUtdy5vZV341vvYA9fpmWgAdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705514094; c=relaxed/simple; bh=8Zr+Vt2zIt77uVRKz8vBoqrxgLA43CxcBPkPt1PifHw=; h=Received:DKIM-Signature:Received:Received:Received:From:To:CC: Subject:Date:Message-ID:X-Mailer:MIME-Version:Content-Type: X-Originating-IP:X-ClientProxiedBy:X-QCInternal: X-Proofpoint-Virus-Version:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; b=D3NOuC1WjhTkScnpgUeiTZlzSdV/fYThqs2l7M3PleFhL5AWzToUBfJhMOSjTx7zBcpXTEsOFXBrtqPIPvoodNvHv1H9vnWWgIprPy1vbEHHlPpvszPQTwBnF1jLvtYwvTwObY2oTxyOYJa7Zjj77wL3ZlWZ9ermKQ4UeSiA4qo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=XCBUM95T; arc=none smtp.client-ip=205.220.168.131 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="XCBUM95T" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40HCiwhB028384; Wed, 17 Jan 2024 17:54:38 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=Jqz0ufGKLuoj0EpzY4PrPet3WRBB9IFgOwd18dIBjH8=; b=XC BUM95T+RtZMCUgm+5JCgpZkNkEFjwjAgimkOzgBrUK6ya3lqWEiIT5CXIsP/f5lz umn2+irs/xrXVIVNi9czvX62TssSze5EaeUR0s/sRpTMa7fSDbR4NUsq9BAwmOKf uhmkNwiKcwpChFYomQkrfypzsLd841PTXlKyR2sMN/MrXCkbGsalJeSECLUd6qKi RQPfm86EF0DZoysu7CpmlbKeo2mZGmOGrQQF9LRQo3Ps020wly7trXrL4KuG7s9+ IEJiYenAmTnkS4Xrvoq72bLh7ihk0CjhjMecSSZW3OvwZ3Ck33jmxQdFs2+2mTLu Ia/DF1jGP6fyDvFL5U2w== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vpdfgrxm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 17:54:37 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40HHsaBP005846 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 17:54:36 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, 17 Jan 2024 09:54:36 -0800 From: Kuogee Hsieh To: , , , , , , , , , , CC: Kuogee Hsieh , , , , , , , Subject: [PATCH v2] drm/msm/dp: correct configure Colorimetry Indicator Field at MISC0 Date: Wed, 17 Jan 2024 09:54:28 -0800 Message-ID: <1705514068-22394-1-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: C4JkQLmb9MX4lGQMlg2TYdOAnw2WlCCt X-Proofpoint-ORIG-GUID: C4JkQLmb9MX4lGQMlg2TYdOAnw2WlCCt 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=2024-01-17_10,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170130 MSA MISC0 bit 1 to 7 contains Colorimetry Indicator Field. At current implementation, at DP_TEST_DYNAMIC_RANGE_CEA case the Colorimetry Indicator Field is mistakenly left shifted one extra bit. This patch return correct value of colorimetry at dp_link_get_colorimetry_config() to fix this problem. Changes in V2: -- drop retrieving colorimetry from colorspace -- drop dr = link->dp_link.test_video.test_dyn_range assignment Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_link.c | 11 ++++++----- drivers/gpu/drm/msm/dp/dp_link.h | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c index 98427d4..2e1bdaf 100644 --- a/drivers/gpu/drm/msm/dp/dp_link.c +++ b/drivers/gpu/drm/msm/dp/dp_link.c @@ -1082,7 +1082,7 @@ int dp_link_process_request(struct dp_link *dp_link) int dp_link_get_colorimetry_config(struct dp_link *dp_link) { - u32 cc; + u32 cc = DP_MISC0_LEGACY_RGB; struct dp_link_private *link; if (!dp_link) { @@ -1096,10 +1096,11 @@ int dp_link_get_colorimetry_config(struct dp_link *dp_link) * Unless a video pattern CTS test is ongoing, use RGB_VESA * Only RGB_VESA and RGB_CEA supported for now */ - if (dp_link_is_video_pattern_requested(link)) - cc = link->dp_link.test_video.test_dyn_range; - else - cc = DP_TEST_DYNAMIC_RANGE_VESA; + if (dp_link_is_video_pattern_requested(link)) { + if (link->dp_link.test_video.test_dyn_range & + DP_TEST_DYNAMIC_RANGE_CEA) + cc = DP_MISC0_CEA_RGB; + } return cc; } diff --git a/drivers/gpu/drm/msm/dp/dp_link.h b/drivers/gpu/drm/msm/dp/dp_link.h index 9dd4dd9..fe8f716 100644 --- a/drivers/gpu/drm/msm/dp/dp_link.h +++ b/drivers/gpu/drm/msm/dp/dp_link.h @@ -12,6 +12,9 @@ #define DP_TEST_BIT_DEPTH_UNKNOWN 0xFFFFFFFF #define DP_LINK_CAP_ENHANCED_FRAMING (1 << 0) +#define DP_MISC0_LEGACY_RGB 0 +#define DP_MISC0_CEA_RGB 0x04 + struct dp_link_info { unsigned char revision; unsigned int rate;