Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5135981rwb; Tue, 17 Jan 2023 09:35:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXvkBpS5ms+KnHO7VeLyLYQ6IpS05/Gyv0JgjUP3RfhMhpFiiIGc0iAnyGuxouIgpklo4iHW X-Received: by 2002:a17:906:1798:b0:84d:43e4:3633 with SMTP id t24-20020a170906179800b0084d43e43633mr3781445eje.36.1673976911490; Tue, 17 Jan 2023 09:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673976911; cv=none; d=google.com; s=arc-20160816; b=OL8xB/Gz1ke47kl5fzZNlk6ekxkxfhlTdMicJaaGoV7ilppcbd0060wXs6mOo/nskg sYb/p9zg84eQvnam0o7xGtWFNPKtsXUbHLHNLvqvwGUoShlg1lAakTfzJo7Ra/3e5sIR sKgAkvrrItFSwQ+dzFb/P9mxgEoLsdoaXhtq40DiC3yLCIFMTyp7hzcoSFYQ/0rcuhts nTZzxxPuuTLcY/mRxCmp2RtZLGv/PCb6uG6M+0KmREhMecmnwVX0I28NEaR1IsDJwqbB tlyTFBS525mwT3hP3yIgZoxq++83hbOHi2LS8Nm/HYRUNhdJLJLfz2eGNpcchsHyB8ND F5Iw== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=T1bbrLy++qcWOt6lSo1aW2xXQtthkN26YgghLI/c6PY=; b=RJ9omVCnXo3mx3YQMXTL05Xctj8pzbTbuR5CexC9f7oMQj6qPY0x+cn1WzCR7qJwUL 5rmtqsVXZe55uh7mCBm0FDjOLVrpnso7zD6HTy330VYBs6afi7ySk7QSvWa+A7V/9HhV +ZIaIOLn+DGVAqcZGl0U7DtWtDV+GUXizVagVf1x7rLbAP+h2Pdh0dHcfiwwCqIu1KKY WZVT72SAHGzJZ2/fDyNuiPk5dZBcqtmg64Uss5vl46yNgXbAA9fXhYfvEgv9Y4Xycu3B 4Tlq4d30uBfXJ8AzDGXbquYLSHBvBrktePsJVm164ltZrQetqvFDHF59Q4tIqtpaR+kn i5KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YZWptJC2; 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 ww2-20020a170907084200b007c163a17f44si13697277ejb.995.2023.01.17.09.34.56; Tue, 17 Jan 2023 09:35:11 -0800 (PST) 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=YZWptJC2; 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 S232871AbjAQQke (ORCPT + 48 others); Tue, 17 Jan 2023 11:40:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233024AbjAQQkP (ORCPT ); Tue, 17 Jan 2023 11:40:15 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464FA43464 for ; Tue, 17 Jan 2023 08:40:14 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id z11so45911071ede.1 for ; Tue, 17 Jan 2023 08:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=T1bbrLy++qcWOt6lSo1aW2xXQtthkN26YgghLI/c6PY=; b=YZWptJC2T2Lt68fnk5iaS35Tt5NiBfTpWDPvoZ6YNp63K3/OpJqlWyZT9j6KW7jL+Y R2u99ksNtXzgJJfcKEb8tk3Q8XTu5JPV0ZoB94hofer3jjhOTHZ0EQ7Y4zl+fVQBhgbf xoOe2dgoLRZqgJXMrHtynQZnr5g5DUqAbnBZ6C5nVp8CrRvqEB/uaaQ+Yy3Xiq+BPQ7p uzJvop6v4S2b68/OrliCjG4bx0NwzotqRxAXtx0gq5sUPvGmuj/JcowQw1cRn8O8Ohvl cnRY58wyvX5NuCJe9A8wnxrZ+nWebym9vLkLEHPjNihs+RJJJZtYNngEeNbuCcaNCHMt mjog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T1bbrLy++qcWOt6lSo1aW2xXQtthkN26YgghLI/c6PY=; b=z+mYa7wnwWoO5q0BEYFSxzY71H0N/DoYDIt7mXyZ5VVZM0Af98tjKjUcRa/QBwwpkA tJuGqc1MDPVuhr6nku2MvEMYMZeyR/f6ECArLLxwiy1kf/FyfvGb/9DeQd6gwxhizABb J1AtljBGdeB99OwWUKbUg2XtbCcMbfcMSud/WR00sOKHkkkLBfkYLYnbzQ5bOhlaiHW2 xA8HrJaSm00ReAAE5Esdt+dcKrPGoSPYyNLOOI43XEO9+dAZ1nCJx4Knp1rDh4XmGK0M IYJepGyuCGsIM2C8VtMVP91fPpG3FN9a1IG5Eve7fNDbO3lJGJYdEoTV1RJB3nlPqeVi euYQ== X-Gm-Message-State: AFqh2koMUz/h9erUOtaT1xXqSk2egb3uq7I4Rk9D3yEDInfj+JXBfAzQ 7ruXpurhipwuJGO/9vZRn6qzdlrROxhuC7N4 X-Received: by 2002:a05:6402:2b92:b0:45a:7d2:9b35 with SMTP id fj18-20020a0564022b9200b0045a07d29b35mr3870633edb.0.1673973612880; Tue, 17 Jan 2023 08:40:12 -0800 (PST) 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 dk1-20020a0564021d8100b0049be07c9ff5sm5820820edb.4.2023.01.17.08.40.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 08:40:12 -0800 (PST) Message-ID: <84849b99-93ab-bc10-39ff-ac46328ede47@linaro.org> Date: Tue, 17 Jan 2023 18:40:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 1/3] drm/msm/disp/dpu1: allow reservation even if dspps are not available. Content-Language: en-GB From: Dmitry Baryshkov To: Kalyan Thota , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com, quic_abhinavk@quicinc.com References: <1673972488-30140-1-git-send-email-quic_kalyant@quicinc.com> <1673972488-30140-2-git-send-email-quic_kalyant@quicinc.com> <0a845c24-b1a5-a961-103f-0d8840a8f17d@linaro.org> In-Reply-To: <0a845c24-b1a5-a961-103f-0d8840a8f17d@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 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 autolearn=unavailable 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 17/01/2023 18:35, Dmitry Baryshkov wrote: > On 17/01/2023 18:21, Kalyan Thota wrote: >> if any topology requests for dspps and catalogue doesn't have the >> allocation, avoid failing the reservation. >> >> This can pave way to build logic allowing composer fallbacks >> for all the color features that are handled in dspp. >> >> Signed-off-by: Kalyan Thota >> --- >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 8 +++++++- >>   1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c >> index 73b3442..c8899ae 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c >> @@ -343,7 +343,13 @@ static bool >> _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm, >>           return true; >>       idx = lm_cfg->dspp - DSPP_0; >> -    if (idx < 0 || idx >= ARRAY_SIZE(rm->dspp_blks)) { >> + >> +    if (idx < 0) { > > The change doesn't correspond to commit message. > >> +        DPU_DEBUG("lm doesn't have dspp, ignoring the request %d\n", >> lm_cfg->dspp); >> +        return true; >> +    } >> + >> +    if (idx >= ARRAY_SIZE(rm->dspp_blks)) { >>           DPU_ERROR("failed to get dspp on lm %d\n", lm_cfg->dspp); >>           return false; >>       } > > If you'd like to remove duplicate for the (idx >= ARRAY_SIZE) check, I'd > suggest dropping the second one > I've misread the patch. However I don't see, why would one request DSPP_NONE while specifying topology->num_dspp. I think that you are trying to put additional logic into a function that should just check for the available resources. -- With best wishes Dmitry