Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2124801rdb; Thu, 7 Dec 2023 21:07:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSXSjaXDri3VixUV98Ct8N2NCc9Wi4s+jFNBQiDLS465/qOxdYJzfdTv0RuHhCqG1gx5PQ X-Received: by 2002:a05:6358:91a7:b0:16b:631e:5021 with SMTP id j39-20020a05635891a700b0016b631e5021mr4775162rwa.7.1702012043765; Thu, 07 Dec 2023 21:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702012043; cv=none; d=google.com; s=arc-20160816; b=z7Sn0es9dldPb77b8xQZBaPUmfQ2oz8p/YRWjSl77FIuBFIEjTNsnwbD4nCFEmNeMP aGxncv9lyZBYYCEvJwu28gp6q3u2azbPDDA4i1HQ1Z2QIthD50u5Pq/V2iK6giwkIT+2 JuE5yZ6jVVp1XPv8Mznuhr3Fu+qVHgyacM6L8lJrQv5WZEoyzK8gNbdzNj6UAbU9nKz/ AmaTWExY11FT2VMcKjIBF5y0OWA+IJ/MU4PIrNKhDYkT6Tcb+i+bpfMK2b7WYFxbrk/M TkgVT25vcQKNJhm6CMyA56K0UVkKL41KwTFZmqVpTb6GPyub/w0Gn558H2+RoC3lZRG6 ePLw== 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=WlKCC3O3gzfemEY03xFX4nrmIBBKRuJwsSR/+mvebUA=; fh=bCPr6FtHW7vqpnFZy/5ChZdmzRzyfr1lCT+1Yh+hWj4=; b=EbJMKJ4vH+Sqbx8VANMIEINOnzc0HoTed9rLavkfFGtsYix9dfXRpXHe6bi4WAWV1f dPRkbmCXqmdjdnsNTKQoc3iJAFWPORKxars572xF6jz5rroyp3RxWBji01rc04ykqxHK OiDBcJLXwWnoxhH3/M15nCJ09D57jS7MnUPoFKgutVQq3ScZMD6ig3RuFMxh3xBISXcH WQZb8ACm8SDIOv+CgA2EJL/YjHVFcXS5BrTEq7aTBpsCB3/2a6nyxUILll2Aq6TdfCf5 tR0jjhXSTsgt8cIenFYZ4AVs6wqcKjzq0ppyI58SRqDjislPZO55SuVVgBeL3bKDsrHl odww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EaZVM3cQ; 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h18-20020a63e152000000b005bdbd683601si934555pgk.57.2023.12.07.21.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 21:07:23 -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=EaZVM3cQ; 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 D7F96809F894; Thu, 7 Dec 2023 21:07:19 -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 S230451AbjLHFHE (ORCPT + 99 others); Fri, 8 Dec 2023 00:07:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjLHFHC (ORCPT ); Fri, 8 Dec 2023 00:07:02 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF71C10F1; Thu, 7 Dec 2023 21:07:08 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B84rY3w030356; Fri, 8 Dec 2023 05:07:00 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=WlKCC3O3gzfemEY03xFX4nrmIBBKRuJwsSR/+mvebUA=; b=EaZVM3cQpJTUMx+jA4Ow7ngr5TX75EnN1VjHEHLYXu0H0gxt68KLAJp2+KtdDt4f6NnK KYt9Ww95FTpOWHNtIK3VeuaciO6kSPA2zZ89Sm52CvcFcV9Xxpe3+6wmX2PDMeZfad6Y tTPBCX3BhKSR9DwKrcDaVbLBh+p6EXBxWf5ky0ZF1H1BDTJxqiHb+lAhcHAd7N333waM +BBDfQGRmsRpWGWU4kE+3MgQ1ozK6bj4YnZw6mdUmK5GtowA9CqkM7sdElMloLd1BMYM EBeAl1F4NtGwTsZFk4m/ZGJEBPKwvZ6sfqE7KP1fBsK859/bf9rAIRIEMhUKU1Ho2JGL mw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uubd82k2p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Dec 2023 05:07:00 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3B856xkk006516 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Dec 2023 05:06:59 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; Thu, 7 Dec 2023 21:06:59 -0800 From: Abhinav Kumar To: , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Daniel Vetter" CC: , , , , Subject: [PATCH v2 01/16] drm/msm/dpu: add formats check for writeback encoder Date: Thu, 7 Dec 2023 21:06:26 -0800 Message-ID: <20231208050641.32582-2-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231208050641.32582-1-quic_abhinavk@quicinc.com> References: <20231208050641.32582-1-quic_abhinavk@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: CPnwYZW7izGZUNZmoHC3Cd4Uh8FjwDx9 X-Proofpoint-ORIG-GUID: CPnwYZW7izGZUNZmoHC3Cd4Uh8FjwDx9 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-08_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 suspectscore=0 mlxlogscore=827 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312080038 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]); Thu, 07 Dec 2023 21:07:20 -0800 (PST) In preparation for adding more formats to dpu writeback add format validation to it to fail any unsupported formats. 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 Reviewed-by: Dmitry Baryshkov --- 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..91b1967cf566 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_encoder_state(phys_enc->parent, conn_state); + if (ret < 0) { + DPU_ERROR("invalid pixel format %p4cc\n", &fb->format->format); + return ret; + } + return 0; } -- 2.40.1