From patchwork Tue Jun 20 17:33:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7CDBEB64D7 for ; Tue, 20 Jun 2023 17:33:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FCE010E085; Tue, 20 Jun 2023 17:33:22 +0000 (UTC) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 08BFE10E085 for ; Tue, 20 Jun 2023 17:33:20 +0000 (UTC) Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3a03f54cba5so92791b6e.1 for ; Tue, 20 Jun 2023 10:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687282399; x=1689874399; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uywTz2HjDvRs3bSDIsxko9mYKEgfSs8wTKl7lYuf5kM=; b=hi1M9o/ENWN0nNRLmDYKCz87i3dkzgfgEebX79F9k69jlQxqlk4LcDXbSLc12Vsc6p sbGM/sWGd1q5p2ZKmoQN+24i7PGJOBeAflK8Sp89lfgbo0pcKGplcy8O/ferQInvTAAl zu9t4jQ3vlvKz8bz6H0zQ9UvExcNKfKvtCSHl4EseRGaNTno0rJsuNzOJ3dMwK7+Ctzm 8EA0zA7x/5VVC0e5j0cczPz8xD4CAUblz0C/pGD1Ibjmsf0ppcsuyeanx3w8rkkUEZ4g gbV0D1ix+1PjbDTyiDeYQdgbPQVbiRCsJwOlxf6Y0R3jXykaHhPhB0uiUjPy8OqFKyVi 0pVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687282399; x=1689874399; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uywTz2HjDvRs3bSDIsxko9mYKEgfSs8wTKl7lYuf5kM=; b=Zb7FqZXj2e+3Dq5puX66TuTE/VOFyT0LSxpKD9EGZpBxrJAbkmR6QwXhfAy/OQuJzb DafBmf6FGRKfvKrkm38AG4co6CW82j210c11etopLMQYt2JG4Plmk7R/P7RxtfUEVc9M S5tKYD5elH7btTDbOJXp7eaeOfLd+sGt6lH8AqT8y6/cjWCjSDnPRDSEErsywgo2HctZ BvtkMooE9EjhLGYu5C3PPIalvouwCLozxmEbX8oZxyoTQ79ObukBzppLVPQ6OKT/8e/s pHC4up/OPNZdsQvEAXaJ5eIHSYgfXAMA+RmTXeiDW+1ykq/ELvEngnhmHqzeAOokPNdj qz8g== X-Gm-Message-State: AC+VfDxQ3/pURddjTQrQd+hsAGudyqC+OaqN6VK1+BBNd5Rk/OOLS/iW 3UO6GhchonokChru0JYrObw= X-Google-Smtp-Source: ACHHUZ4byoWYgxmehOrpJhH05zRnsXCphmto+2TSJq0+IoYCLCAm2ki8B2eMzI0LzAfi2NDyXcuYsw== X-Received: by 2002:aca:bd54:0:b0:3a0:457f:4412 with SMTP id n81-20020acabd54000000b003a0457f4412mr655oif.5.1687282399309; Tue, 20 Jun 2023 10:33:19 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id s203-20020acadbd4000000b00396050dca14sm1371204oig.28.2023.06.20.10.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:33:18 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH 1/3] drm/msm/a3xx: Pass the revision information Date: Tue, 20 Jun 2023 14:33:03 -0300 Message-Id: <20230620173305.896438-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmitry.baryshkov@linaro.org, Fabio Estevam , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Commit cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using the adreno_is_xxx() functions. Pass the GPU revision information to avoid run-time warning. Signed-off-by: Fabio Estevam --- Build-tested only. drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index c86b377f6f0d..fc23810d7684 100644 --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -530,6 +530,8 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) struct msm_gpu *gpu; struct msm_drm_private *priv = dev->dev_private; struct platform_device *pdev = priv->gpu_pdev; + struct adreno_platform_config *config = pdev->dev.platform_data; + const struct adreno_info *info; struct icc_path *ocmem_icc_path; struct icc_path *icc_path; int ret; @@ -558,6 +560,25 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) if (ret) goto fail; + /* + * We need to know the platform type before calling into adreno_gpu_init + * so that the hw_apriv flag can be correctly set. Snoop into the info + * and grab the revision number + */ + info = adreno_info(config->rev); + if (!info) { + ret = -EINVAL; + goto fail; + } + + /* Assign these early so that we can use the is_aXYZ helpers */ + /* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; + /* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; + /* Quirk data */ + adreno_gpu->info = info; + /* if needed, allocate gmem: */ if (adreno_is_a330(adreno_gpu)) { ret = adreno_gpu_ocmem_init(&adreno_gpu->base.pdev->dev, From patchwork Tue Jun 20 17:33:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A103EB64D7 for ; Tue, 20 Jun 2023 17:33:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D45C10E194; Tue, 20 Jun 2023 17:33:26 +0000 (UTC) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9475810E194 for ; Tue, 20 Jun 2023 17:33:22 +0000 (UTC) Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a03f54cba5so92796b6e.1 for ; Tue, 20 Jun 2023 10:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687282401; x=1689874401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LYx2BSXmVkjhZKtbosHsNtICM/Opn8luT2i4ms3lVuQ=; b=ja1DK+EfVsFLBQonaalHtAvwANSaQo7GYkXNpWbaSp0cRkGtqE79TfQNLI2MYjDCU1 C49wf3kiE3h0PGyAFglTnKy6qVmYa7shr3ckIaguet+eS2nlEfHYKZlc8duHzk8pZNfo iZcVcJKgSRBwRNuCfzCazYBPb+5vsV34CjX2GBOWaBTLTwSHT5/eGeZYST4RiFNT2/Bn to8Hus9JQDDWXjHmv4YoPvwAirWpBoXqlQpna7uy+bAftL/zMHsJDFk/HvWiHgYMemQe IuctYl5ZxfomNtQF3YvGZ5gfvGqGvdBiu7CcLE9q9wjluTenOOROSJ7f7aAz5sZ7purv 16TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687282401; x=1689874401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LYx2BSXmVkjhZKtbosHsNtICM/Opn8luT2i4ms3lVuQ=; b=VDa/g+aE/a7wyd2eB4+hlarhCMVred2u7+k8B7pIwFRxsh4XFFh/S69L04HmjDRZQk e8Xwh2rS2Se772dZAbKdLjjnZ00x3Hig+5RmHwwvz0Y/HTLmiRNfBmGKvsqL/BSuK9Zn QhCgb9f3gBtlDntlFSEFLYw0GPVAa+j44pKe0KfIcp4DxHva1v1R0PFCxDYL0XcHM9SP N08C18APAP8GRlOJ4xXdC6uBNfyLAHKBwJii+HRPL+4NHjBN2Fkj5aYK8ukbNR+HBUcm i72p9nmIbWXIi6Y0/Et8wgBDbNoYEF5qZloeYovPMO89JxqGjxJUV/JsLVvTQlYC6pay CHmg== X-Gm-Message-State: AC+VfDyblJLoEf3XaPapmtNojSThAsEIc83pdUCzELHmKcFAQ8BNi0Uo JBf14WwhYjBKPMQYS5aS2jo= X-Google-Smtp-Source: ACHHUZ57FL4mMM0ztUiGNzKWrvnIdmSDpZqx10Yh86FtF4X+2axMNl2MqjFENJ9Bah4CWF2BSpFFkg== X-Received: by 2002:aca:f243:0:b0:39a:b2f4:b60f with SMTP id q64-20020acaf243000000b0039ab2f4b60fmr3040845oih.0.1687282401397; Tue, 20 Jun 2023 10:33:21 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id s203-20020acadbd4000000b00396050dca14sm1371204oig.28.2023.06.20.10.33.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:33:20 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH 2/3] drm/msm/43xx: Pass the revision information Date: Tue, 20 Jun 2023 14:33:04 -0300 Message-Id: <20230620173305.896438-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620173305.896438-1-festevam@gmail.com> References: <20230620173305.896438-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmitry.baryshkov@linaro.org, Fabio Estevam , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Commit cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using the adreno_is_xxx() functions. Pass the GPU revision information to avoid run-time warning. Signed-off-by: Fabio Estevam --- Build-tested only. drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c index 715436cb3996..2ae072b4e79d 100644 --- a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c @@ -658,6 +658,8 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) struct msm_gpu *gpu; struct msm_drm_private *priv = dev->dev_private; struct platform_device *pdev = priv->gpu_pdev; + struct adreno_platform_config *config = pdev->dev.platform_data; + const struct adreno_info *info; struct icc_path *ocmem_icc_path; struct icc_path *icc_path; int ret; @@ -684,6 +686,25 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) if (ret) goto fail; + /* + * We need to know the platform type before calling into adreno_gpu_init + * so that the hw_apriv flag can be correctly set. Snoop into the info + * and grab the revision number + */ + info = adreno_info(config->rev); + if (!info) { + ret = -EINVAL; + goto fail; + } + + /* Assign these early so that we can use the is_aXYZ helpers */ + /* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; + /* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; + /* Quirk data */ + adreno_gpu->info = info; + adreno_gpu->registers = adreno_is_a405(adreno_gpu) ? a405_registers : a4xx_registers; From patchwork Tue Jun 20 17:33:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D969EB64D7 for ; Tue, 20 Jun 2023 17:33:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A37DF10E306; Tue, 20 Jun 2023 17:33:27 +0000 (UTC) Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by gabe.freedesktop.org (Postfix) with ESMTPS id B78B210E194 for ; Tue, 20 Jun 2023 17:33:24 +0000 (UTC) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1a9e88d21d4so1213868fac.1 for ; Tue, 20 Jun 2023 10:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687282403; x=1689874403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ESFewTyZPM1OZhlLkTTRzDuiv/Xt5eFtjuIGmwBh8EU=; b=VcNP8VPoeXjf8XzzY44xuIAy5XVftRzxUBSgwq4xXNKnyh2419rLqYC1+/Wap+LJSk QXAk4TsuMKdkintyweMt+tS6zHQ9DMQt6fXwqIYOvbQ6UbUIO8L60ilj6o/6dhylcMet tUUeXUZ108ZfMeecTioGnntMKiB2VIjDV2v1AokopJoAZvbb0Yu9VFdo2vdqXIlfd1HY 82+3BsgNYV/GcP8doZz7iFs8lz+kdnxtkowYlRnL8D9NrirCWQ6KJLH29WDPy1S1WRrE dFAZcbBbBDUgRbxy3GmUdFXVXu6MCwC1vSgzWNCzajaOLhbgVNVK0LsQFhSyogy4gMW/ pQcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687282403; x=1689874403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ESFewTyZPM1OZhlLkTTRzDuiv/Xt5eFtjuIGmwBh8EU=; b=T1LubFfYUGxSIXL512kAeZW3E0QxLFTrCjbNJDoc9ShQebvXa55IsPG+VhQYsWtCDZ Z/pEWXw3o4rhCjF6Zamp5g8bGc9Hr9p/njBbvK/Outw8WhWHVhK2+EaN6bm2PQ1pkzCi 0POO/Rh0prO3GB60uqzIZ5KvueYmwrRxA+YcfpdVS3LtqdAOCaDHRnizVjUC4R+TCGWo rsEJEb/I7mt/rLf9+m4Qh/RYQr+HX5Ow71r81du8fp71XhiFPSk1Q+d0aKdGAT2X+3sj iVQmuPJ4QkTCL1zuoCtHp5/uoJDbXHv1P9F+ZPtURRLLeZiR5X9fh9URKm+TdWQLkpKI p1FQ== X-Gm-Message-State: AC+VfDyQkVqo4vvbh+Pl65wT8X6HU0ZdbofSjgQxzGstwyGuf6isqwd4 tcLwEhxecN0LmZBTJPQ5iak= X-Google-Smtp-Source: ACHHUZ6+UrC4TZhz6QGK2px+UHwY9GWTptXgVSILSEf+PDFxewEanXrVq0nv2OesI2usdYOBO9u2Zw== X-Received: by 2002:aca:3405:0:b0:39e:ced8:8122 with SMTP id b5-20020aca3405000000b0039eced88122mr4697432oia.2.1687282403488; Tue, 20 Jun 2023 10:33:23 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id s203-20020acadbd4000000b00396050dca14sm1371204oig.28.2023.06.20.10.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:33:23 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH 3/3] drm/msm/a5xx: Pass the revision information Date: Tue, 20 Jun 2023 14:33:05 -0300 Message-Id: <20230620173305.896438-3-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620173305.896438-1-festevam@gmail.com> References: <20230620173305.896438-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmitry.baryshkov@linaro.org, Fabio Estevam , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Commit cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") exposes the need of setting the GPU revision fields prior to using the adreno_is_xxx() functions. Pass the GPU revision information to avoid run-time warning. Signed-off-by: Fabio Estevam --- Build-tested only. drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index a99310b68793..b4c1720ba89c 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1744,6 +1744,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) struct msm_drm_private *priv = dev->dev_private; struct platform_device *pdev = priv->gpu_pdev; struct adreno_platform_config *config = pdev->dev.platform_data; + const struct adreno_info *info; struct a5xx_gpu *a5xx_gpu = NULL; struct adreno_gpu *adreno_gpu; struct msm_gpu *gpu; @@ -1770,6 +1771,23 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) nr_rings = 4; + /* + * We need to know the platform type before calling into adreno_gpu_init + * so that the hw_apriv flag can be correctly set. Snoop into the info + * and grab the revision number + */ + info = adreno_info(config->rev); + if (!info) + return ERR_PTR(-EINVAL); + + /* Assign these early so that we can use the is_aXYZ helpers */ + /* Numeric revision IDs (e.g. 630) */ + adreno_gpu->revn = info->revn; + /* New-style ADRENO_REV()-only */ + adreno_gpu->rev = info->rev; + /* Quirk data */ + adreno_gpu->info = info; + if (adreno_cmp_rev(ADRENO_REV(5, 1, 0, ANY_ID), config->rev)) nr_rings = 1;