Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6147061pxv; Thu, 29 Jul 2021 07:35:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLCal1pbT8tr7HGoR+ngQB5GANEJSXQFAiV0kmYaip9xM3tfUWZRwSlfTENldwU9TPoHqU X-Received: by 2002:a50:da0e:: with SMTP id z14mr6496823edj.73.1627569336138; Thu, 29 Jul 2021 07:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627569336; cv=none; d=google.com; s=arc-20160816; b=MN9G7Sbho2olZaG5kXuuPAEKJoQI3cvqePVyxmWYQNb5HPFdlxkwaFa20vFgrShJvA nZivmjumgoHIW9G2KPe1huSD3gQLmmCW65ReZvhfcCyV+W/mQsAUvds9VPMQXuOoWxMM SG0gRu8frbm5T19UMGrEAkhGsfQVnfqW7C5RRV58wvh370UcMW28aqo3BPWpCUMpJ/8q EtRPysW6hNLj/WUmdZKwCblliWTfgMDgPPqwOh+2saEYyAU+MJ92zj4NWn+5rUoRtW7P Dp4x33GoWDtEMNpJfotPJzWik447thGYAqpZ/yj5IGyKrERnU45l2tUEmSFv5UBe7nYc ikkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=tT0Rmr8bIVXL7IImapnpIIgCnu8mOznrYiudXhbVNIs=; b=QNH5BViJJM0x5udaHGb/3ml3wTBBLt7M9UHIBUpI9q7PkiVHIpde25ODWChIgybYAB 3vzX/6rNIPauM57FXYLvf/Gsp5/3fj/JPitGEUiqKoi7FF8rjyIp4KUCyCfHJHAWoX+2 FsrMDWRWzhfU57eWBacbYm67NScu7DwRG0cEo13NxljGXwNFzcgMUhh+5GIWKXIBLoeK ff4nOT3Q1gUVWPuJKCDSOU5O2cg4iBFC6lui/mrfIhDrGxbBcoRe8g/U+OPzc0R5ELV8 ZEdKbk0WHll2+n51f/vkjM3dC2cI5sLsy/Wngi+zO6s0QtYSPoxFTMbgHqpdJku1y/b9 qa7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=qvOp4Vef; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si2716108edd.383.2021.07.29.07.35.08; Thu, 29 Jul 2021 07:35:36 -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=@mg.codeaurora.org header.s=smtp header.b=qvOp4Vef; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237398AbhG2Odo (ORCPT + 99 others); Thu, 29 Jul 2021 10:33:44 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:41591 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234206AbhG2Odm (ORCPT ); Thu, 29 Jul 2021 10:33:42 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1627569219; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=tT0Rmr8bIVXL7IImapnpIIgCnu8mOznrYiudXhbVNIs=; b=qvOp4Vef5TwP3YPWzuZ8Nh4N0ZQYaN6r4jplqn61ucHTuW7ysCsWcweiKjUjpMaswnDU5gRi SX6aNRmO1xKhDG00Mft5Og5+tzCK+H2Z6EzO2ycwm/iS52u5jzewsKviPPmytcMH9QKkMpOy UxCBOUtSwwcD1qu11UE92M1h82Y= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 6102bc2ce81205dd0a4a4d84 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 29 Jul 2021 14:33:16 GMT Sender: akhilpo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 86349C4360C; Thu, 29 Jul 2021 14:33:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from hyd-lnxbld559.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akhilpo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 70AEAC4323A; Thu, 29 Jul 2021 14:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 70AEAC4323A Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=akhilpo@codeaurora.org From: Akhil P Oommen To: freedreno , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark Cc: Jordan Crouse , Matthias Kaehlcke , Jonathan Marek , Douglas Anderson , Daniel Vetter , David Airlie , Sai Prakash Ranjan , Sean Paul , Sharat Masetty , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] drm/msm/a6xx: Use rev to identify SKU Date: Thu, 29 Jul 2021 20:02:59 +0530 Message-Id: <20210729200230.v2.2.I286ef007fcadd9e6ee3b2c0ad948f990735f9610@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20210729200230.v2.1.I110b87677ef16d97397fb7c81c07a16e1f5d211e@changeid> References: <20210729200230.v2.1.I110b87677ef16d97397fb7c81c07a16e1f5d211e@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use rev instead of revn to identify the SKU. This is in preparation to the introduction of 7c3 gpu which won't have a revn. Signed-off-by: Akhil P Oommen --- (no changes since v1) drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 183b9f9..0da1a66 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1675,11 +1675,11 @@ static u32 a618_get_speed_bin(u32 fuse) return UINT_MAX; } -static u32 fuse_to_supp_hw(struct device *dev, u32 revn, u32 fuse) +static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse) { u32 val = UINT_MAX; - if (revn == 618) + if (adreno_cmp_rev(ADRENO_REV(6, 1, 8, ANY_ID), rev)) val = a618_get_speed_bin(fuse); if (val == UINT_MAX) { @@ -1692,8 +1692,7 @@ static u32 fuse_to_supp_hw(struct device *dev, u32 revn, u32 fuse) return (1 << val); } -static int a6xx_set_supported_hw(struct device *dev, struct a6xx_gpu *a6xx_gpu, - u32 revn) +static int a6xx_set_supported_hw(struct device *dev, struct adreno_rev rev) { u32 supp_hw = UINT_MAX; u16 speedbin; @@ -1714,7 +1713,7 @@ static int a6xx_set_supported_hw(struct device *dev, struct a6xx_gpu *a6xx_gpu, } speedbin = le16_to_cpu(speedbin); - supp_hw = fuse_to_supp_hw(dev, revn, speedbin); + supp_hw = fuse_to_supp_hw(dev, rev, speedbin); done: ret = devm_pm_opp_set_supported_hw(dev, &supp_hw, 1); @@ -1785,7 +1784,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) a6xx_llc_slices_init(pdev, a6xx_gpu); - ret = a6xx_set_supported_hw(&pdev->dev, a6xx_gpu, info->revn); + ret = a6xx_set_supported_hw(&pdev->dev, config->rev); if (ret) { a6xx_destroy(&(a6xx_gpu->base.base)); return ERR_PTR(ret); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation.