Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1290848rdb; Wed, 6 Dec 2023 14:24:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEk8eBLWHKt/cmjQ7BACOJrmf+LtMiBEUex5MqukDgHQ5HxUf+qP+ybeqeWzyZnf4xWb8GG X-Received: by 2002:a17:90a:1a02:b0:286:6cc1:2cc1 with SMTP id 2-20020a17090a1a0200b002866cc12cc1mr1396802pjk.75.1701901463148; Wed, 06 Dec 2023 14:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701901463; cv=none; d=google.com; s=arc-20160816; b=p6KEM3mcx87C8Dtkh2equrNKFxqQnKD1M7HCPSII5JnebdlKqYTc6dnLM/8PlhqF/P EaXVbnkT+47FxMpOtXoxsaZvHi8W7Bu3djbgNEEXMSi0e4M5Y3BiZBfCz1xQblF6XWg1 TqnFw+CNllrzgCREL82qKmCf5ZnC1dMkdxdTJyHjXRD8ElxxckKspC9D+LCfRiduWO3e bh0wgumMjCwdhgg0dKWdnAclvqcOpJX8f3tfWNIdOUY6olL3XcQo3dp2mx27M2tweEU3 SaHW193/HMrhNveJVzaFdsJiif1gf2C/uGtsegFY+jIU0tyqDGmaL+vUFucA72+iWBaz PtyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OFW1BtHzKKyWMjTKsTgJeCE0JqHRAauG27klyOmROjc=; fh=J5u3TKaqYxWVSOBg2V9dELtJ3oFLZMOk93p/SuWfFqM=; b=yziO26ElEDX8kdKtVxxn2SX9AGLvOqK6v9C0tXi08G5fvKTmGKM1umOSdECY+Va1Dh exI/ni+twCTV6rhbwy6zpGSrgGliImRRTZ18g6OdLqQwYjRB6721gq4kvAAq6PJ6NCGr 7K0GMOC5qVI6Wheel5QcovmS8gYjQC+MwNV+UR+i6komKa14NikxmTmk71JRcx9slINi NUvxKbmLB1zE/Q88T4ituVNjf9gxdb+X6GcBI1xNNjVoL+ApppRp6z866FGMxcBJLYYQ z9WMtrTLvtllL5oz1juzdIJEeDA391mHO+clkN68Ky4t2jyTG850jXho1U3Z686jU6BU 1uhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EiNEaH+n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id k8-20020a170902c40800b001cf50ffd38dsi477129plk.164.2023.12.06.14.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 14:24:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EiNEaH+n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C211582E8753; Wed, 6 Dec 2023 14:24:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377547AbjLFWYD (ORCPT + 99 others); Wed, 6 Dec 2023 17:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377254AbjLFWYC (ORCPT ); Wed, 6 Dec 2023 17:24:02 -0500 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B552D46 for ; Wed, 6 Dec 2023 14:24:08 -0800 (PST) Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-db8892a5f96so348989276.2 for ; Wed, 06 Dec 2023 14:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701901447; x=1702506247; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OFW1BtHzKKyWMjTKsTgJeCE0JqHRAauG27klyOmROjc=; b=EiNEaH+nkoYet3Y1uEYehpX7ztPyB34baspR8MWcbGpKz+Jf4Z3aMHEAIyQJEEQWJq SuA9gotQKR4pEOzRK6c5GOZs0fZcwqK/RzE6EYfCOwQlw6yWBeR66JGHQcwx53qx/R5t F8oGrgNiRxoUs0y3Hn94TOz+miA8w5P0yfDnJ8XYDKvnix4X7vaYq33OO/bx3115xBba cTk+DOPrJc7nYV4QePjjmeKwYIuosYmm1konXwaZmrUmASEzLKhcSocnyMG+2FA5mOA8 S9/fm26Ov4bObukAWKqmC09MtNsd8dn7Z9FJDg6q5jaNLgzYo9MVikb1bhxbnBCWWNBH uGXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701901447; x=1702506247; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OFW1BtHzKKyWMjTKsTgJeCE0JqHRAauG27klyOmROjc=; b=EqeLEzcMk+U/QwoSlUYUhU+tnykHAw0hX35JY6FUfLGkM7FQgDNuRheFbEwH8Pab8I UzgRgOKgwudqUWJ8ptzHh1WhWzZYGRDQdeXgHo29238kZX0vQH0ap4m+8xbXZSerO2Q5 qiPdohBs0p7jyXdOXdsE1+Qar+gTR4+xAscdZy1d34VTV+atoqbzcp7Xzppyd1GZhksY Q18rLpXS+gvPmuKOhBsfTlY0pEAS3jyIlrT0xNQcUFWo06bzTRDPF7/5mnpn2VHbo7Ey mvW2S2wlZDjxXlfL4O/Ji1Ebx9dForNPNmZCA6+gLNe0j8x4whpxNiiF6z4tnpGf1rxZ 2sUw== X-Gm-Message-State: AOJu0YyfVlqg7WRXlk/YDEGh7rqDSeyJT8aIeIlN3CmFJN+zq1QryG1i 7mHXCQyStoiChE6X8gbGdhg9XKEFGlM0pAFkMWqxww== X-Received: by 2002:a25:8102:0:b0:db5:3f84:25f4 with SMTP id o2-20020a258102000000b00db53f8425f4mr1484992ybk.65.1701901447301; Wed, 06 Dec 2023 14:24:07 -0800 (PST) MIME-Version: 1.0 References: <20230830224910.8091-1-quic_abhinavk@quicinc.com> <20230830224910.8091-8-quic_abhinavk@quicinc.com> <5bcbb092-1d29-f795-3be4-5ab1c708cba0@quicinc.com> <27074b58-25ed-dbcc-1048-dbd9ba3135c9@quicinc.com> In-Reply-To: <27074b58-25ed-dbcc-1048-dbd9ba3135c9@quicinc.com> From: Dmitry Baryshkov Date: Thu, 7 Dec 2023 00:23:56 +0200 Message-ID: Subject: Re: [PATCH 07/16] drm/msm/dpu: add cdm blocks to RM To: Abhinav Kumar Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, quic_khsieh@quicinc.com, quic_parellan@quicinc.com, quic_jesszhan@quicinc.com, Marijn Suijten , Sean Paul Content-Type: text/plain; charset="UTF-8" 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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 14:24:20 -0800 (PST) On Wed, 6 Dec 2023 at 23:02, Abhinav Kumar wrote: > > > > On 11/30/2023 3:47 PM, Abhinav Kumar wrote: > > > > > > 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. > > > > I was going through this more. I think its better we leave this as a > dpu_hw_blk because if you see the other blks in struct dpu_rm, all the > blocks which are allocated dynamically / can change dynamically are of > dpu_hw_blk type. That way the dpu_rm_get_assigned_resources() remains > generic. Hence I would prefer to leave it this way. Ack > > >> > >>> }; > >>> > >>> /** > >>> -- > >>> 2.40.1 > >>> > >> > >> > >> -- > >> With best wishes > >> Dmitry -- With best wishes Dmitry