Skip to content

Commit e86a411

Browse files
Shaoyun Liualexdeucher
authored andcommitted
drm/amd/include : Update MES v12 API header(INV_TLBS)
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>
1 parent a7a411e commit e86a411

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

drivers/gpu/drm/amd/include/mes_v12_api_def.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ enum MES_SCH_API_OPCODE {
6666
MES_SCH_API_SET_SE_MODE = 17,
6767
MES_SCH_API_SET_GANG_SUBMIT = 18,
6868
MES_SCH_API_SET_HW_RSRC_1 = 19,
69+
MES_SCH_API_INV_TLBS = 20,
6970

7071
MES_SCH_API_MAX = 0xFF
7172
};
@@ -870,6 +871,35 @@ union MESAPI__SET_GANG_SUBMIT {
870871
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
871872
};
872873

874+
/*
875+
* @inv_sel 0-select pasid as input to do the invalidation , 1-select vmid
876+
* @flush_type 0-old style, 1-light weight, 2-heavyweight, 3-heavyweight2
877+
* @inv_sel_id specific pasid when inv_sel is 0 and specific vmid if inv_sel is 1
878+
* @hub_id 0-gc_hub, 1-mm_hub
879+
*/
880+
struct INV_TLBS {
881+
uint8_t inv_sel;
882+
uint8_t flush_type;
883+
uint16_t inv_sel_id;
884+
uint32_t hub_id;
885+
/* If following two inv_range setting are all 0 , whole VM will be invalidated,
886+
* otherwise only required range be invalidated
887+
*/
888+
uint64_t inv_range_va_start;
889+
uint64_t inv_range_size;
890+
uint64_t reserved;
891+
};
892+
893+
union MESAPI__INV_TLBS {
894+
struct {
895+
union MES_API_HEADER header;
896+
struct MES_API_STATUS api_status;
897+
struct INV_TLBS invalidate_tlbs;
898+
};
899+
900+
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
901+
};
902+
873903
#pragma pack(pop)
874904

875905
#endif

0 commit comments

Comments
 (0)