]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/panthor: Add support for Mali-Gx15 family of GPUs
authorKarunika Choo <karunika.choo@arm.com>
Thu, 7 Aug 2025 16:26:30 +0000 (17:26 +0100)
committerSteven Price <steven.price@arm.com>
Fri, 15 Aug 2025 09:51:24 +0000 (10:51 +0100)
Mali-Gx15 introduces a new GPU_FEATURES register that provides
information about GPU-wide supported features. The register value will
be passed on to userspace via gpu_info.

Additionally, Mali-Gx15 presents an 'Immortalis' naming variant
depending on the shader core count and presence of Ray Intersection
feature support.

This patch adds:
- support for correctly identifying the model names for Mali-Gx15 GPUs.
- arch 11.8 FW binary support

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Karunika Choo <karunika.choo@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250807162633.3666310-5-karunika.choo@arm.com
drivers/gpu/drm/panthor/panthor_fw.c
drivers/gpu/drm/panthor/panthor_hw.c
drivers/gpu/drm/panthor/panthor_regs.h
include/uapi/drm/panthor_drm.h

index b7b454d16f12cb20b49ceb91f5554e9a42b4acf6..fa6e0b48a0b255add0bb43e071cb00dbd9bf5132 100644 (file)
@@ -1404,3 +1404,4 @@ err_unplug_fw:
 MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
 MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
 MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
+MODULE_FIRMWARE("arm/mali/arch11.8/mali_csffw.bin");
index 6d2ad3c8cb5ea743117a87008eb23822b98073d8..8c041e1074a16bb73a62db1a320f205c3ffaa098 100644 (file)
@@ -13,6 +13,9 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
        const u32 gpu_id = ptdev->gpu_info.gpu_id;
        const u32 product_id = GPU_PROD_ID_MAKE(GPU_ARCH_MAJOR(gpu_id),
                                                GPU_PROD_MAJOR(gpu_id));
+       const bool ray_intersection = !!(ptdev->gpu_info.gpu_features &
+                                        GPU_FEATURES_RAY_INTERSECTION);
+       const u8 shader_core_count = hweight64(ptdev->gpu_info.shader_present);
 
        switch (product_id) {
        case GPU_PROD_ID_MAKE(10, 2):
@@ -23,6 +26,15 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
                return "Mali-G310";
        case GPU_PROD_ID_MAKE(10, 7):
                return "Mali-G610";
+       case GPU_PROD_ID_MAKE(11, 2):
+               if (shader_core_count > 10 && ray_intersection)
+                       return "Mali-G715-Immortalis";
+               else if (shader_core_count >= 7)
+                       return "Mali-G715";
+
+               fallthrough;
+       case GPU_PROD_ID_MAKE(11, 3):
+               return "Mali-G615";
        }
 
        return "(Unknown Mali GPU)";
@@ -53,6 +65,9 @@ static void panthor_gpu_info_init(struct panthor_device *ptdev)
        ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
        ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
        ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
+
+       /* Introduced in arch 11.x */
+       ptdev->gpu_info.gpu_features = gpu_read64(ptdev, GPU_FEATURES);
 }
 
 static void panthor_hw_info_init(struct panthor_device *ptdev)
index 48bbfd40138c153335bd4d34fe917bb17f163968..8bee76d01bf834d736380b212e33d094b2c60422 100644 (file)
@@ -70,6 +70,9 @@
 #define GPU_PWR_OVERRIDE0                              0x54
 #define GPU_PWR_OVERRIDE1                              0x58
 
+#define GPU_FEATURES                                   0x60
+#define   GPU_FEATURES_RAY_INTERSECTION                        BIT(2)
+
 #define GPU_TIMESTAMP_OFFSET                           0x88
 #define GPU_CYCLE_COUNT                                        0x90
 #define GPU_TIMESTAMP                                  0x98
index e1f43deb7ecab23acb952b9a75e09047eb9e226a..467d365ed7ba77051078c2470fa126bbab6606b2 100644 (file)
@@ -327,6 +327,9 @@ struct drm_panthor_gpu_info {
 
        /** @pad: MBZ. */
        __u32 pad;
+
+       /** @gpu_features: Bitmask describing supported GPU-wide features */
+       __u64 gpu_features;
 };
 
 /**