Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4326969rdb; Mon, 11 Dec 2023 16:24:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDifiAifWsewta0Kshywu41oGsCY5uTYczLrzHmbndLfJ/FCtemcs4F1dj1iJUBAIMoihN X-Received: by 2002:a05:6870:d208:b0:1fb:75a:77a2 with SMTP id g8-20020a056870d20800b001fb075a77a2mr5361526oac.83.1702340657562; Mon, 11 Dec 2023 16:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702340657; cv=none; d=google.com; s=arc-20160816; b=ZSxjMzHcW2nY6ieJPvBAVP+H5QRdUZqjl5WJHeXv49eK7mmTrkWcCd97QvCVtPaeuT cqPj7pGhhANMScLfELlyfpNmSejYC4/sbox1NWhgzIuzjE+170/hGcOzX+cgc+0h9jBd vIcEEgCdofrB9kmES9Z3rkBtc63ardQy0BRzMD7/eGjDr8hpOnw9n/MRj0qugPyN0Tj6 2164iZIKb8k4qvUeChUu70+1dUIvK7LJFHlA9gTK1vZWfIXnVSO7HHybqZ/4YLitumyK UdqFsSYOmcq2ikDHx7z3YaROoEu24Vp3m8GO5rUecID/+XnRNi+jqs9B53/jRiX3TgQp /RoA== 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=MdVdTqm2SnjeHGf+wBOunjuqwixx0LwrCBV+TNRYjYk=; fh=2XyQDqDG0wz2VEIrVbLmdsbSBBAARfl7BOJG4nJ/HZo=; b=LVSA0HU8Jc+enV7k+R7bu0mcWFazTqOu2aINpKIV0N3mWC7z1Wgwq5qqAwZk2aEzFA 1WUT4mY2z+kcCs4/7ooLjUvaP017VLg+ZoUuBiVw/Faac4tfDgHSx/xKpEZxwCnJouat YTmhIsovY0a09NzqOlIamAwM9tYZYmSmWJrsW6gw3x2A1Nv6AmM/rztF342WMwFejcqF JmLH0kNj7U4JV0WujMrTcnnnfETIUDWRLjht7Nnbg0vL5enOGysyElAHIhlxBDmIr0CZ s9cvpa/GAOCg4YrXwL70tpRuWP8uX9sdMEE7ES0JYhnFhugdNnOMH1sC5vgrQw2Pu40y +5NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mrBN8C3C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ck17-20020a056a02091100b005c6a04dfc07si7033785pgb.519.2023.12.11.16.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 16:24:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=mrBN8C3C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 25133809EE36; Mon, 11 Dec 2023 16:24:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345607AbjLLAX3 (ORCPT + 99 others); Mon, 11 Dec 2023 19:23:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345531AbjLLAXS (ORCPT ); Mon, 11 Dec 2023 19:23:18 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2DAB182; Mon, 11 Dec 2023 16:23:19 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BBNnaB2003841; Tue, 12 Dec 2023 00:23:11 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=MdVdTqm2SnjeHGf+wBOunjuqwixx0LwrCBV+TNRYjYk=; b=mr BN8C3CWZAZEFPo5x0rB2TFfoS2yh11DRFqJ8nwh+hsFeuvrEyE9dN4NQcAh+8152 grJIjDVHUzOU0y/PsQZ5N9Ajkg/sesVcNOwOwEZPuG4so55V0jwbauQXpDyd5S8F iVj9UFOBIpqwD33DuCNG2A48THt4mKYPurZ7KhyEh5fmJAEmngbHDkkH7LjLkuB1 U4iTi3eDURRwwx1uIr1VIQEgFD7EHZ0HyFALPJKS1UwSU+pL/SBgM0nGlFXPSnj/ TffEfzsFuvlJSV4IABaiqk+f0Y9haogvbJEW/4UsDj5Ix4wTbDI6cBhRtAJ6LB0d 6YVrocBkMNuvFgSEzTZA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uvney4t9e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 00:23:11 +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 3BC0NATF027452 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 00:23:10 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; Mon, 11 Dec 2023 16:23:10 -0800 From: Abhinav Kumar To: , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Daniel Vetter" CC: , , , , Subject: [PATCH v3 08/15] drm/msm/dpu: add cdm blocks to RM Date: Mon, 11 Dec 2023 16:22:38 -0800 Message-ID: <20231212002245.23715-9-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231212002245.23715-1-quic_abhinavk@quicinc.com> References: <20231212002245.23715-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: 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-GUID: kDo4pKRYPa4tqMC2aKRfedUsLsiNsy1L X-Proofpoint-ORIG-GUID: kDo4pKRYPa4tqMC2aKRfedUsLsiNsy1L 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 impostorscore=0 mlxlogscore=906 mlxscore=0 phishscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312120001 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 11 Dec 2023 16:24:09 -0800 (PST) Add the RM APIs necessary to initialize and allocate CDM blocks to be used by the rest of the DPU pipeline. changes in v2: - treat cdm_init() failure as fatal - fixed the commit text Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 13 +++++++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index 0bb28cf4a6cb..7ed476b96304 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -8,6 +8,7 @@ #include "dpu_kms.h" #include "dpu_hw_lm.h" #include "dpu_hw_ctl.h" +#include "dpu_hw_cdm.h" #include "dpu_hw_pingpong.h" #include "dpu_hw_sspp.h" #include "dpu_hw_intf.h" @@ -176,6 +177,18 @@ int dpu_rm_init(struct drm_device *dev, rm->hw_sspp[sspp->id - SSPP_NONE] = hw; } + if (cat->cdm) { + struct dpu_hw_cdm *hw; + + hw = dpu_hw_cdm_init(dev, cat->cdm, mmio, cat->mdss_ver); + if (IS_ERR(hw)) { + rc = PTR_ERR(hw); + DPU_ERROR("failed cdm object creation: err %d\n", rc); + goto fail; + } + rm->cdm_blk = &hw->base; + } + return 0; fail: diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h index 36752d837be4..e3f83ebc656b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h @@ -22,6 +22,7 @@ struct dpu_global_state; * @hw_wb: array of wb hardware resources * @dspp_blks: array of dspp hardware resources * @hw_sspp: array of sspp hardware resources + * @cdm_blk: cdm hardware resource */ struct dpu_rm { struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0]; @@ -33,6 +34,7 @@ struct dpu_rm { struct dpu_hw_blk *merge_3d_blks[MERGE_3D_MAX - MERGE_3D_0]; struct dpu_hw_blk *dsc_blks[DSC_MAX - DSC_0]; struct dpu_hw_sspp *hw_sspp[SSPP_MAX - SSPP_NONE]; + struct dpu_hw_blk *cdm_blk; }; /** -- 2.40.1