Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1543936rwr; Thu, 20 Apr 2023 17:22:42 -0700 (PDT) X-Google-Smtp-Source: AKy350YUBJVQRXYeB1Dm5kCF2mz5BcKowv4CdgxQqglg4XlDi+gmjiMaQ5KPAtQ5M07cFd5g7ArO X-Received: by 2002:a05:6a20:3952:b0:f0:1d03:5fe7 with SMTP id r18-20020a056a20395200b000f01d035fe7mr4673870pzg.38.1682036561893; Thu, 20 Apr 2023 17:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682036561; cv=none; d=google.com; s=arc-20160816; b=gE7qg10ppdyUngqOWKsJk9wlX1MSfCOi1mNZOFnZQDttL7Ner6UotNtmrKFkfuZGWc YSN49cqtx+Udifcvbvs9gNXVi2Ea4mcOTdzwysx0YJ/Atc9jIV6WAt+xRPnI355519NE 8IqWcbf/ObYEorB0jmSKsXA97mPXeSVmiyqUUpEvTYRZBPwkAH8frGdpTkFmQt5UexBS 7bo/HxRfFGD6kli1Sf5G91kVLEbSAnuHQ8DGt3QjWlmR8p17zYPhOm/VezZOW1SmfAHn ej9ZkqVN15Mrit5BHn+pfEm8JtQKfhdAuSlHHD+vvNH7tcDz0BLuhol3Txcr1i+70PTf 8aTQ== 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=wfnd8gwg66uWWNFqZoU9vOCkwYs8srEJj3TQoz5dxlo=; b=kURxysGJSOnjRaOUVJsTFiorBYJ+UIYEcncZYcweze/XdPBrJjYakeji0HD1Pja4L4 W5Nzp8oP+Jju0Zvw8h/VKpcuit8G23mhajdNJYhU8OLWxgQ2hOokp3+uxpjBfSCkNuAS fLFKKFBjoTBpINGad6CYS29xEHSn26hJbxVo1Mo3vYlFaAxHnCzFB0O+RZKeDDdqLzdL EYuCzVVYPQrLa8l7A51Ti11sLCpf5NptyKtRFGEkzI8Jo2xAN9YiOBp/Yi71tVGxEt+R EZo4Bh52swRgtScF9VkC7L4NpKSg1FQPN3AHEJ6ShEuSPPjFIFiPqIEIyaLL1JuWuKlC aTyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RY1oM4BK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a632a0e000000b005143b5917e8si2777587pgq.770.2023.04.20.17.22.27; Thu, 20 Apr 2023 17:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RY1oM4BK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232800AbjDUAMO (ORCPT + 99 others); Thu, 20 Apr 2023 20:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbjDUAMM (ORCPT ); Thu, 20 Apr 2023 20:12:12 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41485173D for ; Thu, 20 Apr 2023 17:12:11 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4edb9039a4cso1010464e87.3 for ; Thu, 20 Apr 2023 17:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682035929; x=1684627929; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wfnd8gwg66uWWNFqZoU9vOCkwYs8srEJj3TQoz5dxlo=; b=RY1oM4BK/5v0LprVe4rP9faKD0LmsM9Krz6cbm2zFAEGCx531mXEJChnBDKdBqtK+w ApaYg5YMvD5ltAJ0db8rfPc0+pYEzXauLWhZ2dJoQQFeXx+XGB4TbaKZr6edKfJeOk5F gmtQPxovj+nzakZptSyA6Xt22HpaA8emndhnW4L3DkN5ldmS/V8cC716yaCN1w6tWE08 XKReL/F6qnqBOm1wUTLL42L0fJufb69ehGL8hfMOljGbHyobKjUULXoxLAndCqb6kfrd 7M0yOC/n7tAowE+GNf4N6K4vyV4HG0ublkc11RpqBtNC1UAy9/ofLZMO9a+29J5OtLy7 A2sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682035929; x=1684627929; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wfnd8gwg66uWWNFqZoU9vOCkwYs8srEJj3TQoz5dxlo=; b=NXN2/4fU68JWTd33y80yxe6Nqt5c/6UXzBPxhRDZXURxGu5IBmimxMYS8h2+05tJY8 JO46l2p7V8AfX2j62ljRB7VFsoBNO+eNB5hbYynWdJbumG6USlCzFfwUrt456jZ9jfYc zBoS9nKsxnn9x/CDz55iNuL4EJSQ3XP/3RVdpzYYBFK8eEJ9VKz8z9zsSiwS97sWMjhM DQx/YiXr39w+4+txoRJYiGcdPmzDDeI/iHqv++OkIkT89XHMwd9acFlbSfjusbHCRwLY +sQSR6tYuHlaH+whEzeJeH4dzVJR8hgvtnqFazmj/RWg6UFd158tRM6PTvmoXbUkojWF ff4g== X-Gm-Message-State: AAQBX9fdBWzo1bFR+gE/+9hNn984ROFjkD/Z0+ltK8eFUhZ2g0vuUdMv AEmUQJ2814eoRdSb+m81DOA02g== X-Received: by 2002:ac2:5195:0:b0:4eb:53f7:a569 with SMTP id u21-20020ac25195000000b004eb53f7a569mr944090lfi.63.1682035929486; Thu, 20 Apr 2023 17:12:09 -0700 (PDT) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id w14-20020ac25d4e000000b004eed8de597csm375609lfd.32.2023.04.20.17.12.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Apr 2023 17:12:09 -0700 (PDT) Message-ID: <897af051-aed4-938a-5ab1-c44c967ab02d@linaro.org> Date: Fri, 21 Apr 2023 03:12:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v1 3/5] drm/msm/dpu: save dpu topology configuration Content-Language: en-GB To: Kuogee Hsieh , dri-devel@lists.freedesktop.org, robdclark@gmail.com, sean@poorly.run, swboyd@chromium.org, dianders@chromium.org, vkoul@kernel.org, daniel@ffwll.ch, airlied@gmail.com, agross@kernel.org, andersson@kernel.org Cc: quic_abhinavk@quicinc.com, quic_sbillaka@quicinc.com, marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1682033114-28483-1-git-send-email-quic_khsieh@quicinc.com> <1682033114-28483-4-git-send-email-quic_khsieh@quicinc.com> From: Dmitry Baryshkov In-Reply-To: <1682033114-28483-4-git-send-email-quic_khsieh@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 21/04/2023 02:25, Kuogee Hsieh wrote: > At current implementation, topology configuration is thrown away after > dpu_rm_reserve(). This patch save the topology so that it can be used > for DSC related calculation later. Please take a look at https://patchwork.freedesktop.org/patch/527960/?series=115283&rev=2 . > > Signed-off-by: Kuogee Hsieh > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 32 ++++++++++++++--------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index ecb87bc..2fdacf1 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -542,13 +542,13 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc) > return (num_dsc > 0) && (num_dsc > intf_count); > } > > -static struct msm_display_topology dpu_encoder_get_topology( > +static void dpu_encoder_get_topology( > struct dpu_encoder_virt *dpu_enc, > struct dpu_kms *dpu_kms, > struct drm_display_mode *mode, > - struct drm_crtc_state *crtc_state) > + struct drm_crtc_state *crtc_state, > + struct msm_display_topology *topology) > { > - struct msm_display_topology topology = {0}; > int i, intf_count = 0; > > for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++) > @@ -567,16 +567,16 @@ static struct msm_display_topology dpu_encoder_get_topology( > * Add dspps to the reservation requirements if ctm is requested > */ > if (intf_count == 2) > - topology.num_lm = 2; > + topology->num_lm = 2; > else if (!dpu_kms->catalog->caps->has_3d_merge) > - topology.num_lm = 1; > + topology->num_lm = 1; > else > - topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; > + topology->num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; > > if (crtc_state->ctm) > - topology.num_dspp = topology.num_lm; > + topology->num_dspp = topology->num_lm; > > - topology.num_intf = intf_count; > + topology->num_intf = intf_count; > > if (dpu_enc->dsc) { > /* > @@ -585,12 +585,10 @@ static struct msm_display_topology dpu_encoder_get_topology( > * this is power optimal and can drive up to (including) 4k > * screens > */ > - topology.num_dsc = 2; > - topology.num_lm = 2; > - topology.num_intf = 1; > + topology->num_dsc = 2; > + topology->num_lm = 2; > + topology->num_intf = 1; > } > - > - return topology; > } > > static int dpu_encoder_virt_atomic_check( > @@ -602,7 +600,7 @@ static int dpu_encoder_virt_atomic_check( > struct msm_drm_private *priv; > struct dpu_kms *dpu_kms; > struct drm_display_mode *adj_mode; > - struct msm_display_topology topology; > + struct msm_display_topology *topology; > struct dpu_global_state *global_state; > int i = 0; > int ret = 0; > @@ -639,7 +637,9 @@ static int dpu_encoder_virt_atomic_check( > } > } > > - topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state); > + topology = &dpu_enc->topology; > + memset(topology, 0, sizeof (*topology)); > + dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state, topology); > > /* > * Release and Allocate resources on every modeset > @@ -650,7 +650,7 @@ static int dpu_encoder_virt_atomic_check( > > if (!crtc_state->active_changed || crtc_state->enable) > ret = dpu_rm_reserve(&dpu_kms->rm, global_state, > - drm_enc, crtc_state, topology); > + drm_enc, crtc_state, *topology); > } > > trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); -- With best wishes Dmitry