From patchwork Tue Mar 14 15:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 69692 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1828855wrd; Tue, 14 Mar 2023 08:36:44 -0700 (PDT) X-Google-Smtp-Source: AK7set8Jchfm1NtKxcBC2j3cXJTYgM6xWz/evtol24ETSjZyYEUawqn2k+28CnNMvpVuMb9OwDDs X-Received: by 2002:a05:6a20:4b1f:b0:d4:9cb2:9030 with SMTP id fp31-20020a056a204b1f00b000d49cb29030mr5280304pzb.24.1678808204027; Tue, 14 Mar 2023 08:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678808203; cv=none; d=google.com; s=arc-20160816; b=1JV+DFMNa/IdlY6IIsW1+GSmDI9FQKXDEc6lvSdROmd/21+QiKGWQdv+G2Z+Rv9rqd 4vlcXY/sz1CAEXPX1+KwvsmDB3QkcCgg6YrW5LxibxQ1Frhtc8ttQsi/Zhtp2yWnGX3B FDoxNB3LPX5ZEMCWkai+0VQf/RS8YAKbXXl3fSJpgUuLsCtAiuVBIsCA6IwCqs9f61Wq MpBlB/tTjpYnbN0WMM+7Rz3SX5ASBJQ0We1duaZXXcrkz73idLULgGrX2+m6rBl6/eWz xawg3lSGNxK8EjaBtjkMDuk7wwpnnj6xq920cmHvcPIu/hQfs2TOB53B1UOcQfTSjQDj 2wWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fdwglER2agYNfLVPprMx0FPmVS9IVmz+s6GuV4eeQlY=; b=yIsJ4v+nW6i4Z0N5Vrr5vJh7597kSKSC971l0zIrYOKZq+0NygrLNVmS2euqze6G5x wA8N/uYifbbfBPk8hgSQ56NaJR1CGICZSQlYp0aJ+VOf81PbSU3pk/DsCLe2WtNV4fkt Jpz4Z7H21yf+Jj/Uhi5/RCxv22QOUJilmVQg5ZhKNJGYlFn6bFn6Ytp9MlxV427kF+uR hBVwBGchvONp61wrFwlizarrL57h5klT3rFcTvT1zhvW+TONsPKN613pzxHmGGRrVkFJ 8pkvYilnQZiNzjiZBlystHJbH63fHed6BbTrrX3Jh4i+e3N3bDpglzNotcMn6NQCiUVc Xx1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lKp64Clb; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a631f4c000000b004fab9a24dddsi2429015pgm.732.2023.03.14.08.36.27; Tue, 14 Mar 2023 08:36:43 -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=lKp64Clb; 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 S231285AbjCNPaG (ORCPT + 99 others); Tue, 14 Mar 2023 11:30:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbjCNP3J (ORCPT ); Tue, 14 Mar 2023 11:29:09 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E55056157 for ; Tue, 14 Mar 2023 08:28:58 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id i20so16400323lja.11 for ; Tue, 14 Mar 2023 08:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678807736; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fdwglER2agYNfLVPprMx0FPmVS9IVmz+s6GuV4eeQlY=; b=lKp64Clb2weIN9LxcJaV7Z/cFUCUng+k5gejt9AiaR21/aN4vDzDPvhnnqAQMxtLvV 5cOdn/hBnhe521EMwa26x2IMAoVau/YhZvrGCymgpYmFAjVmE4YoaneoXvU7QYVV7W09 RJtavZi4t2J2NbcXXQBlGm0z6Pf2M7AQk/z+x01Veig1sikXb4vVqjSRBV/nCuI0Rfmu mr+1Mb31xbNiAp7QmC9neHPhs7XiuwXNWQz4ZSOaKk5wLWzg8cCL3nX0vmkV5xz1Adso B+Zu+3Gy52wzS20RAj2X5SAw4SsTsYyB87kRExR1LSx7g1G4NyeiZSQqvPk79SU0ABMb TUkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678807736; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fdwglER2agYNfLVPprMx0FPmVS9IVmz+s6GuV4eeQlY=; b=KoMfVRoXZwm/73Aeck17VO3BVwEH6O4cfQEgmZUaKoWr2f4DoWMVJIXVcf53JsE9Nf oIQ5OjIiUGoWIvrG6AOVNHUbVydBlfFasGfjjrmK7XjvBIjve2rPWf/1pKWD5L4ricSy MAt8GNu3w9M40RghnPp3Zs642gyFbrzalofIw8drjTy30WKh9suxRfJVBrQQ42xFBaW5 h6oqMsMepZbVnzjf7iY4iPAJY9Th4+YvcLhO6fQ1wCcVJWW8fKYPeEdisUG+b0rFtyAG Co/5PHQt7HForrvR6tMZAX5++EkrqN3jNVBqmRSGE0dWzKhOFO/yBfd3OyGOalWy5DwC PuiQ== X-Gm-Message-State: AO0yUKUcB+393oDblQtTAcmWFqf8XLLJe7braltywZ1Lx4nY0PsuV2Wt 3ZYTqMEv5R9Qt83osXEuQQwL1A== X-Received: by 2002:a05:651c:2211:b0:298:6e2e:2224 with SMTP id y17-20020a05651c221100b002986e2e2224mr9543190ljq.47.1678807736338; Tue, 14 Mar 2023 08:28:56 -0700 (PDT) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id 27-20020a2e165b000000b002986a977bf2sm491529ljw.90.2023.03.14.08.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 08:28:56 -0700 (PDT) From: Konrad Dybcio Date: Tue, 14 Mar 2023 16:28:42 +0100 Subject: [PATCH v4 11/14] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching MIME-Version: 1.0 Message-Id: <20230223-topic-gmuwrapper-v4-11-e987eb79d03f@linaro.org> References: <20230223-topic-gmuwrapper-v4-0-e987eb79d03f@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v4-0-e987eb79d03f@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Bjorn Andersson , Konrad Dybcio , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Clark , Marijn Suijten , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678807716; l=1434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=D3QGn+nYvlP8x3swaH1kHJwlzdjGFbaFa9zhDHv4lx4=; b=ZOerBhWO9wapKFAmKihwL/xjhmOBckfMZSqJGmKAHuDSBy94K3mEfpFoTQaJo9CdyzfCJdViZmhq 8ZeJc1z3BqzNORvpz6NPoC45eGj51K48M3uSZAPNbuiTEVkmGm0I X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760357991241799210?= X-GMAIL-MSGID: =?utf-8?q?1760357991241799210?= The GPU can only be one at a time. Turn a series of ifs into if + elseifs to save some CPU cycles. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index f699f326021f..dfd2d735e57f 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2207,16 +2207,16 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse) if (adreno_cmp_rev(ADRENO_REV(6, 1, 8, ANY_ID), rev)) val = a618_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 1, 9, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 1, 9, ANY_ID), rev)) val = a619_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev)) val = adreno_7c3_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev)) val = a640_get_speed_bin(fuse); - if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev)) + else if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev)) val = a650_get_speed_bin(fuse); if (val == UINT_MAX) {