From patchwork Fri Feb 11 20:27:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743835 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 71894C433F5 for ; Fri, 11 Feb 2022 20:27:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A7E510EB82; Fri, 11 Feb 2022 20:27:44 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3BD1310EB82 for ; Fri, 11 Feb 2022 20:27:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 43ACC1F46D9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611260; bh=IwJ14LoYZzda+/Av+WGvVFb98hP/XjwCxic3ZWFVHXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=awomBp1Gon1K02Digb0TkalfIEdRoNWHhUy1MRS/taKCG7Fc7XiLfQEcaBkkJrEOf v9Y6DrtelFsM31hIssZdFS3+9FIRyOe1Of30MNEoyuG9FKTyuLspov5gBi1N45SEsb VkezQiDFHoIOosRWOz/eD9ZlSHTx+EMwuaBOpNs/ejCC5DaDzKNtfo0FHYLauRyscS yGIWVHYJBmpj6Ttagb/d6ATvytlh6PJFM4nD9unjNtvnvtPF0TOyal6oI5IFITNDVr jb2BZ3JtrcLSioMQnACmSO8EBkPe/fGZzaa61Gnz3sTjFhjEpw7HZ+E98IQnUPsSKJ PZk8QMyYxypUA== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/9] dt-bindings: Add arm,mali-valhall compatible Date: Fri, 11 Feb 2022 15:27:20 -0500 Message-Id: <20220211202728.6146-2-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, devicetree@vger.kernel.org, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig From the kernel's perspective, pre-CSF Valhall is more or less compatible with Bifrost, although they differ to userspace. Add a compatible for Valhall to the existing Bifrost bindings documentation. Signed-off-by: Alyssa Rosenzweig Cc: devicetree@vger.kernel.org --- Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml index 63a08f3f321d..48aeabd2ed68 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml @@ -23,6 +23,7 @@ properties: - rockchip,px30-mali - rockchip,rk3568-mali - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable + - const: arm,mali-valhall # Mali Valhall GPU model/revision is fully discoverable reg: maxItems: 1 From patchwork Fri Feb 11 20:27:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743839 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 F3B0AC433F5 for ; Fri, 11 Feb 2022 20:27:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2390A10EB87; Fri, 11 Feb 2022 20:27:56 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C1D110EB82 for ; Fri, 11 Feb 2022 20:27:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 68DF21F46DC4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611262; bh=YpsRozX87Lwm/mSXO0U4MSM6AfF4eXH6RKFVLo7Qnoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RFUF9yuBa58vKGvvYjpd7ZmmShFRbQeZfFgmi74dKWZO2hZ/tcftiKm2JNuFuikA5 Yv0H9y3BvOsc7d4jA6x3arXOlclNgF3bRGQItocMdJMvEh20q7E1tyQdlmMlsF5CE9 V8sR283x1VD0SVUR6MhYippyP5sqT4NdTb3ZksMxqrNvkBF90041krbgldlaKxk3LI SmNW7HrXCgODcd02/jYCCz4P94VgzttlEJAlZWpQWGfo+TSglFBdqxTTriLZmmdqp+ 0oUa2tSckbZrYCmn+xOl3iRSQTe9UdPVG+dqiVZt0hWBW5SLMOH4b28yVTX7MVokrU J8cH8u7bGtlDQ== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/9] drm/panfrost: Handle HW_ISSUE_TTRX_2968_TTRX_3162 Date: Fri, 11 Feb 2022 15:27:21 -0500 Message-Id: <20220211202728.6146-3-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig Add handling for the HW_ISSUE_TTRX_2968_TTRX_3162 quirk. Logic ported from kbase. kbase lists this workaround as used on Mali-G57. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 3 +++ drivers/gpu/drm/panfrost/panfrost_issues.h | 3 +++ drivers/gpu/drm/panfrost/panfrost_regs.h | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index 50c8922694d7..1c1e2017aa80 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -108,6 +108,9 @@ static void panfrost_gpu_init_quirks(struct panfrost_device *pfdev) quirks |= SC_LS_ALLOW_ATTR_TYPES; } + if (panfrost_has_hw_issue(pfdev, HW_ISSUE_TTRX_2968_TTRX_3162)) + quirks |= SC_VAR_ALGORITHM; + if (panfrost_has_hw_feature(pfdev, HW_FEATURE_TLS_HASHING)) quirks |= SC_TLS_HASH_ENABLE; diff --git a/drivers/gpu/drm/panfrost/panfrost_issues.h b/drivers/gpu/drm/panfrost/panfrost_issues.h index 8e59d765bf19..3af7d723377e 100644 --- a/drivers/gpu/drm/panfrost/panfrost_issues.h +++ b/drivers/gpu/drm/panfrost/panfrost_issues.h @@ -125,6 +125,9 @@ enum panfrost_hw_issue { * kernel must fiddle with L2 caches to prevent data leakage */ HW_ISSUE_TGOX_R1_1234, + /* Must set SC_VAR_ALGORITHM */ + HW_ISSUE_TTRX_2968_TTRX_3162, + HW_ISSUE_END }; diff --git a/drivers/gpu/drm/panfrost/panfrost_regs.h b/drivers/gpu/drm/panfrost/panfrost_regs.h index 16e776cc82ea..fa1e1af56e17 100644 --- a/drivers/gpu/drm/panfrost/panfrost_regs.h +++ b/drivers/gpu/drm/panfrost/panfrost_regs.h @@ -195,6 +195,7 @@ #define SC_TLS_HASH_ENABLE BIT(17) #define SC_LS_ATTR_CHECK_DISABLE BIT(18) #define SC_ENABLE_TEXGRD_FLAGS BIT(25) +#define SC_VAR_ALGORITHM BIT(29) /* End SHADER_CONFIG register */ /* TILER_CONFIG register */ From patchwork Fri Feb 11 20:27:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743836 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 F25A6C433F5 for ; Fri, 11 Feb 2022 20:27:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1DAE10EB83; Fri, 11 Feb 2022 20:27:46 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 57A3710EB84 for ; Fri, 11 Feb 2022 20:27:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 8D4BC1F46DE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611264; bh=Zy+MUtoNN87qk7Jck89n2yvVWUk0jhM3HgKR47z9nvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TF7H60Xu6+Dl0o3c/L63qOZUhqBB6EXz82z9MDmCZvyXT17aP9QQRvyndwArLsI8b GpRJRxKpzI/NukAOe3pmFH333w0UbxYSaqdT118N0YGEkUSe+9Ey5pHhGN7vV5U7TP SkDPCbA+idc8PaRRdSq+3+Clem6NLMkHeuFOSFKkTx19COOqfgt9TZ9ecELUJgb8TK 72k9sOGtGiHG1yzsBXi73RCvu+Nvr9T4iF3LRMTpRI3sUePTxp6Nh8jTCeVyx5ID3c GfqIpc5uBQwVjYPNwIsX2A6Z7zXdtPCn0km0s5x1R26u9pqJlA6T/6km7NmgvMBhea VJf84uxWW5wpA== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/9] drm/panfrost: Constify argument to has_hw_issue Date: Fri, 11 Feb 2022 15:27:22 -0500 Message-Id: <20220211202728.6146-4-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig Logically, this function is free of side effects, so any pointers it takes should be const. Needed to avoid a warning in the next patch. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_issues.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_issues.h b/drivers/gpu/drm/panfrost/panfrost_issues.h index 3af7d723377e..a66692663833 100644 --- a/drivers/gpu/drm/panfrost/panfrost_issues.h +++ b/drivers/gpu/drm/panfrost/panfrost_issues.h @@ -251,7 +251,7 @@ enum panfrost_hw_issue { #define hw_issues_g76 0 -static inline bool panfrost_has_hw_issue(struct panfrost_device *pfdev, +static inline bool panfrost_has_hw_issue(const struct panfrost_device *pfdev, enum panfrost_hw_issue issue) { return test_bit(issue, pfdev->features.hw_issues); From patchwork Fri Feb 11 20:27:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743837 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 4611FC433F5 for ; Fri, 11 Feb 2022 20:27:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D10010EB84; Fri, 11 Feb 2022 20:27:50 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 297A110EB84 for ; Fri, 11 Feb 2022 20:27:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 66E3F1F46D9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611266; bh=gYibqNB1+itBfny9gOexMyMgTnphxGX3BqownR/09FY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iof5gWhj6h2dYdrbdRuO3q0wPZ0y7jueb/rGmcNcJcVTvBJhUtiqv+9fAZlgya3Ye tM4pfJ9DaHN21vD1PLvgzFHq8xglnjcI5fa5Z1EUX2iNcIy1hvAG37+iQKAwAkSnxz IBtimq1VDPihuyxEiWCy6/acpLCNo0AZ3CHNZst6v+2ECEZ19D72ZxhJbavTOh19+o VzW1uoKKj8JwoQD7aNzDy1UoN3OcFeFYj3hO2/7o9Wtcg67ph1qG78bT9gQdBFPdn9 q0WUcO5JlP4+fQsfORPS2BGHpSEeG9OkbrLOOkzkEqiZgU/J4uSgZKb4tQLDoLJDbp sokl5BtzMZqig== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/9] drm/panfrost: Handle HW_ISSUE_TTRX_3076 Date: Fri, 11 Feb 2022 15:27:23 -0500 Message-Id: <20220211202728.6146-5-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig Some Valhall GPUs require resets when encountering bus faults due to occlusion query writes. Add the issue bit for this and handle it. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.c | 9 +++++++-- drivers/gpu/drm/panfrost/panfrost_issues.h | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 7f51a4682ccb..ee612303f076 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -11,6 +11,7 @@ #include "panfrost_device.h" #include "panfrost_devfreq.h" #include "panfrost_features.h" +#include "panfrost_issues.h" #include "panfrost_gpu.h" #include "panfrost_job.h" #include "panfrost_mmu.h" @@ -380,9 +381,13 @@ const char *panfrost_exception_name(u32 exception_code) bool panfrost_exception_needs_reset(const struct panfrost_device *pfdev, u32 exception_code) { - /* Right now, none of the GPU we support need a reset, but this - * might change. + /* If an occlusion query write causes a bus fault on affected GPUs, + * future fragment jobs may hang. Reset to workaround. */ + if (exception_code == DRM_PANFROST_EXCEPTION_JOB_BUS_FAULT) + return panfrost_has_hw_issue(pfdev, HW_ISSUE_TTRX_3076); + + /* No other GPUs we support need a reset */ return false; } diff --git a/drivers/gpu/drm/panfrost/panfrost_issues.h b/drivers/gpu/drm/panfrost/panfrost_issues.h index a66692663833..058f6a4c8435 100644 --- a/drivers/gpu/drm/panfrost/panfrost_issues.h +++ b/drivers/gpu/drm/panfrost/panfrost_issues.h @@ -128,6 +128,10 @@ enum panfrost_hw_issue { /* Must set SC_VAR_ALGORITHM */ HW_ISSUE_TTRX_2968_TTRX_3162, + /* Bus fault from occlusion query write may cause future fragment jobs + * to hang */ + HW_ISSUE_TTRX_3076, + HW_ISSUE_END }; From patchwork Fri Feb 11 20:27:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743838 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 A86A8C433F5 for ; Fri, 11 Feb 2022 20:27:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B279510EB85; Fri, 11 Feb 2022 20:27:50 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDF0410EB84 for ; Fri, 11 Feb 2022 20:27:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 599DF1F46DC4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611267; bh=bqg6OrZegdvOXpzjMbq6t9G29v4DHS6ngCEjDNDMJrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xr8lD2Fc5ElX9yLBViX6zYFJ9S/PSwoV0DNR9T9ySq2wcxr8V2K7/vkELgEetFKvp VqVMG1ETYv3VW3gqfM/ETeU33bBGJnniJUjNkErXiqd0o1SRzS8abnpa+C8dtkboAb INZBiwZbqXAo3ajJLLStt34ApuuiijvV9wCsMJ0HOODY9I+sXW9Bt30PJaA8NBwELK uuK4AhYyyxlYAYCfaaHMlGl7LTlHUhbvQRKg7XrDjL0s3Bjh4nL4v6eg/weqhrRSAd YJho7SpMMS0HB0MKY9QKRtYBo8tcCiSyOw9DdX8NNH5Z9Aia9gzY+XcENIJsSrkWrU +Qq51QV7Bc3Sw== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/9] drm/panfrost: Add HW_ISSUE_TTRX_3485 quirk Date: Fri, 11 Feb 2022 15:27:24 -0500 Message-Id: <20220211202728.6146-6-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig TTRX_3485 requires the infamous "dummy job" workaround. I have this workaround implemented in a local branch, but I have not yet hit a case that requires it so I cannot test whether the implementation is correct. In the mean time, add the quirk bit so we can document which platforms may need it in the future. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_issues.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_issues.h b/drivers/gpu/drm/panfrost/panfrost_issues.h index 058f6a4c8435..b8865fc9efce 100644 --- a/drivers/gpu/drm/panfrost/panfrost_issues.h +++ b/drivers/gpu/drm/panfrost/panfrost_issues.h @@ -132,6 +132,9 @@ enum panfrost_hw_issue { * to hang */ HW_ISSUE_TTRX_3076, + /* Must issue a dummy job before starting real work to prevent hangs */ + HW_ISSUE_TTRX_3485, + HW_ISSUE_END }; From patchwork Fri Feb 11 20:27:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743841 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 71F9FC433F5 for ; Fri, 11 Feb 2022 20:28:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 660B010EB89; Fri, 11 Feb 2022 20:28:01 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4040C10EB87 for ; Fri, 11 Feb 2022 20:27:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 19C071F46DE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611270; bh=O83Vp1hSHy3eMKJZOtnubu6FskK5/Z0o+pHADmBx2Bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7/ezwvxyFgxZoLSeOIytabeMu82yI6ZDrFPwTRMtRMmHDPEaXwvkY+msMij0+PSP SfSSgsPl8TnPCV3Utkyqgb7J0Z2VKWtA9bOVOncTcWqtzrhSrCpY4+MDAN/pqq6LhH x2jy2MsqVKnsA0xOdVNZr08+VS8RKE6jy2VJncoW+F1/pSiC3RS8+yd9oEn5YllMk7 PYmy0xJqe0qv9pZ/c/1shAreVMBrh1wxIJgET0tqupiKDto5xES8jwwZ9O4SMLWuOp cJE8kX8dFJn43DR/CEvmLKOEW+qj0sQ/GeMBTgZWeaBm/Vs50mC9MHyIQqNK5l2Hq6 LiDhMN1tbfPYw== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/9] drm/panfrost: Add "clean only safe" feature bit Date: Fri, 11 Feb 2022 15:27:25 -0500 Message-Id: <20220211202728.6146-7-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig Add the HW_FEATURE_CLEAN_ONLY_SAFE bit based on kbase. When I actually tried to port the logic from kbase, trivial jobs raised Data Invalid Faults, so this may depend on other coherency details. It's still useful to have the bit to record the feature bit when adding new models. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_features.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_features.h b/drivers/gpu/drm/panfrost/panfrost_features.h index 36fadcf9634e..1a8bdebc86a3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_features.h +++ b/drivers/gpu/drm/panfrost/panfrost_features.h @@ -21,6 +21,7 @@ enum panfrost_hw_feature { HW_FEATURE_TLS_HASHING, HW_FEATURE_THREAD_GROUP_SPLIT, HW_FEATURE_IDVS_GROUP_SIZE, + HW_FEATURE_CLEAN_ONLY_SAFE, HW_FEATURE_3BIT_EXT_RW_L2_MMU_CONFIG, }; From patchwork Fri Feb 11 20:27:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743840 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 09087C433EF for ; Fri, 11 Feb 2022 20:28:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27D3A10EB88; Fri, 11 Feb 2022 20:27:56 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 663E410EB87 for ; Fri, 11 Feb 2022 20:27:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 71AD61F46D9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611272; bh=NXFW8WjYDUou1HGOEOZ3jdmlu8zAcjF0H+cDU8wYtNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FqVBnNur02e8yaCh6iZt/T1gLYCVsczGxSraP6MnQ41V8m0V+sBXsIdsUsv0G1eMs y8wyX2hnESakOj7SgmfXMcMOjI38A76moBYZqDhU9cID5VcUheuB8qrnosu5B0CTkM yhiE6OVn4UqqM1IBrjfdYs28GXyUJheRuBwh/hXLe0bQle4V6O37BeiaLt7gGbWpYa r2tBfIAO8zM7eFngn88O5pcKZNSFgEoOzeoBfgofO+xETsU9UoF4IgY9h9v8Ut7dCn fETgnTz7DLyAcsNSEmHzGmKAnCWIv4u7nEpSH+CWkBei3/ogbA9ZlDVK0gewTm1jnC Moqbahnxv0FSA== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 7/9] drm/panfrost: Don't set L2_MMU_CONFIG quirks Date: Fri, 11 Feb 2022 15:27:26 -0500 Message-Id: <20220211202728.6146-8-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig L2_MMU_CONFIG is an implementation-defined register. Different Mali GPUs define slightly different MAX_READS and MAX_WRITES fields, which throttle outstanding reads and writes when set to non-zero values. When left as zero, reads and writes are not throttled. Both kbase and panfrost always zero these registers. Per discussion with Steven Price, there are two reasons these quirks may be used: 1. Simulating slower memory subsystems. This use case is only of interest to system-on-chip designers; it is not relevant to mainline. 2. Working around broken memory subsystems. Hopefully we never see this case in mainline. If we do, we'll need to set this register based on an SoC-compatible, rather than generally matching on the GPU model. To the best of our knowledge, these fields are zero at reset, so the write is not necessary. Let's remove the write to aid porting to new Mali GPUs, which have different layouts for the L2_MMU_CONFIG register. Signed-off-by: Alyssa Rosenzweig Suggested-by: Steven Price Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index 1c1e2017aa80..73e5774f01c1 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -127,18 +127,6 @@ static void panfrost_gpu_init_quirks(struct panfrost_device *pfdev) gpu_write(pfdev, GPU_TILER_CONFIG, quirks); - quirks = gpu_read(pfdev, GPU_L2_MMU_CONFIG); - - /* Limit read & write ID width for AXI */ - if (panfrost_has_hw_feature(pfdev, HW_FEATURE_3BIT_EXT_RW_L2_MMU_CONFIG)) - quirks &= ~(L2_MMU_CONFIG_3BIT_LIMIT_EXTERNAL_READS | - L2_MMU_CONFIG_3BIT_LIMIT_EXTERNAL_WRITES); - else - quirks &= ~(L2_MMU_CONFIG_LIMIT_EXTERNAL_READS | - L2_MMU_CONFIG_LIMIT_EXTERNAL_WRITES); - - gpu_write(pfdev, GPU_L2_MMU_CONFIG, quirks); - quirks = 0; if ((panfrost_model_eq(pfdev, 0x860) || panfrost_model_eq(pfdev, 0x880)) && pfdev->features.revision >= 0x2000) From patchwork Fri Feb 11 20:27:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743842 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 4C551C433F5 for ; Fri, 11 Feb 2022 20:28:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7031F10EB8B; Fri, 11 Feb 2022 20:28:02 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 39DF210EB87 for ; Fri, 11 Feb 2022 20:27:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 963641F46DC4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611274; bh=5wGQlYRGMcRSzcIdgF8QxAmpDOar+wxMXkOwhoOlI+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B5AwzfYfshG4ftmxGDPhY7RBt57OD5qX2dJ1HrdMRidCQ1YoHrGZVuQ6CcTfP/GdS 60BEuaZXUPdA9F9xTDazmxsJFORHifPJnfJNTajgHiAjOcCGaQLSieynbjdlh+rwgD cB8Yq7jzRyja4pZikmaNrthcfPHWfkIIohbJ/49EwXHqapgIfqu9YYqD8igmI43/P9 6yS5wwiRozO9/pK4mEGXG0pAk6o9+T9tq8xTkNa9lgiXHubZS+nUrD//Eq9+m/nHlT OixWqljDdYzAS6MSpC172cvLiTPP+w8tOtbK0uYNJz+3ysIGvy4q56jdEZpN+nVxQO qyiS6+noPmm8Q== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 8/9] drm/panfrost: Add Mali-G57 "Natt" support Date: Fri, 11 Feb 2022 15:27:27 -0500 Message-Id: <20220211202728.6146-9-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig Add the features, issues, and GPU ID for Mali-G57, a first-generation Valhall GPU. Other first- and second-generation Valhall GPUs should be similar. Signed-off-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_features.h | 12 ++++++++++++ drivers/gpu/drm/panfrost/panfrost_gpu.c | 2 ++ drivers/gpu/drm/panfrost/panfrost_issues.h | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_features.h b/drivers/gpu/drm/panfrost/panfrost_features.h index 1a8bdebc86a3..7ed0cd3ea2d4 100644 --- a/drivers/gpu/drm/panfrost/panfrost_features.h +++ b/drivers/gpu/drm/panfrost/panfrost_features.h @@ -106,6 +106,18 @@ enum panfrost_hw_feature { BIT_ULL(HW_FEATURE_TLS_HASHING) | \ BIT_ULL(HW_FEATURE_3BIT_EXT_RW_L2_MMU_CONFIG)) +#define hw_features_g57 (\ + BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \ + BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \ + BIT_ULL(HW_FEATURE_XAFFINITY) | \ + BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \ + BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \ + BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \ + BIT_ULL(HW_FEATURE_COHERENCY_REG) | \ + BIT_ULL(HW_FEATURE_AARCH64_MMU) | \ + BIT_ULL(HW_FEATURE_IDVS_GROUP_SIZE) | \ + BIT_ULL(HW_FEATURE_CLEAN_ONLY_SAFE)) + static inline bool panfrost_has_hw_feature(struct panfrost_device *pfdev, enum panfrost_hw_feature feat) { diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index 73e5774f01c1..08d657527099 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -201,6 +201,8 @@ static const struct panfrost_model gpu_models[] = { GPU_MODEL(g52, 0x7002), GPU_MODEL(g31, 0x7003, GPU_REV(g31, 1, 0)), + + GPU_MODEL(g57, 0x9001), }; static void panfrost_gpu_init_features(struct panfrost_device *pfdev) diff --git a/drivers/gpu/drm/panfrost/panfrost_issues.h b/drivers/gpu/drm/panfrost/panfrost_issues.h index b8865fc9efce..1a0dc7f7f857 100644 --- a/drivers/gpu/drm/panfrost/panfrost_issues.h +++ b/drivers/gpu/drm/panfrost/panfrost_issues.h @@ -258,6 +258,11 @@ enum panfrost_hw_issue { #define hw_issues_g76 0 +#define hw_issues_g57 (\ + BIT_ULL(HW_ISSUE_TTRX_2968_TTRX_3162) | \ + BIT_ULL(HW_ISSUE_TTRX_3076) | \ + BIT_ULL(HW_ISSUE_TTRX_3485)) + static inline bool panfrost_has_hw_issue(const struct panfrost_device *pfdev, enum panfrost_hw_issue issue) { From patchwork Fri Feb 11 20:27:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alyssa Rosenzweig X-Patchwork-Id: 12743843 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 F3D3EC433F5 for ; Fri, 11 Feb 2022 20:28:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A10510EB8C; Fri, 11 Feb 2022 20:28:08 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70D3810EB89 for ; Fri, 11 Feb 2022 20:27:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 722A51F46D9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644611276; bh=ZmMMFlFQLfSrBKXUly3aZqfwC/MS0RVnef08jmn4Rcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kS0ZYA4Ec/nlihm+VqRgXiAhIFczvWnKi6ymYGuPmooFjVCaOAK5qR9qjiccsawu9 RiEtGVbrys6d65vu366MPN7ZOqBSNI4ViycCBO24644kAxpPfSPX7zVISod+tiV0gX se88B7eK/Dv8N6ZUkWw2kUhCVLaj5+WLC7wCmjEB/gBPipk0CusU3zG78BWa9W0Lan ja5gEp5xVV8y4aZmbbbSMfPHkoEjN+Cu77rYlv2JB7vtF6KpcExf071Cu5xmlGusQK BI0kl6kn30kQypFs4JdloMl4ZvaZBKk6p06oyXXX5oeyT8Z9d1iue+7sEfGQ1XTW7d qNfHmhSkypQIA== From: alyssa.rosenzweig@collabora.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 9/9] drm/panfrost: Handle arm,mali-valhall compatible Date: Fri, 11 Feb 2022 15:27:28 -0500 Message-Id: <20220211202728.6146-10-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211202728.6146-1-alyssa.rosenzweig@collabora.com> References: <20220211202728.6146-1-alyssa.rosenzweig@collabora.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: tomeu.vizoso@collabora.com, airlied@linux.ie, steven.price@arm.com, Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alyssa Rosenzweig The most important Valhall-specific quirks have been handled, so add the Valhall compatible and probe. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 96bb5a465627..12977454af75 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -663,6 +663,7 @@ static const struct of_device_id dt_match[] = { { .compatible = "arm,mali-t860", .data = &default_data, }, { .compatible = "arm,mali-t880", .data = &default_data, }, { .compatible = "arm,mali-bifrost", .data = &default_data, }, + { .compatible = "arm,mali-valhall", .data = &default_data, }, { .compatible = "mediatek,mt8183-mali", .data = &mediatek_mt8183_data }, {} };