From patchwork Tue Dec 12 20:52:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 177584 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7995734vqy; Tue, 12 Dec 2023 12:53:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQmcTf+Dxkt73KT6cF7WY6XxSxxQlVJAkgdHcC+nD+Q7qvfXkzwyesT06IG08qzwl8DoZw X-Received: by 2002:a05:6a20:bc88:b0:18f:97c:4f71 with SMTP id fx8-20020a056a20bc8800b0018f097c4f71mr3121928pzb.125.1702414413466; Tue, 12 Dec 2023 12:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702414413; cv=none; d=google.com; s=arc-20160816; b=xpTabeuy1EAUofUKnbmOdbyViLKswlyX6YyZbxaF5blxsznA0xxB4FhuYTiXBTitmD 5GaNEOaTmLPYsaGzn8yYSQW/2fadzkq27kNNO0U2fNh9CmeH1vE29ar3M0El54sNcRX/ gAD6d2GODdGAINShLD+403wYAkZnuuuWMDcV1Bqw/bHp09Ns65dn0dVq/YntE6bzjUYo bNjGIkNKiVqZqt2RAV6oT0B20p6zEvU2WUSwKqHlqPNPGFcF6KglLzZCxw1ooxtt6xXv F2+LvoZDidF88oFzLS6arFjhCduDpLXjXous3Lq+h69NIS1cVp+pyIDiXhKx1F8ch35S 8ZCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I8JxpzJTIhZueOaTm1JVOmTswxeZbGbq/+/lDORy+gA=; fh=2XyQDqDG0wz2VEIrVbLmdsbSBBAARfl7BOJG4nJ/HZo=; b=1G/uLGS8YkX4ACNammI8qR/1Q4C4LU2TAAfr3KQvEkTtm1+56TVdNZEp0KGIelDtph Da7ST77E1Kww4gvZE0Rj5auZBAHDLI8y0wYtOdZOK2fJRrUfUxMlI52gBLsty/srB7Xf TmC2Z0R/U8xjLmbF1RPcf5QCl5xiXz4KyP+ni3/GddYO2V4jZf/Fl7nsNSQ9orDZK0Qd z8cmlJtjW3x72Go/QLHETWVhcZrrH8hbEuRWtXwuUvQEIMgASWdCRV/gw6DFa1T22Ili b5gqkRFBYCDN7dObjhRIGlHK4tGai1UdX3KLhLC/MIwyEIulmzHUa7OkNd0rUPuQB9SR f3bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=L8GHeJmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a2-20020a17090abe0200b00286a1497c76si8402426pjs.21.2023.12.12.12.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 12:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=L8GHeJmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1F2D980B1803; Tue, 12 Dec 2023 12:53:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377344AbjLLUxS (ORCPT + 99 others); Tue, 12 Dec 2023 15:53:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377396AbjLLUxJ (ORCPT ); Tue, 12 Dec 2023 15:53:09 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A55F0D7E; Tue, 12 Dec 2023 12:53:15 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BCKZNbg004462; Tue, 12 Dec 2023 20:53:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=I8JxpzJTIhZueOaTm1JVOmTswxeZbGbq/+/lDORy+gA=; b=L8 GHeJmCb8Ye0uWrnCOnQ3CI4fi7MJ8kIRhwKSgiiIHnPcjibNp5sANZpyQL0toTlZ 7bsa08XmY1Ly+CYCSSrQHvBNAsyecnPRpDsuTREBLLuXaypi4KbqOqrReUU4PP/w srSy5ILUV7FOZn9TtKBd8rGzaVk6hq9M/MbMJT4Kc3W8gSuMLRxL+O2nHk8iNI3n J89rwDVPgCYpbuxGp4sKzkS7zTyV/85xMkitgabzOls2jlOo3qME88i4ZnfVSzTK VexQf11R1RT5pmMrqU+fKpS7aS6kyWoQC/IJpYMd58koWrLlN6Q4gZ1Y1IVPml7I ggOX9UpeHOHA0UWncwWQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uxpsu9aje-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 20:53:08 +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 3BCKr7KL011034 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 20:53:07 GMT Received: from abhinavk-linux.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; Tue, 12 Dec 2023 12:53:06 -0800 From: Abhinav Kumar To: , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Daniel Vetter" CC: , , , , Subject: [PATCH v4 01/15] drm/msm/dpu: add formats check for writeback encoder Date: Tue, 12 Dec 2023 12:52:39 -0800 Message-ID: <20231212205254.12422-2-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231212205254.12422-1-quic_abhinavk@quicinc.com> References: <20231212205254.12422-1-quic_abhinavk@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] 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: mph1PjfYY2QowukgFhXKUSPc8-IP9QtB X-Proofpoint-ORIG-GUID: mph1PjfYY2QowukgFhXKUSPc8-IP9QtB 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_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312120161 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 12:53:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785110895891286775 X-GMAIL-MSGID: 1785110895891286775 In preparation for adding more formats to dpu writeback add format validation to it to fail any unsupported formats. changes in v4: - change the failure message of the API drm_atomic_helper_check_wb_connector_state() to a generic one in case it checks more errors later and moreoever it already has debug message to indicate its failure - change the corresponding DPU_ERROR to DPU_DEBUG in-line with other atomic_check failure messages changes in v3: - rebase on top of msm-next - replace drm_atomic_helper_check_wb_encoder_state() with drm_atomic_helper_check_wb_connector_state() due to the rebase changes in v2: - correct some grammar in the commit text Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c index bb94909caa25..4953d87affa1 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c @@ -272,6 +272,7 @@ static int dpu_encoder_phys_wb_atomic_check( { struct drm_framebuffer *fb; const struct drm_display_mode *mode = &crtc_state->mode; + int ret; DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay); @@ -308,6 +309,12 @@ static int dpu_encoder_phys_wb_atomic_check( return -EINVAL; } + ret = drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state); + if (ret < 0) { + DPU_DEBUG("wb check connector state failed ret = %d\n", ret); + return ret; + } + return 0; }