Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12DD9C64ED6 for ; Wed, 1 Mar 2023 08:27:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbjCAI1N (ORCPT ); Wed, 1 Mar 2023 03:27:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjCAI1K (ORCPT ); Wed, 1 Mar 2023 03:27:10 -0500 Received: from relay04.th.seeweb.it (relay04.th.seeweb.it [5.144.164.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22F7136FEC; Wed, 1 Mar 2023 00:27:08 -0800 (PST) Received: from SoMainline.org (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id AC8942038B; Wed, 1 Mar 2023 09:27:06 +0100 (CET) Date: Wed, 1 Mar 2023 09:27:05 +0100 From: Marijn Suijten To: Kalyan Thota Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robdclark@chromium.org, dianders@chromium.org, swboyd@chromium.org, quic_vpolimer@quicinc.com, dmitry.baryshkov@linaro.org, quic_abhinavk@quicinc.com Subject: Re: [PATCH v4 3/4] drm/msm/dpu: avoid unnecessary check in DPU reservations Message-ID: <20230301082705.ugbaov2kr75fygnr@SoMainline.org> References: <1676286704-818-1-git-send-email-quic_kalyant@quicinc.com> <1676286704-818-4-git-send-email-quic_kalyant@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1676286704-818-4-git-send-email-quic_kalyant@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-02-13 03:11:43, Kalyan Thota wrote: > Return immediately on failure, this will make dpu reservations > part look cleaner. > > Signed-off-by: Kalyan Thota > Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 23 ++++++++++------------- > 1 file changed, 10 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index 46d2a5c..3920efd 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -636,25 +636,22 @@ static int dpu_encoder_virt_atomic_check( > if (ret) { > DPU_ERROR_ENC(dpu_enc, > "mode unsupported, phys idx %d\n", i); > - break; > + return ret; > } > } > > topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state); > > - /* Reserve dynamic resources now. */ > - if (!ret) { > - /* > - * Release and Allocate resources on every modeset > - * Dont allocate when active is false. > - */ > - if (drm_atomic_crtc_needs_modeset(crtc_state)) { > - dpu_rm_release(global_state, drm_enc); > + /* > + * Release and Allocate resources on every modeset > + * Dont allocate when active is false. > + */ > + if (drm_atomic_crtc_needs_modeset(crtc_state)) { > + dpu_rm_release(global_state, drm_enc); > > - if (!crtc_state->active_changed || crtc_state->active) > - ret = dpu_rm_reserve(&dpu_kms->rm, global_state, > - drm_enc, crtc_state, topology); > - } > + if (!crtc_state->active_changed || crtc_state->active) > + ret = dpu_rm_reserve(&dpu_kms->rm, global_state, > + drm_enc, crtc_state, topology); > } > > trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); > -- > 2.7.4 >