From patchwork Sat Apr 1 11:54:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 78125 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1173743vqo; Sat, 1 Apr 2023 05:00:05 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+H602U4a+58DgUEPDbKoas39radaEog5PFFs2mvFKNXmTdjrkeMlbwIzCjt3+aUFveJFN X-Received: by 2002:a17:907:2e19:b0:930:9f89:65ef with SMTP id ig25-20020a1709072e1900b009309f8965efmr27330306ejc.11.1680350405577; Sat, 01 Apr 2023 05:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680350405; cv=none; d=google.com; s=arc-20160816; b=Rd2kWr7KMNBgKaFCy1i8iLdLVWMPwp66XH2CLqsBVx9hKqfUiS4sRtcYzivuS8+Jzq tWdhp0z5WiOPQRREe4rW7pkubFbdeKOuNnBpYGC1rM0p2tNGk337hbc4A7UXOXlCII6u v6hVfwJkYqsTclOrJSrfPuYR0F67pVxGUBLgMMtQIpVuLs0c4LbY3G35kUohAjeHrOXq 96ZPRKxvhNMv3lkU9tvXeKL+4U8wQkYQTVdY2imaZ/XPXlpfz5jW40AIyatk+V7uc/im E7yMN7f4kA0o9J77P1lYkFHSV+b6FY2/hr5zlOfkaQ0Lgu/Kp7GQ0odrnz/hZ3UoC5PD wuVA== 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=V2TYwAn1Jyo9PBH+9U5+LtUDgGXL54gtjUvzWRdUK1Y=; b=WXdHqNbi7ehuhXi3Pyz2cn2jdoVX0um2eppqo2Rd7E2ZrLdnFLRom8OWNc2ZAId1Am r/B5rqJ3091Tt7n9oO6QfOpoFnJtfRGftkpeOk21ZBAezq9ZifmWo9rNH6Bwbv5MkNzY kfiEJDW54B3CVIpFCqAAZrtNReiJz0mCAKNKgje2D9izxxjXVT68rpUCSWapmfCENdPH DijvGthSyS+dA3iVwl26qQLerhU/iLNBJGkJOYiVNpd6FhCfsR5/pvKNNFf4c6sTxZRX K3cOxS6+phSp96i9TI0qTRS1aENFFpY81JUaIc8oB1DDK9LPQk9Dq9cNPMvspkWtszH8 JyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MCDfAhre; 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 n11-20020a1709062bcb00b00947432cee78si4373501ejg.791.2023.04.01.04.59.41; Sat, 01 Apr 2023 05:00:05 -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=MCDfAhre; 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 S230142AbjDAL40 (ORCPT + 99 others); Sat, 1 Apr 2023 07:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbjDALzy (ORCPT ); Sat, 1 Apr 2023 07:55:54 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F942659C for ; Sat, 1 Apr 2023 04:55:36 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id br6so32194798lfb.11 for ; Sat, 01 Apr 2023 04:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680350124; 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=V2TYwAn1Jyo9PBH+9U5+LtUDgGXL54gtjUvzWRdUK1Y=; b=MCDfAhrecL41SY1SS6uJ7vUnQxBWQ8vuGxBhgLKL9MOgthQlKYzvUk4YwBsCv5jJ2p GSJAMnbGJl+nQXlULJs1FSsSD74MryfUHLHiDNZRDBUHd7b58qX9d1s+KCKVmcvraKc0 W533Hf9iG2IsGN7c1+DXlBFdGjAN9FQXLXxFkNafV/3JCOQxuN+0u2Qm7I+8VGbvgiff PB0Fb+PWONoH7YXQOWBKts8gCSqJIDbtTHRq4iXrZ4K3YFnaXEyCP6o9W9BWuvXoYevS Wj/JDr+sYgjWfagMoWqNFMgub18cjNITLh4rTI4gRpRIdi6L8enhVDzo3x2WQ+rxwlLy i4NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680350124; 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=V2TYwAn1Jyo9PBH+9U5+LtUDgGXL54gtjUvzWRdUK1Y=; b=O3bw1oh8qgttJx3WCryX1Qk6yzOcNsxGEZiPLqRlyVrDxe/2OtR/NBHZFI5aAralIL VjJElF2iBWnlbhJGmKND5/1UHrd8HtSuOt5bZeip7RecBppuy0lFYchI2GaojcDYWmgN lxMfcOhaH5k2S2YjyKYxTzx/rM80oU6hz1qvKplMlBGhamf2Mr1FJP7iwgLneAbts5I3 qmbws9RY9d/6JmIW9TYL6UOwOB7MEOEKBPUG5Ezf2TZskkq/N1R8o67lQwEStPXbaXKT ckNk6yiUd2vqiOEhP4I74runz+bvsF5ykMuajtMiAaGiKcSROIbEMuimS13cIAs2din8 7k2g== X-Gm-Message-State: AAQBX9eplfd2TtkiYQWWkRh8EfoVZ+m6jqVyQiz6UQxLLa777T7j8X9X CimUdBf6dGjdUjGe+gb8IwP64w== X-Received: by 2002:a19:550b:0:b0:4e9:c627:195d with SMTP id n11-20020a19550b000000b004e9c627195dmr8145645lfe.57.1680350124471; Sat, 01 Apr 2023 04:55:24 -0700 (PDT) Received: from [192.168.1.101] (abxj225.neoplus.adsl.tpnet.pl. [83.9.3.225]) by smtp.gmail.com with ESMTPSA id w8-20020ac254a8000000b004e83f386878sm786737lfk.153.2023.04.01.04.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 04:55:24 -0700 (PDT) From: Konrad Dybcio Date: Sat, 01 Apr 2023 13:54:49 +0200 Subject: [PATCH v6 12/15] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching MIME-Version: 1.0 Message-Id: <20230223-topic-gmuwrapper-v6-12-2034115bb60c@linaro.org> References: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@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.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680350084; l=1434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=PUHRMhG2i7xarnxRfpZn2n4mbPzcd2Fd9BsLsPanfMM=; b=9m5H4CFtN6EC+FWJ//p7SwY92+XoqEoJDeGxyad+OdlVR2aSCDzbfBKcJ+7PZ/AAsHVPruU1PezJ w6wcitFEBKR7VUABWMNzhZ/JHGR8NcVQdKNySSAZiH+5yNl8KZbU X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761975106717049630?= X-GMAIL-MSGID: =?utf-8?q?1761975106717049630?= 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 389a1f7251fe..a802a29f8173 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2171,16 +2171,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) {