drm/panfrost: Handle HW_ISSUE_TTRX_3076
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 25 May 2022 14:57:49 +0000 (10:57 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 26 May 2022 13:53:01 +0000 (09:53 -0400)
Some Valhall GPUs require resets when encountering bus faults due to
occlusion query writes. Add the issue bit for this and handle it.

Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220525145754.25866-5-alyssa.rosenzweig@collabora.com
drivers/gpu/drm/panfrost/panfrost_device.c
drivers/gpu/drm/panfrost/panfrost_issues.h

index 7f51a4682ccb1d3fd5e7ddeaaad6926cbd780352..ee612303f076546b14177ba20d26a1bd8dee0993 100644 (file)
@@ -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;
 }
 
index 14670ee58ace59fd9716e9f57f001b8c2b1f3ed1..e35807e4b743302d4fd851733c3fdb8d01486c89 100644 (file)
@@ -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
 };