From patchwork Thu Feb 23 12:06:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 60941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp275823wrd; Thu, 23 Feb 2023 04:08:59 -0800 (PST) X-Google-Smtp-Source: AK7set/V5hLHseK0gIbA4b7kRqh4uaG3gZ+GNNCVmxfTsd+//6zGr1wMMJ/FvLIB7bruvXp/NOHN X-Received: by 2002:a17:90a:20b:b0:22c:64c6:b7c4 with SMTP id c11-20020a17090a020b00b0022c64c6b7c4mr10875457pjc.2.1677154139475; Thu, 23 Feb 2023 04:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677154139; cv=none; d=google.com; s=arc-20160816; b=LLUrLOgR866cOIBI9u8Zvx19YYUxGt05s/oEdIC/msApLsHJOW9kxMIEd+9BEQetl2 VVVnPq03MNZBw1RcAPEjVU9tuBBzGVOwVRktBXzCcbqkeSPEEfgBN3h1Hqpx+TrS27Tc DQ7ZTt6fd40LXCOu0wY3PMSQOmn7zWn5A3HcxNTVppoQ5PfziJO57/5EiAuBY6edxiWx IqH7iKU0TbmXLi8MGfH8j9X4wUfUmco3qGH5EyCG7uC07Kmbg01t3pEiRawTuOOucm3f W/LDpdgPGCMxblo/1fYc3TEp+iaUXcU0IRxcfizwQgV23Hoatm1owhuwL65aodgFyBBE B+Jw== 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=kU1DhHqljkZnMyZ8L0mfvbfdXEv07yxf2+yc3rbwTBA=; b=NoVjocNpj0rgV0+ecugGS1aHdJ+FBHkoRCTKpoaOFKePqZp8KhmqDyuGSgDXWAoSd7 K2OZ4m48Pasvj9wS9aviz+6rWQqXbuoHFhyOeZG3al713fex7ojg+/CH4qmq8fwXxqlO K/Agn03Qg7jUGSkBuanf329VjbpLxhwdovd/P0wIGSHNDq1q6HjS4s7va0DSbnK2TJ5J Fw9cm9tpItniVDMDblun6zSfzZ+AIUehx0prd+MvO+m5cPZSw554OBz9frauIvPR+OaY 9DvIXgcbUPtFiALX3s8iOSi8S4on9iuw7ZQnTBsF760kWQbalEHI+VKLLFAe8W7v5Lax zNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PYQZM3L2; 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 t70-20020a638149000000b004fb48ac77d8si13415971pgd.101.2023.02.23.04.08.46; Thu, 23 Feb 2023 04:08:59 -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=PYQZM3L2; 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 S233964AbjBWMHm (ORCPT + 99 others); Thu, 23 Feb 2023 07:07:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbjBWMHZ (ORCPT ); Thu, 23 Feb 2023 07:07:25 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E36A972E66 for ; Thu, 23 Feb 2023 04:07:03 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id e9so10564107ljn.9 for ; Thu, 23 Feb 2023 04:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=kU1DhHqljkZnMyZ8L0mfvbfdXEv07yxf2+yc3rbwTBA=; b=PYQZM3L2LumSLyw8wcCvEpFKJeoS7thhe/+9xJHxQtEQ4+LobuF5sEKheGM5Bhgv9a wbMdwBtRz0l3SS6hA/rhcWf6qMjaYrkGPrV5YgMreAsrt3oE0XzzWYR1PXuoxcyVxJd8 HHbq8ShTi/kMCc9B8S2NuGipD3j3rBrDAAgh1i52he9oNhp4UcQPk51PF2eUkELBpire wwHD5B/5vmh9rwmXtLhJ+NQt+t6Qmh60cnNfjGbtWIVlSV9zw9v4sRZx8SSY/lUTOMrJ L3nQnAlfQy1Rfx4iBNKjUxK1tHP++eLtew8HYpB8EImTjZKM+eUdOrgLNxOQl26Fiq0E tapg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kU1DhHqljkZnMyZ8L0mfvbfdXEv07yxf2+yc3rbwTBA=; b=3CNMH26kQPBo5pFkZ2Hmu9om4Swb4auUGRvTkM3djjQ6p5r61nrGqk/AGpoejHq9x+ ndkKaI2r4RNOhwAd/d+X1iHO3UDA6PNrapmnvMnjNws/w622gwxy0Cy+a9lCZZ2pAPHH c0CuWYgKpx7hjR+RK7tDrFN3dr/GjZUaUr5OGUxD4zquha9KPTHKAp/KoPAJC9JczNh2 CzdJAYnMzQbFnv+TNbUwXlZ3c4Ifn5HllTcn5PD1llbmnQZ20lTqgNzjrTDhZmkcC6t0 SjukMMKGh/PjBA5aXetbwdvrUBOmBXQ/MfqdqZajB1IVsLT1l6uWF0+ha4FQIG/kzShg SfUQ== X-Gm-Message-State: AO0yUKVL/bRSJ/SmKYS8/zSqHpf7hFbL3MNCT2+G8MJWFyuzSWx3rGK8 9g6WRFb3VocLFL/b449M/jGsHw== X-Received: by 2002:a05:651c:158c:b0:295:9d2c:c5b5 with SMTP id h12-20020a05651c158c00b002959d2cc5b5mr1217095ljq.12.1677154023428; Thu, 23 Feb 2023 04:07:03 -0800 (PST) Received: from [192.168.1.101] (abxi151.neoplus.adsl.tpnet.pl. [83.9.2.151]) by smtp.gmail.com with ESMTPSA id h23-20020a2ea497000000b0029599744c02sm414838lji.75.2023.02.23.04.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 04:07:03 -0800 (PST) From: Konrad Dybcio Date: Thu, 23 Feb 2023 13:06:46 +0100 Subject: [PATCH v3 12/15] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching MIME-Version: 1.0 Message-Id: <20230223-topic-gmuwrapper-v3-12-5be55a336819@linaro.org> References: <20230223-topic-gmuwrapper-v3-0-5be55a336819@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v3-0-5be55a336819@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 , Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677154003; l=1434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=diEdpVPV98iDyAF3qtuCIpbTUiF49iB6aIjsVbWV6Sw=; b=ZkCJF5gp9SXq5tTFz0avDKLTNJiqFPEk/lO8lIguPILtj3GJe8qp7Dwgbk2fVNK0eKEvODJDTQ+H O5dIDuC/BSYaR/lZLPu4xYN+7gJPClPMteoXtQm13k4Gtpt8w4mQ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,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?1758623578798712205?= X-GMAIL-MSGID: =?utf-8?q?1758623578798712205?= 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 eb24be772934..f694acca931c 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2222,16 +2222,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) {