From patchwork Sat Feb 10 20:27:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 199294 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1643060dyd; Sat, 10 Feb 2024 12:28:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUVPj8+Ajp0kq77Sh02Kj5gs2uG28EEnZEvVNRlUUqGkc6dS4n3RRfVPqiGO5Vytz1dnEu7EJDZqxz5gJxUcD0wtWh1eA== X-Google-Smtp-Source: AGHT+IHavph7Ih4ONuFXzosFI46o1Wfwz8L87SL1TytMDVuwrpbHKjRdI45hSlHQcP243oNnQn+S X-Received: by 2002:a05:620a:51d9:b0:785:bf53:84a2 with SMTP id cx25-20020a05620a51d900b00785bf5384a2mr5094199qkb.7.1707596911014; Sat, 10 Feb 2024 12:28:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707596911; cv=pass; d=google.com; s=arc-20160816; b=YRgJIwF9w0XcyazUhLfBnqE7oJnR3E9uRwUfdZl55UyPjy25B4/fOMZ25INh6zxZgk gyZp9i/kOmtfw9iP/5lNnK/NKTUpo4duoaw48cjorWZYavJguEbc+B3Dfcvj7h8UNfAj 9PtmeAxc5KQm3+1B8gX0co+xu9kw91KqoJDqfFTxZ8cLyNL5cq/W96hxunGfpgcEaduD KW4vwyupIfVAkKNsqOyuX2Jvod/FtQYGpHSg5P/4YFRVxt7Zy3APZo7EydXRHSXNGmAp 5RMxixzKm/MhoNmDOknfWa/7GkPD1nRuAxlU3jU0ff9JhY8xp2Aij7uSqWGG9sqNWusg 9r/w== 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=v/cHZYdb+yD6ktJd09VmLqkStpJ/Uz6jOGoktXVOW1M=; fh=iNdNpZ7gcQYrUpBoH1oZOqAXtjKXEUUiLWYkVMkuIts=; b=o3LvVPBvybA3nOQNAelBnYPeF2Td/xTbNmbv4GtTWXFqOETpXoQ1wg1ENgaiTA60wE 3v25DqVEWdvpA33IqYVbR/ACuOKHqQkGou2EodVex14xPy7QF5G2a3XaCKv6w2+dZizr nEHxBTfOIHrcYkBALrSOiyICj6H3gR9V/KDxu20Cj3iSrzWxrCfUkjqjV3ugo1lXl9gF in9B6iaUCY/pxuX2pjjxvVOBVIhCXAb9azDK08raDXjWuVezLHCdi74zNj3dkqKPCe/q HAb5ba5lUIDQz5r6Ug9HY59xDXQGRw+DBM5UPlPD6AnAt0ipOy6AorooHXl3vhZshViL bsGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=l91tVzqp; 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-60533-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60533-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCV5C6fgEWBn03+lM6bRWnE3AHCYDuOXTFTZDA6AVGCqENnm5tF1G7cKvlWC7nSEc+oTTklBhTW3j5yuE8hv/4iNSIWsCw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w5-20020a05620a444500b00785cf9e501bsi341836qkp.79.2024.02.10.12.28.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 12:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60533-ouuuleilei=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=l91tVzqp; 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-60533-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60533-ouuuleilei=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 BB7421C22DD0 for ; Sat, 10 Feb 2024 20:28:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 448825FB82; Sat, 10 Feb 2024 20:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="l91tVzqp" 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 878BC5F861 for ; Sat, 10 Feb 2024 20:28:13 +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=1707596895; cv=none; b=abJF2k4ELuKflSDKa7Ow25C/yOPovnXq9xQWO35jXvjpAqp71KOWZNJMacV7T14KBp0CO4twAAy4CmEc+WpTISxJAjB6Rm0GncWJkXE4nnCWKVmGImWJfZQS942V/hrgB7I+w/iMc0HKQ80YLe/fdBsmAUnfzQvyKXMBt5ZQmwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707596895; c=relaxed/simple; bh=2pqBBIQmd6ebpm+PQGWmUYVZ0kfID7R/bCeAsQMQGaE=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=PP2VoyxK3bhRs22RrM08hFT7BiKKi4j+F3U0LlOXVi9K52rxp/uPObEvKW95CJkU8dURD8+uJvQ4xeabd0lpaI7kXK2JNn5ChzKhaqe75njQfwZTUVYTBhFqg4ELjctdH0o1Rre0gkDMNoqKaEX8ISTdwSGgGntkCfey5NrX674= 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=l91tVzqp; 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 (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41AJs3jj006466; Sat, 10 Feb 2024 20:27:54 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=v/cHZYd b+yD6ktJd09VmLqkStpJ/Uz6jOGoktXVOW1M=; b=l91tVzqp06a0sFLYEJ+fokP CcgOjWtaY6+2KuLp2BxKIrQ4bSME7MUk7ieC6PPCEHgY5Q+J7ZYuqW4GPdT6b7/Z 5hBDAN2BvBCM11fyNEXEQB5T7C4xuqB5p6+8m/Q0jNZaDwFN1tINdvIR196OXXLT yGEEZ2ni31GxQcDxL2vn539b8c2T+/nVsREZUvZ+CUPZo9AAgoT5MUp3tJewM3N+ u7a95jhPL5HGnNECBi+4TGTzuMMlZrahcPSuopQW6iPvsCZuJ/bf5fbwQgPjJp2b 3rDofCRizAWdQsXm3OboRTaBjNRQ2krwuzXub6sF2H0UJzFpfvsVXp5nRlIQJow= = Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w62r10wvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Feb 2024 20:27:54 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41AKRS7V000637 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Feb 2024 20:27:28 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; Sat, 10 Feb 2024 12:27:27 -0800 From: Abhinav Kumar To: , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: Paloma Arellano , , , , , , , , Abhinav Kumar , Subject: [PATCH v3] drm/dp: add an API to indicate if sink supports VSC SDP Date: Sat, 10 Feb 2024 12:27:04 -0800 Message-ID: <20240210202704.977303-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 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: Xvou_y2_4PkG3udCr1hAp2zOZhzv3XWl X-Proofpoint-ORIG-GUID: Xvou_y2_4PkG3udCr1hAp2zOZhzv3XWl 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-10_19,2024-02-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 priorityscore=1501 bulkscore=0 clxscore=1011 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402100171 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790545138164475805 X-GMAIL-MSGID: 1790545138164475805 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 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 | 21 +++++++++++++++++++++ include/drm/display/drm_dp_helper.h | 1 + 2 files changed, 22 insertions(+) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index b1ca3a1100da..7a851f92b249 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -2916,6 +2916,27 @@ void drm_dp_vsc_sdp_log(const char *level, struct device *dev, } 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 (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 (dpcd[DP_DPCD_REV] >= DP_DPCD_REV_13) && + (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 863b2e7add29..948381b2b0b1 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -100,6 +100,7 @@ struct drm_dp_vsc_sdp { void drm_dp_vsc_sdp_log(const char *level, struct device *dev, 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]);