Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3192605pxk; Tue, 15 Sep 2020 12:31:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoEs3tF5T/Jz861b6gPKHPX8MdxTRpnPUmCSlMA1MAwCLoULEP3MPkPEZKqm6rWX3v4UlU X-Received: by 2002:aa7:dbd9:: with SMTP id v25mr24961106edt.78.1600198268396; Tue, 15 Sep 2020 12:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600198268; cv=none; d=google.com; s=arc-20160816; b=Be/AFeSq9W5JVUm6xT3y9X7PVjV6w8RY9mJm0mBOYmyHY5bLMZZ2VlfNmei7+bJPxM fsG85ZySi80V+nZRR7tNnZ+uOV5qm0xO8wFUl2FZOADqaTem5qP1BN6bEmPb3cjIBCtc 7FQjXilPMee0zUE9Qkxk1pwsGNe3LoIf/XuhugAZGgaCbEsCxvuMPtVYWY7DBFoT3cjd erlBHyAYLyR9CHCbJgFvUgP4Ze1ngQQFluZ+Z+uJuWJLHxXHss+pMhDSO5WShO2MrHR7 dFeYa+w/ZzziqpKhmjnpZnOIkCv4CG2lRi0SpzYzlKlsGwMHfqSM2D5x+HZeY2IQ85AY 3TJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=G/X0kPNzrsM6p6b+lxt3nMCOYmOHQKIBg29Sofy0KXM=; b=aC6bw81uz/6G2fJXXP/RHX/plP5UcfrStbGqQbrYNScTHElEMfGqm5rK18K9Fuqmyo B/hFPS5hnZ/kzNo8NSSpA+3jva1QPTP17c9E11AYXt3yBJCLNmFoezy8TQ3VDvA07bIB 0FlaRhI9P6w2l5Ol2g/H4CDdm99WWTArxU8sS4SUdMNAeCLsaedFLLvHh+iQnfuaDVwh 9rXx6t0RZwsH2t46kOku7Hv9LOnfTJm77qTCpqJuXDK9Byn+APJ30Pbsvqfluzgi7PqH icOYiPYb6uryN/s07YyC5uCsPlLrmkSsAo+2xJC7WgFkjuW670lt2FqAugsx5H09mXCe s+tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uF0v2qSS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b21si10399660edx.329.2020.09.15.12.30.40; Tue, 15 Sep 2020 12:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uF0v2qSS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbgIOT3R (ORCPT + 99 others); Tue, 15 Sep 2020 15:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbgIOT1y (ORCPT ); Tue, 15 Sep 2020 15:27:54 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF68C061788 for ; Tue, 15 Sep 2020 12:18:39 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id x23so555811wmi.3 for ; Tue, 15 Sep 2020 12:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G/X0kPNzrsM6p6b+lxt3nMCOYmOHQKIBg29Sofy0KXM=; b=uF0v2qSS9zDREj+6qqNypGZh8hcdiqOqlYhQer2PYoZWyE2Ld6v1CUhFqykffdALD6 qUq83ch4WvQATgF3c2qjQRDoc/M51bgwXMERec/TwtHs60IAVtYUa5lEThYNppJxII1h LWjpI3YmwFdKja7JosS2mqmV5qYAfbpg2RPVVVclLdxaMwMiszeLgHypUV0zem80pbRM 9b7iFG6oWl9szHZ/AJzL1iKFj5DQ8G+JEhldt7D1i6jO96MlYv1um0Sbyr5Av0/u4vJT 0LWrsoydArYLmz3EMXfI3MTud7ibPZkBD03ZF+yOxCaLeGTHvk/0xoiaZZG+ImnRzztl nJzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G/X0kPNzrsM6p6b+lxt3nMCOYmOHQKIBg29Sofy0KXM=; b=kVJRA5kbnJji5JQLFhIQfgtmCmceBtc5ybPtGSooSNMYKkfN6ze5mw4Pq6+N1g67Zx jCdPe/2BlPvsT6KTFktV/Ke2vcjBKI4JtLOxnohJeDLylcsPMGam0d3a9Zf4hOy5FaVr P7JbcVC2baC8BlqdjeZZfXPFnS+gehD4z2d3+0Yg+Y+i2FifyBQNL84OzqUr8bCvArGP co3Z9gQzXe6rqbkVOt8HFx+W5vQlQYrsT/zHpRrIeG1PvL8CzcaNzdM/QFKX+XyElnrL JrAL+QCU8toyNm44vdiub2/gkT0ktxZ1UZzJXv1nFq7X3xRpCi419hPecNKh9Y8HAuHG KIRA== X-Gm-Message-State: AOAM53020rqfK2n5bjC/fhLnhx3OTqHTvdLQaKLReN0ai4otfeQhJ6+A Qdh67GkdQswFeC4HDC1XmBLumfKguOYRMSXffT8= X-Received: by 2002:a7b:c141:: with SMTP id z1mr853417wmi.79.1600197517755; Tue, 15 Sep 2020 12:18:37 -0700 (PDT) MIME-Version: 1.0 References: <20200910020520.9973-1-bernard@vivo.com> In-Reply-To: <20200910020520.9973-1-bernard@vivo.com> From: Alex Deucher Date: Tue, 15 Sep 2020 15:18:26 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/display: optimize code runtime a bit To: Bernard Zhao Cc: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , Rodrigo Siqueira , Wenjing Liu , Aric Cyr , abdoulaye berthe , Hersen Wu , jinlong zhang , amd-gfx list , Maling list - DRI developers , LKML , opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Thu, Sep 10, 2020 at 3:23 AM Bernard Zhao wrote: > > In fnction is_cr_done & is_ch_eq_done, when done = false > happened once, no need to circle left ln_count. > This change is to make the code run a bit fast. > > Signed-off-by: Bernard Zhao > --- > drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > index b2be6ad5101d..53e30be8b66a 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c > @@ -373,34 +373,30 @@ static void dpcd_set_lt_pattern_and_lane_settings( > static bool is_cr_done(enum dc_lane_count ln_count, > union lane_status *dpcd_lane_status) > { > - bool done = true; > uint32_t lane; > /*LANEx_CR_DONE bits All 1's?*/ > for (lane = 0; lane < (uint32_t)(ln_count); lane++) { > if (!dpcd_lane_status[lane].bits.CR_DONE_0) > - done = false; > + return false; > } > - return done; > - > + return true; > } > > static bool is_ch_eq_done(enum dc_lane_count ln_count, > union lane_status *dpcd_lane_status, > union lane_align_status_updated *lane_status_updated) > { > - bool done = true; > uint32_t lane; > if (!lane_status_updated->bits.INTERLANE_ALIGN_DONE) > - done = false; > + return false; > else { > for (lane = 0; lane < (uint32_t)(ln_count); lane++) { > if (!dpcd_lane_status[lane].bits.SYMBOL_LOCKED_0 || > !dpcd_lane_status[lane].bits.CHANNEL_EQ_DONE_0) > - done = false; > + return false; > } > } > - return done; > - > + return true; > } > > static void update_drive_settings( > -- > 2.28.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel