drm/xe: Introduce has_device_atomics_on_smem device info
authorNirmoy Das <nirmoy.das@intel.com>
Tue, 30 Apr 2024 16:25:27 +0000 (18:25 +0200)
committerNirmoy Das <nirmoy.das@intel.com>
Mon, 6 May 2024 16:14:10 +0000 (18:14 +0200)
Add has_device_atomics_on_smem to specify that a device
supports device atomics on system memory. Currently XE2
supports this so set this for XE2.

v2: Set has_device_atomics_on_smem for all platform but
    PVC.

Reviewed-by: Oak Zeng <oak.zeng@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240430162529.21588-4-nirmoy.das@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_pci.c

index 7cddb00..0af7399 100644 (file)
@@ -283,6 +283,8 @@ struct xe_device {
                u8 skip_guc_pc:1;
                /** @info.has_atomic_enable_pte_bit: Device has atomic enable PTE bit */
                u8 has_atomic_enable_pte_bit:1;
+               /** @info.has_device_atomics_on_smem: Supports device atomics on SMEM */
+               u8 has_device_atomics_on_smem:1;
 
 #if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
                struct {
index c385f4d..99723a4 100644 (file)
@@ -632,6 +632,8 @@ static int xe_info_init(struct xe_device *xe,
        xe->info.vm_max_level = graphics_desc->vm_max_level;
        xe->info.has_asid = graphics_desc->has_asid;
        xe->info.has_atomic_enable_pte_bit = graphics_desc->has_atomic_enable_pte_bit;
+       if (xe->info.platform != XE_PVC)
+               xe->info.has_device_atomics_on_smem = 1;
        xe->info.has_flat_ccs = graphics_desc->has_flat_ccs;
        xe->info.has_range_tlb_invalidation = graphics_desc->has_range_tlb_invalidation;
        xe->info.has_usm = graphics_desc->has_usm;