Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2125121rdb; Thu, 7 Dec 2023 21:08:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZUaTVxg3ydykC9quMKd/xLNydefHMC544Q3TRLhf2spAnrIXyko97FlNMgA8yFcrfo8MX X-Received: by 2002:a17:903:1104:b0:1d0:68ad:d89f with SMTP id n4-20020a170903110400b001d068add89fmr4222197plh.64.1702012107292; Thu, 07 Dec 2023 21:08:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702012107; cv=none; d=google.com; s=arc-20160816; b=d0/tse0wCEkkUzPXiyuFoUHj18+ui1KY6vE3+YYZsEbgp72DPlT9QSlWmGo1i4aSD8 iRx65q1nVid5VUJfVqDXI+f/yF2oYOWiMEnbPWNfBdnfWWyQAwztd74YQUbCnItKgr4w 1XAHmep2afy9UXEBy51WCmVg2baYvU58EBfRqzsf6OGjRqjxP2dWtRvFcUU9WF3HhCgF U1mSj8Q3KT1jjaO0I3bPNTkzQ9otWqQPddxBAkr/6AXVrgasjl+BvvkZJslmY5S0KFEz X8ot2Najf0qBgnBFT8EH5Pi3rpZ0PPm/RnDEblnm6FJLkgdKvDpnynzDq0zphnBMw9wa GLdA== 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=edMATInw/JVSytLa6L6eueG5DQjzdWWf+I0i7QMoCss=; fh=bCPr6FtHW7vqpnFZy/5ChZdmzRzyfr1lCT+1Yh+hWj4=; b=Id7NDQIFZrOBzFMo0uxXpY/mmNJT2l2wMap6DiP3QuoEdPHfx9l1dOQGmqh0mSyFaU X/IHwy8bPD2AeOLteKsQ+bXXUsNU9sj0IwuAX/j9S4CP2Tt8NkzjWtnWBnxVwF5ingjO N+on7yc51juGmIxEnFv7A/fiBQrZuWYbQXogK/0BUK1Q7b07kpIDoSFknDk+P3JOLgD4 Rx5UJFM9rpq6T2N8LlQyC7bMKGtBqpAnYvj2nDNKWRHZlqgR+GMgxbLIuWzbsI9Xg7P+ GflSgsano4RZiSLD0a5hIbzNoM8ut6iBgvnmKZYY5ndzoH0Ms8z8M/ozGw3MZbnB+jB1 NlIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=pCsWFNu4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q10-20020a170902daca00b001cfd52a2266si958326plx.403.2023.12.07.21.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 21:08:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=pCsWFNu4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 4D8C980EA817; Thu, 7 Dec 2023 21:08:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235846AbjLHFIL (ORCPT + 99 others); Fri, 8 Dec 2023 00:08:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235745AbjLHFHo (ORCPT ); Fri, 8 Dec 2023 00:07:44 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9F131BC0; Thu, 7 Dec 2023 21:07:28 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B84nvpY030731; Fri, 8 Dec 2023 05:07:20 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=edMATInw/JVSytLa6L6eueG5DQjzdWWf+I0i7QMoCss=; b=pCsWFNu4UC5pajjkithAWCIqJIqYpKRfSZRU/lpUTLzjTbn0NpXcUwovzZkyVsqF0pBj hm0SfDxCyqHKnzG/6OsnhW6/EGG+iqUX+B24CMiexs5Kb5lE1wZXH6Gyk1RnuUStM1d7 U2bvd0+Y3TwQUsJPNVkmSUEWhBqKwPwaps7km/CA1b4oaoCM5UGjMlYNS0xsn/CSqKSQ J+xz+lYxdxuJH+hshjUm2RB7HjoJekPcGL0noHIidEfPsuHLnGb05LBgSJpCqVUUjgVI iZ3eq52X9/bvj4SH1TEOWtnoEdoeMFZtxQXLYsLamV3mUq60C79IY9Hq+2/XHtrzHPla XQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uuuu4r2ta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Dec 2023 05:07:19 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3B857JYG021928 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Dec 2023 05:07:19 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:07:18 -0800 From: Abhinav Kumar To: , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Daniel Vetter" CC: , , , , Subject: [PATCH v2 11/16] drm/msm/dpu: add support to disable CDM block during encoder cleanup Date: Thu, 7 Dec 2023 21:06:36 -0800 Message-ID: <20231208050641.32582-12-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: QZs7rNM3vHGOghpIjA9Tv-TgDWC5bZBz X-Proofpoint-ORIG-GUID: QZs7rNM3vHGOghpIjA9Tv-TgDWC5bZBz 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 clxscore=1015 priorityscore=1501 bulkscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 phishscore=0 mlxlogscore=707 adultscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312080038 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 07 Dec 2023 21:08:26 -0800 (PST) In preparation of setting up CDM block, add the logic to disable it properly during encoder cleanup. changes in v2: - call update_pending_flush_cdm even when bind_pingpong_blk is not present Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 10 ++++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index aa1a1646b322..862912727925 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -26,6 +26,7 @@ #include "dpu_hw_dspp.h" #include "dpu_hw_dsc.h" #include "dpu_hw_merge3d.h" +#include "dpu_hw_cdm.h" #include "dpu_formats.h" #include "dpu_encoder_phys.h" #include "dpu_crtc.h" @@ -2050,6 +2051,15 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) phys_enc->hw_pp->merge_3d->idx); } + if (phys_enc->hw_cdm) { + if (phys_enc->hw_cdm->ops.bind_pingpong_blk && phys_enc->hw_pp) + phys_enc->hw_cdm->ops.bind_pingpong_blk(phys_enc->hw_cdm, + false, phys_enc->hw_pp->idx); + if (phys_enc->hw_ctl->ops.update_pending_flush_cdm) + phys_enc->hw_ctl->ops.update_pending_flush_cdm(phys_enc->hw_ctl, + phys_enc->hw_cdm->idx); + } + if (dpu_enc->dsc) { dpu_encoder_unprep_dsc(dpu_enc); dpu_enc->dsc = NULL; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index b6b48e2c63ef..410f6225789c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -151,6 +151,7 @@ enum dpu_intr_idx { * @hw_pp: Hardware interface to the ping pong registers * @hw_intf: Hardware interface to the intf registers * @hw_wb: Hardware interface to the wb registers + * @hw_cdm: Hardware interface to the CDM registers * @dpu_kms: Pointer to the dpu_kms top level * @cached_mode: DRM mode cached at mode_set time, acted on in enable * @enabled: Whether the encoder has enabled and running a mode @@ -179,6 +180,7 @@ struct dpu_encoder_phys { struct dpu_hw_pingpong *hw_pp; struct dpu_hw_intf *hw_intf; struct dpu_hw_wb *hw_wb; + struct dpu_hw_cdm *hw_cdm; struct dpu_kms *dpu_kms; struct drm_display_mode cached_mode; enum dpu_enc_split_role split_role; -- 2.40.1