Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp682399rdb; Thu, 30 Nov 2023 15:47:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6eeDx/gKdUTtkxkc1xRPGsvkps8zxMWBNmC6iRlU6xrlC9eCyico5D7gCdVve71tMaZy3 X-Received: by 2002:a05:6a21:a58a:b0:186:9314:6238 with SMTP id gd10-20020a056a21a58a00b0018693146238mr25405311pzc.47.1701388051406; Thu, 30 Nov 2023 15:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701388051; cv=none; d=google.com; s=arc-20160816; b=VP2/RW9vfV80NpM+f4UIeQgp4zvyCU0VQ9o/N/Cx0YBfVUIzEr97dyLsn3Q7BtuIud tX3usTAlMgPMPJ4lDgKCJlnGdQcq4xW38GVkVGfGQSWHdKowR/ULfCf/By1DF8Tyj5Iz BddIkzNpMUeg89CJR/BJycUPzeS/7tZ6r4AzmUZo/8d6COteqrTgRG0T+nj8aSWPX5Ae THIXdNvGu67m9e9D+/5P8rYl+l4eeic97aXLgw2NZ/eD/Kw5NJtkvtBTuXaXFFswwBF6 0QjV2pT81g15WWZkCTxoLF/hepZsEOmwy/0cmr4kRM+MocceXbHqkCD4yKiEfJdDcIhB o0Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=lxW79dI4+P97r0m0FHTUU4gvHh/DLugORShLU26ncss=; fh=PV8mTOqHBITZfXWDdpO6auBL9NA1tybqIGg9DEXyy5s=; b=DLRXyj0rKwmtQMOKghi9LLi8pvlNHSo7F2r2KroITgWHgKY0TCj+2l3kwlwDdiwbuF qGKbuThwFcNsYXP2vtXsK9wwkrxAlI0wbyoW6DmMJozmtM7JBXpAFt+6F4CGaxKdb5lv LOPGn3a4pvmCI9N+9lKSYDMwsJWOa8gZ/r+y01Eh8dV+Xb39+ow1t/Z9jJnT8i8g7lrv q2Yp1zBMekrFuoQQdAzYHUPyv+xT+X62R3lgST7K/SqkNRvyTbyKOh9r7RjL4I3yDWzl LQCv4c+ViRYYC/5F6H3ci1zy58Txc8BZLxFZ824TgBIWN7y+w72ce5MB+JKXcGakJ8H2 w/GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DQ6SkW9f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cj5-20020a056a00298500b006bd27e41c17si2246012pfb.314.2023.11.30.15.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 15:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DQ6SkW9f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id CA41B85BF2C7; Thu, 30 Nov 2023 15:47:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377294AbjK3XrN (ORCPT + 99 others); Thu, 30 Nov 2023 18:47:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377273AbjK3XrM (ORCPT ); Thu, 30 Nov 2023 18:47:12 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9BE129; Thu, 30 Nov 2023 15:47:18 -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 3AUNI8w0021764; Thu, 30 Nov 2023 23:47:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=lxW79dI4+P97r0m0FHTUU4gvHh/DLugORShLU26ncss=; b=DQ6SkW9f1jkR/VoZXDdVBqkkaGsj48Y0x4jma1V/VKnoEvpnzSMgaDP7iKcDXA2Zz/1n AA7ByzrgNMo4Sv/dcgS9/RzFXszzaJoUNKvOGGHxRSGIN4HvllxtMDs26mKo/zB7EenP IAbaDAYpD6NCwqarwQazPV3q+l1A/UzHqWQbUl0lWUgI71LjG3dqeFOWqdLOMG1nBSCx bFLdgvAfp7/rSsO/ukJRyJ6fq1VrEopIzXeVlewEPYvEPBhE/DIu9O5Hj1O5uC0QHux6 XqmwwT/LFUEO+JplEF91KHokHR4GTRwaTBAimCtQeDK4LlTE7j3hKRfZ+0EypdPJLwpw xA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3upjsqtu1q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Nov 2023 23:47:10 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AUNlAIJ011085 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Nov 2023 23:47:10 GMT Received: from [10.71.109.77] (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, 30 Nov 2023 15:47:09 -0800 Message-ID: <5bcbb092-1d29-f795-3be4-5ab1c708cba0@quicinc.com> Date: Thu, 30 Nov 2023 15:47:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 07/16] drm/msm/dpu: add cdm blocks to RM Content-Language: en-US To: Dmitry Baryshkov CC: , Rob Clark , "Sean Paul" , Marijn Suijten , "David Airlie" , Daniel Vetter , , , , , , References: <20230830224910.8091-1-quic_abhinavk@quicinc.com> <20230830224910.8091-8-quic_abhinavk@quicinc.com> From: Abhinav Kumar In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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: p3fqZW7eERaVsTSvkgJn4Bg0019wcEz_ X-Proofpoint-ORIG-GUID: p3fqZW7eERaVsTSvkgJn4Bg0019wcEz_ 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-11-30_24,2023-11-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 bulkscore=0 spamscore=0 mlxlogscore=891 malwarescore=0 suspectscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311300176 X-Spam-Status: No, score=-3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 30 Nov 2023 15:47:29 -0800 (PST) On 8/30/2023 4:48 PM, Dmitry Baryshkov wrote: > On Thu, 31 Aug 2023 at 01:50, Abhinav Kumar wrote: >> >> Add the RM APIs necessary to initialize and allocate CDM >> blocks by the rest of the DPU pipeline. > > ... to be used by the rest? > Yes, thanks. >> >> Signed-off-by: Abhinav Kumar >> --- >> drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 17 +++++++++++++++++ >> drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 2 ++ >> 2 files changed, 19 insertions(+) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c >> index f9215643c71a..7b6444a3fcb1 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" >> @@ -90,6 +91,9 @@ int dpu_rm_destroy(struct dpu_rm *rm) >> } >> } >> >> + if (rm->cdm_blk) >> + dpu_hw_cdm_destroy(to_dpu_hw_cdm(rm->cdm_blk)); >> + >> for (i = 0; i < ARRAY_SIZE(rm->hw_wb); i++) >> dpu_hw_wb_destroy(rm->hw_wb[i]); >> >> @@ -240,6 +244,19 @@ int dpu_rm_init(struct dpu_rm *rm, >> rm->hw_sspp[sspp->id - SSPP_NONE] = hw; >> } >> >> + if (cat->cdm) { >> + struct dpu_hw_cdm *hw; >> + >> + hw = dpu_hw_cdm_init(cat->cdm, mmio); >> + /* CDM is optional so no need to bail out */ >> + if (IS_ERR(hw)) { >> + rc = PTR_ERR(hw); >> + DPU_DEBUG("failed cdm object creation: err %d\n", rc); > > No. If it is a part of the catalog, we should fail here as we do in other cases. > I guess, the only reason for not failing here was other hw blocks are needed even for basic display to come up but cdm is only for YUV formats. Thats the only reason to mark this a failure which is "OK" to ignore. But I see your point that if someone is listing this in the catalog but still RM fails thats an error. Hence, ack. > >> + } else { >> + 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 2b551566cbf4..29b221491926 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; > > struct dpu_hw_cdm *cdm (or cdm_blk), please. Ack. > >> }; >> >> /** >> -- >> 2.40.1 >> > > > -- > With best wishes > Dmitry