From patchwork Mon May 29 13:52:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1530107vqr; Mon, 29 May 2023 06:55:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73iB8xYdzWrrP+9IkqYwVXRQMcELQ+SOp3W5CIF8XGwsJaGcGYLa3k+VJg0U6IRjvzpIZC X-Received: by 2002:a05:6a00:2382:b0:64d:1d84:aeb4 with SMTP id f2-20020a056a00238200b0064d1d84aeb4mr16550156pfc.24.1685368500358; Mon, 29 May 2023 06:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685368500; cv=none; d=google.com; s=arc-20160816; b=ZsgRji9BQhL6kNSmLfqwAmIINOcVjJevcwYv3FCpMgI7RGWo2muaBz8lTQj3C5sDqt VQGW2ABKuHPYfWaH3GNl4zCfUwmkA44hvMGnfFYVTO/zk2Xek/HXLwCUjyow4DipKbP4 IzCPvVpEwc5o28g2vEsK++8YGwzO+UMp6rRHB3AtMssM98m5aHEG3yF3V3q95aMsLgqk xYOI4J1iRp6zLZo4ft+5Pdz+hRj3LZeQaOcj7bhnb+CAA3WajY0FkJTdCEtzcgx3NoTk NdbAmZ3nxRv1WLu0Hi/JEZMBs9UVvjXwVQvDIRm2PY2KL40MWRDu8wcibsLLfxEqmBhj OtWQ== 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=qmQPbfO+F1oBJQkI9K6akAThU3d6RkZKcfSUr9dQgtc=; b=ZbwNVQlhLeIEAm5vPo/lgQ0YzgculzWPGdjeWx8ifzltTpFZgJifoZlS5JM8qYtiKS wWYSZbh7875D0O1ZrDmP+e/ePOaUe4OEoIvYitfBvw84l2/WbRnxJNYL2iTXtXXQwr9n U1BaJaY1fGACzBhsn6/54ZrEaUMxdJLkTCXYWOilJzrYPZ2ofFU2xsLoklHBIBXpfhuu vwL200NAXefljPqkOZgDoNnsKynu5JSQstnFg6+8h/NIN97DpmrXOEtEg3Ol74pRm9R2 5/oVmUjdwqjFVRitYrstB/X7PwBcuQ/r8z6f6fkSnbmnT6ipA3il8UvucjAQMUu+F4JB 0XYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=prhQ9z13; 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 h63-20020a625342000000b0064ff1f0a554si20286pfb.5.2023.05.29.06.54.46; Mon, 29 May 2023 06:55:00 -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=prhQ9z13; 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 S230142AbjE2Nx7 (ORCPT + 99 others); Mon, 29 May 2023 09:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbjE2Nx0 (ORCPT ); Mon, 29 May 2023 09:53:26 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 496C7100 for ; Mon, 29 May 2023 06:52:52 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f4b384c09fso3776699e87.3 for ; Mon, 29 May 2023 06:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685368367; x=1687960367; 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=qmQPbfO+F1oBJQkI9K6akAThU3d6RkZKcfSUr9dQgtc=; b=prhQ9z135A/XL4btw/gHLarhsQTq1qSmqcG9EJ/CgoAkvg5xhCypAQNSmY6M7r9FVK DgxDVZ3bZ74uiCWStRYQkHwb2hONVAeYtRqz0SlVxGEj1nCkXPuyajvRxhSQWt7SvyKg 5GuXouEjufiAondg96OBTe8iEx7lnu0mz0zF2fnYnUDW1U/vkuCMCSHEdnuvbg31jw9T yC7BDN5uKBJGnNT0nZZfG71ell3GbPey3XmF6oZE8rgS0ttmsht2TSjsK9djvW4XRo5B s5hK2/ewptLEFFIPCRX/M3d7z2OITer4ow43PzVZ4rUwNHLf932bLJ8gDf6YRdksDLZY 9RMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685368367; x=1687960367; 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=qmQPbfO+F1oBJQkI9K6akAThU3d6RkZKcfSUr9dQgtc=; b=gUxJ2kjqEjeJAKkNpx4eJKgWNc1HDoJnI0rJxQLLS0IDNR0/YYu+sdOAYMDNMTjKYi nOpJANbtOO7KpubWAE7PSiKjB4RpoyOmaf4bR1EMja8rkv0lLMelQLGaqQNhXj7/xOPt nPNXWNCjRlDW2kPKeO42r/Ib2f46iRDysObBUVzW2CVtSmsYb6Atfnv5E+1MOxpnBti7 MyON8lhnBF0R/Don8OqG1Ac3PaASG5bzVB4th0TSJI3kxJqMxNYOUY6TW0IV/YzugRoW ZMkJjWte6QobFaoNEoi8Oqp9MRPpezlGcxyAwjLHSH1lYb4vR3mszql364+Nd+ul0+7I E2pQ== X-Gm-Message-State: AC+VfDyWaqZO6J0eCP9a6kSIsBmq9nndiYAzY99Hd1VKjx9FJ0kC7zP+ ajsGwqbsZ0leiqVESa4Gf+gsFg== X-Received: by 2002:a05:6512:64:b0:4f0:c18:5114 with SMTP id i4-20020a056512006400b004f00c185114mr3608499lfo.26.1685368367275; Mon, 29 May 2023 06:52:47 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id c16-20020ac25310000000b004f2532cfbc1sm4700lfh.81.2023.05.29.06.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 06:52:46 -0700 (PDT) From: Konrad Dybcio Date: Mon, 29 May 2023 15:52:34 +0200 Subject: [PATCH v8 15/18] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching MIME-Version: 1.0 Message-Id: <20230223-topic-gmuwrapper-v8-15-69c68206609e@linaro.org> References: <20230223-topic-gmuwrapper-v8-0-69c68206609e@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v8-0-69c68206609e@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 , Conor Dooley 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=1685368343; l=1434; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=H2Z7peqqE8oAE8U3nTlARepFCY8M4ZLiVH3inaSxkyA=; b=cJIeKzGQe+QN5PWfsZoxB2X1FWjbe0uOO7QgbvODui4tH5P1SROuXZRm59GAYZ5IXYQ/FggUp lfKc6RPYy8kCvM8sJpZC8p+ZpSbu87BNBxXpAZDsP1d72JhvWbstku7 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,T_SCC_BODY_TEXT_LINE autolearn=ham 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?1767236960568341034?= X-GMAIL-MSGID: =?utf-8?q?1767236960568341034?= 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 Reviewed-by: Akhil P Oommen --- 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 1a29e7dd9975..5faa85543428 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2170,16 +2170,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) {