]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/include : Update MES v12 API header(INV_TLBS)
authorShaoyun Liu <shaoyun.liu@amd.com>
Fri, 4 Jul 2025 16:30:10 +0000 (12:30 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Aug 2025 17:57:51 +0000 (13:57 -0400)
The requirement from driver side is to have an API that can do the
tlb invalidation on dedicate pasid since driver don't know the vmid
and process mapping.
Make the API generic to support different tlb invalidation related
request. Driver can specify pasid, vmid, hub_id and vm address range
need to be invalidated.
With this API the old INV_GART in MISC Op can be deprecated.

Signed-off-by: Shaoyun Liu <shaoyun.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/include/mes_v12_api_def.h

index d85ffab2aff9de3e268c0ed5c9174a62adc2242f..c04bd351b2505df8c614454dfa2362b7f1614b17 100644 (file)
@@ -66,6 +66,7 @@ enum MES_SCH_API_OPCODE {
        MES_SCH_API_SET_SE_MODE                 = 17,
        MES_SCH_API_SET_GANG_SUBMIT             = 18,
        MES_SCH_API_SET_HW_RSRC_1               = 19,
+       MES_SCH_API_INV_TLBS                    = 20,
 
        MES_SCH_API_MAX = 0xFF
 };
@@ -870,6 +871,35 @@ union MESAPI__SET_GANG_SUBMIT {
        uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
 };
 
+/*
+ * @inv_sel        0-select pasid as input to do the invalidation , 1-select vmid
+ * @flush_type     0-old style, 1-light weight, 2-heavyweight, 3-heavyweight2
+ * @inv_sel_id     specific pasid when inv_sel is 0 and specific vmid if inv_sel is 1
+ * @hub_id         0-gc_hub, 1-mm_hub
+ */
+struct INV_TLBS {
+       uint8_t     inv_sel;
+       uint8_t     flush_type;
+       uint16_t    inv_sel_id;
+       uint32_t    hub_id;
+       /* If following two inv_range setting are all 0 , whole VM will be invalidated,
+        * otherwise only required range be invalidated
+        */
+       uint64_t    inv_range_va_start;
+       uint64_t    inv_range_size;
+       uint64_t    reserved;
+};
+
+union MESAPI__INV_TLBS {
+       struct {
+               union MES_API_HEADER    header;
+               struct MES_API_STATUS   api_status;
+               struct INV_TLBS         invalidate_tlbs;
+       };
+
+       uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
+};
+
 #pragma pack(pop)
 
 #endif