Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp663643rdb; Thu, 15 Feb 2024 11:16:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9hwSSks21U1a+zgN2kVfh6WFXmRkkYLaoImapjVTiKBEgCNnmpW90+EEUTM2aoofP9MPo6DDug3FMD2mNvxkoMS1JcLSqkJLQmMU+Sw== X-Google-Smtp-Source: AGHT+IHidX1m24hwCB6mHtkEM4sODqjJZsEVL0VWnUn9CSeI0etrRe+/NM91xFErrN/RisoruBB9 X-Received: by 2002:a0c:e38e:0:b0:685:f7e3:7085 with SMTP id a14-20020a0ce38e000000b00685f7e37085mr2645340qvl.42.1708024586259; Thu, 15 Feb 2024 11:16:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708024586; cv=pass; d=google.com; s=arc-20160816; b=vSbY/Xvle53HF0htjoiMOixtQmwWWoGJeh6l55wP4y62S/pGwqqP99HJrBqVKzDpYU okfzi8x86S63CwoTbrs6ikvKuNv8PdUdV9MBmQgGKdHedms3tXHjQbNhot516eVFs86X 6scUlybixX7kMxg8u5crV3DF52xG/kPmwTXt5JuTIrwJ6kNPFFixFELoI1M6x3Cps7f7 HOqwiWSYTYP8Ywlrad3sjm6uShuv0+CQVzHNDnlUkuT7Hh+4tWz8/Y8M0r6ERRDpgDUb z5Z1rRfCRpYS5bl2feoumukhqhqLmYeJWQFdZ0Ck2M/XXL6m/JwQnXCKf1AFTC49L0LH A8xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=5JKqmrkfJABfYZUDeP6CxLqjc+esD9/niU7UB8pF9iE=; fh=J99tlxG/5JIBW4Y9gfiI+tvh4+MXKBqvlZZ1rcRSb3g=; b=UTC4sm5QsGs06vL2eaZ3vmhfT01KjrQbhn6ghsccySgdqlQGVrXKO2GvmcKV0coNce qeMzHuG0nWXqodzOvSQJ+20YLsFszB9jaFqSGVj4r8fTTSOZ2ji6uTdgvlujECNdgc3k SJnbVatg9um9gNyZ1/bhZT47Cmon7k65yLQ3j7TXHqUoNOUKk/DWG+896v03E/sp04Af 9LpB+qqcJsxc/czBGU1F72aETbO2MeBX6lw+sJ9M0AUYltkVdx+s30/AJUfewDhcCmT4 vziG1gjMX6koKePdSd1ncbyPkU382Ph8FdS9qJIcHlm6PP4ldGf9lRK3a8Ezg0LlvwiF u+Qg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IPDFJBIj; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-67561-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67561-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e2-20020a0562141d0200b006817d997962si2160988qvd.130.2024.02.15.11.16.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 11:16:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67561-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IPDFJBIj; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-67561-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67561-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 0764A1C22AA2 for ; Thu, 15 Feb 2024 19:16:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AACB413957C; Thu, 15 Feb 2024 19:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="IPDFJBIj" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 46A10139563 for ; Thu, 15 Feb 2024 19:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708024580; cv=none; b=dcb/di1sD/7IJQhBEOgcJaxLJQrJs3smQgG7PQ7G8E2m7S6UhhhgrAlt6seBfmM/HUJd7VE8qPxliPAHuuX5dJsrD4jWcgxApgp60vfi/Qiu2j9hO8CVS02G6sM4IWFHg+Jcgy+tBzvI8ofuTp0saGC3GuzSW2D/turlLWFllp4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708024580; c=relaxed/simple; bh=A5vfHKGPj12dTNIK/i4MDdUnEZY45MV3bb0G7KPm7SM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=gZ0m+7PfFi0F287yX+Hlgih6N1lyQQoEU9yKhAvSjJnqkSSkFt9+ICJDIH7EKwzs28FFPz+thR2UI0It/bO4Hg6dTGi68Ujj9TTNvehotytywKmBgNiWr/nVfDDbM7epKFC7gEwhZlGzH28VzwJhX3+4o0EBuUBbDHSP0X50OVw= 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=IPDFJBIj; arc=none smtp.client-ip=205.220.180.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 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41FIhcOV028350; Thu, 15 Feb 2024 19:16:09 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-transfer-encoding:content-type; s=qcppdkim1; bh=5JKqmrk fJABfYZUDeP6CxLqjc+esD9/niU7UB8pF9iE=; b=IPDFJBIjt6eQ3pMXlX7H4MJ Jy8ekGzdDGT/b3K9EY2X+c42Jj8vaCoCZunrr764X61cxU4Dvs7Y8gBgnyccLaF9 SPYsw8VMllI26tQfEPNhHCsIGCbZ3vak6PZ2vFZwM0mn3JHcOeHCIANeBDm1qtUn 86BfRWY7WK1xl5ANFJhhHEnpBdeWfHDybRM5N0+02638dnPepqaQopD8uWumOpYL fSvNIMKiRWgChbdUfWnDmd6FoS1yGF7SBpRJc/GziIWQeBp+arbqGPw8F+9aqAhc fybf/O9Y7y+4uLF6Mk6sqVYTvxMNZNveZSN/xfHX3EFVq3ytL9ynqqmnmlVuFoQ= = Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w9fkf9s4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 19:16:08 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41FJG7NR021010 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 19:16:07 GMT Received: from abhinavk-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; Thu, 15 Feb 2024 11:16:06 -0800 From: Abhinav Kumar To: , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: Paloma Arellano , , , , , , , , Abhinav Kumar , Subject: [PATCH v5] drm/dp: add an API to indicate if sink supports VSC SDP Date: Thu, 15 Feb 2024 11:15:56 -0800 Message-ID: <20240215191556.3227259-1-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-ORIG-GUID: 06Dg6ymyuWe8JYZebRgPmoLvB9lxHZX7 X-Proofpoint-GUID: 06Dg6ymyuWe8JYZebRgPmoLvB9lxHZX7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_18,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402150154 From: Paloma Arellano YUV420 format is supported only in the VSC SDP packet and not through MSA. Hence add an API which indicates the sink support which can be used by the rest of the DP programming. changes in v5: - rebased on top of drm-tip changes in v4: - bail out early if dpcd rev check fails changes in v3: - fix the commit title prefix to drm/dp - get rid of redundant !! - break out this change from series [1] to get acks from drm core maintainers Changes in v2: - Move VSC SDP support check API from dp_panel.c to drm_dp_helper.c [1]: https://patchwork.freedesktop.org/series/129180/ Reviewed-by: Dmitry Baryshkov Signed-off-by: Paloma Arellano Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/display/drm_dp_helper.c | 23 +++++++++++++++++++++++ include/drm/display/drm_dp_helper.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index 8d6ce46471ae..61b11cb45245 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -2913,6 +2913,29 @@ void drm_dp_vsc_sdp_log(struct drm_printer *p, const struct drm_dp_vsc_sdp *vsc) } EXPORT_SYMBOL(drm_dp_vsc_sdp_log); +/** + * drm_dp_vsc_sdp_supported() - check if vsc sdp is supported + * @aux: DisplayPort AUX channel + * @dpcd: DisplayPort configuration data + * + * Returns true if vsc sdp is supported, else returns false + */ +bool drm_dp_vsc_sdp_supported(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + u8 rx_feature; + + if (dpcd[DP_DPCD_REV] < DP_DPCD_REV_13) + return false; + + if (drm_dp_dpcd_readb(aux, DP_DPRX_FEATURE_ENUMERATION_LIST, &rx_feature) != 1) { + drm_dbg_dp(aux->drm_dev, "failed to read DP_DPRX_FEATURE_ENUMERATION_LIST\n"); + return false; + } + + return (rx_feature & DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED); +} +EXPORT_SYMBOL(drm_dp_vsc_sdp_supported); + /** * drm_dp_get_pcon_max_frl_bw() - maximum frl supported by PCON * @dpcd: DisplayPort configuration data diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h index d02014a87f12..36351f3cdba9 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -100,6 +100,8 @@ struct drm_dp_vsc_sdp { void drm_dp_vsc_sdp_log(struct drm_printer *p, const struct drm_dp_vsc_sdp *vsc); +bool drm_dp_vsc_sdp_supported(struct drm_dp_aux *aux, const u8 dpcd[DP_RECEIVER_CAP_SIZE]); + int drm_dp_psr_setup_time(const u8 psr_cap[EDP_PSR_RECEIVER_CAP_SIZE]); static inline int -- 2.34.1