panfrost: XMLify exception access
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 12 Aug 2020 01:19:52 +0000 (21:19 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 13 Aug 2020 06:55:17 +0000 (08:55 +0200)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>

src/panfrost/include/panfrost-job.h
src/panfrost/lib/decode.c
src/panfrost/lib/midgard.xml

index c4481de51015ed4e9af83f4b0a86ccdb8921133d..75ee394bedcf7b9e43fa131eb1368d6a1c5a0e78 100644 (file)
@@ -655,21 +655,6 @@ struct mali_job_descriptor_header {
         u64 next_job;
 } __attribute__((packed));
 
-/* These concern exception_status */
-
-/* Access type causing a fault, paralleling AS_FAULTSTATUS_* entries in the
- * kernel */
-
-enum mali_exception_access {
-        /* Atomic in the kernel for MMU, but that doesn't make sense for a job
-         * fault so it's just unused */
-        MALI_EXCEPTION_ACCESS_NONE    = 0,
-
-        MALI_EXCEPTION_ACCESS_EXECUTE = 1,
-        MALI_EXCEPTION_ACCESS_READ    = 2,
-        MALI_EXCEPTION_ACCESS_WRITE   = 3
-};
-
 /* Details about write_value from panfrost igt tests which use it as a generic
  * dword write primitive */
 
index 6538b47f8a3d75d45af535fdbf52b845cb74fec1..d103829fe5ce1a3fc4ca50ed48c5ee9429e50135 100644 (file)
@@ -494,21 +494,6 @@ pandecode_special_record(uint64_t v, bool* attribute)
         }
 }
 
-#define DEFINE_CASE(name) case MALI_EXCEPTION_ACCESS_## name: return ""#name
-static char *
-pandecode_exception_access(unsigned access)
-{
-        switch (access) {
-                DEFINE_CASE(NONE);
-                DEFINE_CASE(EXECUTE);
-                DEFINE_CASE(READ);
-                DEFINE_CASE(WRITE);
-
-        default:
-                unreachable("Invalid case");
-        }
-}
-#undef DEFINE_CASE
 
 /* Midgard's tiler descriptor is embedded within the
  * larger FBD */
@@ -2862,7 +2847,7 @@ pandecode_jc(mali_ptr jc_gpu_va, bool bifrost, unsigned gpu_id, bool minimal)
                         pandecode_prop("exception_status = %x (source ID: 0x%x access: %s exception: 0x%x)",
                                        h->exception_status,
                                        (h->exception_status >> 16) & 0xFFFF,
-                                       pandecode_exception_access((h->exception_status >> 8) & 0x3),
+                                       mali_exception_access_as_str((h->exception_status >> 8) & 0x3),
                                        h->exception_status  & 0xFF);
 
                 if (h->first_incomplete_task)
index 37aa98987de21f3ca8be413f0020630542427d11..97199b5a032f86a3ed00df8373ef7a1f5eda2f0b 100644 (file)
     <value name="Quad strip" value="15"/>
   </enum>
 
+  <enum name="Exception Access">
+    <value name="None" value="0"/>
+    <value name="Execute" value="2"/>
+    <value name="Read" value="1"/>
+    <value name="Write" value="3"/>
+  </enum>
+
   <enum name="Func">
     <value name="Never" value="0"/>
     <value name="Less" value="1"/>