From patchwork Tue Jun 20 17:49:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286290 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 BBA2FEB64D8 for ; Tue, 20 Jun 2023 17:49:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5298510E0F7; Tue, 20 Jun 2023 17:49:32 +0000 (UTC) Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by gabe.freedesktop.org (Postfix) with ESMTPS id 005BF10E067; Tue, 20 Jun 2023 17:49:29 +0000 (UTC) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6b454bc4d6fso406458a34.1; Tue, 20 Jun 2023 10:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687283367; x=1689875367; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aJ6CZE64zC4plyjT4PC0vLkEHuqwnIwxtFdAS1CGai4=; b=VOZFv8N3ln0oI40BxkWJn5cUjUR7oWntFaRDntIpYFFxsXNhI0ssi4ibP9yZTzJhXV /w+0o4XGPeyJOnJ+uWh0IumyCDc2bn0FITREsTaN8LCpPi1TAMNuEEeSu4ISSfvMsA8x DSG9ZPY2t4v3UwG6Y0u1Lu7dOVkCLS6wummhvV8xrxK/y2hkvBVpDe2O9fMcRmtCrMka KO2m34vrSGH+qoFBUOIYfQMhr8Tq22C3IpBCOYNG0y3gulaFmDtwS8oWL4mejQbl2bxd 2397M9QWRU6KgsGwEPASfgdMwgvJxMaVEFOCEQjUwuG/MkSBJ4a8cPJuKTzEcKKb4A3i I7ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687283367; x=1689875367; 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=aJ6CZE64zC4plyjT4PC0vLkEHuqwnIwxtFdAS1CGai4=; b=bgH0j978TwLT2pTvVDuQSS02dJOK+rZ7qWzmCYXaTQr/G0HDj9yGWAtt2SlsK4IXAi ve/4wDZp0BjXerGEYE6jnvIm9MyOF7QcNnB0aIeqwxKXR8zxSGI5KXq+D+ibu3XozavZ KP/g9XOgsBx17lQktBdY25UvlrIcKEqlYrQqsrCPDcRw7FILbjVSg3WKcZDixp7ogyL7 nltXT8di278zgzirx3T072eerNNOh+G1KC8oEBqpo3SOLt+A83tEAVnMzTCIg6GZ41M3 jV/w2zpLCwOXVNrG1/dO6xAqw1s/JdvVnFMnMc0/kSQCgUAWCwTZR1+EPKxB2s+2CFgu Apxg== X-Gm-Message-State: AC+VfDxEI6z00r1D62CJQYo7j5acvamE1hPQNsabY2GuXbzSsrb/T+uz x2RK174O2M/iPtKy1O/RcCk= X-Google-Smtp-Source: ACHHUZ4JC2IIZ7msLVwq9F9DQky2gH+eXg2I73oNqV9RlqHdUdSjPeP3IY8eLcBcF2H1JNc3P0J+rg== X-Received: by 2002:a9d:64cc:0:b0:6b4:26c5:7eab with SMTP id n12-20020a9d64cc000000b006b426c57eabmr9010686otl.2.1687283367632; Tue, 20 Jun 2023 10:49:27 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id r21-20020a9d7cd5000000b006a44338c8efsm1154892otn.44.2023.06.20.10.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:49:27 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH v2 1/4] drm/msm/a2xx: Pass the revision information Date: Tue, 20 Jun 2023 14:49:18 -0300 Message-Id: <20230620174921.898275-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 , freedreno@lists.freedesktop.org, 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: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/gpu/drm/msm/adreno/adreno_gpu.h:171 a2xx_gpu_init+0x138/0x184 Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc7-next-20230620 #993 Pass the GPU revision information to avoid run-time warning. Tested on a imx53-qsb board. Signed-off-by: Fabio Estevam --- Changes since v1: - Make it part of a single patch series. drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c index c67089a7ebc1..4e1218462a23 100644 --- a/drivers/gpu/drm/msm/adreno/a2xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a2xx_gpu.c @@ -520,6 +520,8 @@ struct msm_gpu *a2xx_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; int ret; if (!pdev) { @@ -540,6 +542,23 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) gpu->perfcntrs = perfcntrs; gpu->num_perfcntrs = ARRAY_SIZE(perfcntrs); + /* + * 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_is_a20x(adreno_gpu)) adreno_gpu->registers = a200_registers; else if (adreno_is_a225(adreno_gpu)) From patchwork Tue Jun 20 17:49:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286292 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 2EC94EB64D8 for ; Tue, 20 Jun 2023 17:49:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9664310E320; Tue, 20 Jun 2023 17:49:36 +0000 (UTC) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F57E10E067; Tue, 20 Jun 2023 17:49:31 +0000 (UTC) Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6b466305a7cso229209a34.0; Tue, 20 Jun 2023 10:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687283370; x=1689875370; 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=6YP9agMwH9qTdzgrdMa4Tw0z3MqPQmmHAnxaAinw4+Q=; b=aJHme6UABMswG9QdPiy5kTYCW+kpk43s9dAK+sHeZ/hKH60fLmPZ5AC4ihfSPXw5xx xj9xvjcUMaIf4j2TTuK5dp4fYLXvAi9xJ+yOPPcwcspN2WH9bWxmILyEPdTWepH2NtOg naoTI4K3md0ok34rx70Gq0w3hAyR1LdTvv877L/qFeccEg/pIJJbgYYi89XdpYjq1eUi 8SMfHLF5j0L1Lr3NMFzLgTTsoIG4yORRioApxXn528Wdoh3pzyo6pPQ5QY1xDk+3oCXx 42I+pURot1AZRoA6UxqeslNeWsPt4LuZ128Ew4nFzfpsUGDWOCLcwa2OC2Re1mmTas5b XEaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687283370; x=1689875370; 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=6YP9agMwH9qTdzgrdMa4Tw0z3MqPQmmHAnxaAinw4+Q=; b=gig9gKL+AtznQOX68mbC+vbFRijXvbtGc6Dzba4WEOoZna6iVLGOLVF84y1HXEhrRB CW/YkrxJQbon9D90mBjr4L4MWTJAxPw1+wLlwtvW/LOKiKEic8VXgQpIDUeEIb6DlUeO gMNCyT8y17BhW2eyj3BXECUqvxKpavfh/cN6PU8ScNaUgPqtgyxNXVLN8wqbogBctNoy MJLAoeqTGrE/VtlAApv09zdKzoCHrXSOudIGCXlR4CcOMtB6qPraZLIFhZKaNGo3dGAk /VjFnLZJqH2zx/DwuSNH0TSKNcyYzqvFX6803q8qWyYspgQ7Cbeos5yS8TLGRWYc6248 hqDw== X-Gm-Message-State: AC+VfDzKYY3iZIfCPHwAzA7ncP6aCEQX0xrLPhCkxghRtnesuuSo/o1Z l81tY016/sjKth0nfZ+mzvRrJ8PdotI= X-Google-Smtp-Source: ACHHUZ7k61Dqv9ngYwXj+OAdQNntxlcFUozcpwNn3bGGocVGHtZPEloLWQWE9vBg/wCv7N0XDOyI9A== X-Received: by 2002:a9d:5387:0:b0:6b4:57ad:3d19 with SMTP id w7-20020a9d5387000000b006b457ad3d19mr8286996otg.2.1687283370024; Tue, 20 Jun 2023 10:49:30 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id r21-20020a9d7cd5000000b006a44338c8efsm1154892otn.44.2023.06.20.10.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:49:29 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH v2 2/4] drm/msm/a3xx: Pass the revision information Date: Tue, 20 Jun 2023 14:49:19 -0300 Message-Id: <20230620174921.898275-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620174921.898275-1-festevam@gmail.com> References: <20230620174921.898275-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 , freedreno@lists.freedesktop.org, 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. Changes since v1: - None 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:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286291 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 F2EBEEB64D8 for ; Tue, 20 Jun 2023 17:49:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 48BA410E316; Tue, 20 Jun 2023 17:49:36 +0000 (UTC) Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by gabe.freedesktop.org (Postfix) with ESMTPS id C790A10E30B; Tue, 20 Jun 2023 17:49:33 +0000 (UTC) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6b466305a7cso229226a34.0; Tue, 20 Jun 2023 10:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687283372; x=1689875372; 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=bSIrQQ/RAIvwJvQNHy8+RLPlTtOHjfI9O1iuZkDZSv8=; b=M23cIlfHc2cWLrSZnqh1a6jAvzyxWCqU2OWymvDwDja39orDoZpcmOsG3NlMtVsxab t+8sMf1NDcNr7vVRrapkztZa8N5Nq6OqmW12ZJUHAF7kNuT7N4wNflGOUjjgWCKT7f4K C6yJ8tmxZlzFBkeY5gngk2RY6JMrATzMCh7QiaelGnBY4P6ikVhCreSoUsar7/DNjPBO DlB3w58AT1z6iJDgEuvfFYyYiQhoa4+fmJZYQZlngY6ILo2KC3ppT4FU74bg//27gUIa FT30fZuThRKTv+i7UghzSvWk7LQ5gYF6F4sLiynWlJJYo5CfLqGCwPzcfpMAMLfsL5jF YVFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687283372; x=1689875372; 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=bSIrQQ/RAIvwJvQNHy8+RLPlTtOHjfI9O1iuZkDZSv8=; b=H4IdqMtlXgeSCJZCbn3trORMyB0/tGpuPgIOZ05SGgL4cLP+RG9xr6OWrqpbzwe+Zu IHdDfbj95o4Sj4vqVTZtps+cZoZRcbHanHxHFRTh/3nsla3q6gbNRpYyKr/8Dff4utYI QV1WUZrFbA5xOjVnTZFAdZ1fJK4HufEYz/XDyCM2o2+8E3GIFACXPevuoXwSJh888W05 Lim/+Jpw3tk9p6KGTtDJRQw3l1UkFnCPMmedyWqkaLM+KtyZX3tJ4+8oclVG4OBIgK4D rhY7OgbH0KQKZJIBVEoC+ttui9AYiWMgB9atHc5a2IHYcGHBx7zc1DGAAvRbU2ZHxhv6 i42g== X-Gm-Message-State: AC+VfDwDOk+SQDIb5HQ0lP/0etoJRUqfHWSnVFDcFbz4k7SBrNqgjrx4 GPi+XXF94BYzb9zRELgjyVg= X-Google-Smtp-Source: ACHHUZ5v8ABMn9UdnlOi2nNJDH3HIEWaqObC3fr1PQ25fiJPBQ+Kr6HCcWoCdsMo9v2qyBOh8yQGRA== X-Received: by 2002:a05:6830:620d:b0:6b4:6145:dfb2 with SMTP id cd13-20020a056830620d00b006b46145dfb2mr7655649otb.1.1687283372387; Tue, 20 Jun 2023 10:49:32 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id r21-20020a9d7cd5000000b006a44338c8efsm1154892otn.44.2023.06.20.10.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:49:31 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH v2 3/4] drm/msm/a4xx: Pass the revision information Date: Tue, 20 Jun 2023 14:49:20 -0300 Message-Id: <20230620174921.898275-3-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620174921.898275-1-festevam@gmail.com> References: <20230620174921.898275-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 , freedreno@lists.freedesktop.org, 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. Changes since v1: - None 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:49:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13286293 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 D47DBEB64DB for ; Tue, 20 Jun 2023 17:49:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAB8610E067; Tue, 20 Jun 2023 17:49:44 +0000 (UTC) Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89E2910E31D; Tue, 20 Jun 2023 17:49:35 +0000 (UTC) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6b454bc4d6fso406479a34.1; Tue, 20 Jun 2023 10:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687283375; x=1689875375; 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=M6yg/UXXCTS23FtiZhzKJT6LicQlX76xtAqA3HUyO/Y=; b=oYIh/xreAC67lnF013+BBxFXULxrGnlYWOp6bOA2fEs14dq3GXQWA9tHqzyUoE17FH TBf66ma6VLOPMALj4WHvWJjsToHlR8BMbQFTsNFtSuJwLUVysnTW43rivBfU19AhwW21 SWLeb/vHOpuWO3DS2PSuQ63IzZwzRZH5Uca5g69rABANBs4WJcdY+6l40sj0PAJwslFi 4b8iBga/WWYsj4ZX4bJZjCt2ZqCkP2qw5tEIn0BD6760T4aBUqczHwyppCzvp0ZwS+5Q bMtef0RBJ8hyA+VKi5320YAukU4Wstd+3uavmkQELqYPfeiA7+38SZQr9UnQY6iZLx8z K0uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687283375; x=1689875375; 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=M6yg/UXXCTS23FtiZhzKJT6LicQlX76xtAqA3HUyO/Y=; b=khmdhJ0PBmbHQNpuDw2bFHZSWyrRYMxlgu3eoG1/fCI9zd7lh9r0XLvI69J0gRHdnx asC8dLy+FaErk+N0t7ecHzczH4SU+Drujsyi7lOfz3E9wvy8vFvxoMntTAuphow6jSq4 BCKIoUobF9bnxy1GoeZ+XkG9oNMOnz2iBAtqo+SPEJhFqFCvk4p/gl/Pe5FL5IYHbtn1 RWvc03JWpEZ6FYrvi3kloK/2HkytGXJRRYbt4vgPYDwAbYh/BdLEpiPvZ1AJIAJjeo4E WdOZ6ah6oTty+oNXM2KrRsqoZxDyc8BEKsCGm+lSjaQe1zyDu73g9tdleZd6tsdC+kNk XDzg== X-Gm-Message-State: AC+VfDwA4wtfMp2/DWVWwf7T8e2EKOfccfdCvf9bVhhBrn50sq8325j3 i1+yrdQxuR0An5sWmnQzjS4= X-Google-Smtp-Source: ACHHUZ4jcLaDExhYzfOI1CbsqKjXXPVUdobLo/LGSCqkmcVglCZ9O70lwlLPfChrmk19JriV2A7qjw== X-Received: by 2002:a05:6830:19c1:b0:6b1:6db4:556f with SMTP id p1-20020a05683019c100b006b16db4556fmr7375023otp.3.1687283374819; Tue, 20 Jun 2023 10:49:34 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1e46:4f71:3f19:a267]) by smtp.gmail.com with ESMTPSA id r21-20020a9d7cd5000000b006a44338c8efsm1154892otn.44.2023.06.20.10.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 10:49:34 -0700 (PDT) From: Fabio Estevam To: robdclark@gmail.com Subject: [PATCH v2 4/4] drm/msm/a5xx: Pass the revision information Date: Tue, 20 Jun 2023 14:49:21 -0300 Message-Id: <20230620174921.898275-4-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230620174921.898275-1-festevam@gmail.com> References: <20230620174921.898275-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 , freedreno@lists.freedesktop.org, 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. Changes since v1: - None 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;