Skip to content

Commit 3b1dc21

Browse files
Karunika Choostevenprice-arm
authored andcommitted
drm/panthor: Add support for Mali-Gx15 family of GPUs
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
1 parent 2c0d0a8 commit 3b1dc21

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

drivers/gpu/drm/panthor/panthor_fw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,3 +1404,4 @@ int panthor_fw_init(struct panthor_device *ptdev)
14041404
MODULE_FIRMWARE("arm/mali/arch10.8/mali_csffw.bin");
14051405
MODULE_FIRMWARE("arm/mali/arch10.10/mali_csffw.bin");
14061406
MODULE_FIRMWARE("arm/mali/arch10.12/mali_csffw.bin");
1407+
MODULE_FIRMWARE("arm/mali/arch11.8/mali_csffw.bin");

drivers/gpu/drm/panthor/panthor_hw.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
1313
const u32 gpu_id = ptdev->gpu_info.gpu_id;
1414
const u32 product_id = GPU_PROD_ID_MAKE(GPU_ARCH_MAJOR(gpu_id),
1515
GPU_PROD_MAJOR(gpu_id));
16+
const bool ray_intersection = !!(ptdev->gpu_info.gpu_features &
17+
GPU_FEATURES_RAY_INTERSECTION);
18+
const u8 shader_core_count = hweight64(ptdev->gpu_info.shader_present);
1619

1720
switch (product_id) {
1821
case GPU_PROD_ID_MAKE(10, 2):
@@ -23,6 +26,15 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
2326
return "Mali-G310";
2427
case GPU_PROD_ID_MAKE(10, 7):
2528
return "Mali-G610";
29+
case GPU_PROD_ID_MAKE(11, 2):
30+
if (shader_core_count > 10 && ray_intersection)
31+
return "Mali-G715-Immortalis";
32+
else if (shader_core_count >= 7)
33+
return "Mali-G715";
34+
35+
fallthrough;
36+
case GPU_PROD_ID_MAKE(11, 3):
37+
return "Mali-G615";
2638
}
2739

2840
return "(Unknown Mali GPU)";
@@ -53,6 +65,9 @@ static void panthor_gpu_info_init(struct panthor_device *ptdev)
5365
ptdev->gpu_info.shader_present = gpu_read64(ptdev, GPU_SHADER_PRESENT);
5466
ptdev->gpu_info.tiler_present = gpu_read64(ptdev, GPU_TILER_PRESENT);
5567
ptdev->gpu_info.l2_present = gpu_read64(ptdev, GPU_L2_PRESENT);
68+
69+
/* Introduced in arch 11.x */
70+
ptdev->gpu_info.gpu_features = gpu_read64(ptdev, GPU_FEATURES);
5671
}
5772

5873
static void panthor_hw_info_init(struct panthor_device *ptdev)

drivers/gpu/drm/panthor/panthor_regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
#define GPU_PWR_OVERRIDE0 0x54
7171
#define GPU_PWR_OVERRIDE1 0x58
7272

73+
#define GPU_FEATURES 0x60
74+
#define GPU_FEATURES_RAY_INTERSECTION BIT(2)
75+
7376
#define GPU_TIMESTAMP_OFFSET 0x88
7477
#define GPU_CYCLE_COUNT 0x90
7578
#define GPU_TIMESTAMP 0x98

include/uapi/drm/panthor_drm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ struct drm_panthor_gpu_info {
327327

328328
/** @pad: MBZ. */
329329
__u32 pad;
330+
331+
/** @gpu_features: Bitmask describing supported GPU-wide features */
332+
__u64 gpu_features;
330333
};
331334

332335
/**

0 commit comments

Comments
 (0)