Jack Xiao
18ee4ce63e
drm/amdgpu: add mes unmap legacy queue routine
...
For mes kiq has been taken over by mes sched, drv can't directly
use mes kiq to unmap queues. drv has to use mes sched api to
unmap legacy queue.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:54 -04:00
Mukul Joshi
464913c0dd
drm/amdgpu/mes: Update the doorbell function signatures
...
Update the function signatures for process doorbell allocations
with MES enabled to make them more generic. KFD would need to
access these functions to allocate/free doorbells when MES is
enabled.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com >
Acked-by: Oak Zeng <Oak.Zeng@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Reviewed-by: Jack Xiao <Jack.Xiao@amd.com >
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:53 -04:00
Jack Xiao
da1c0338f0
drm/amdgpu/mes: disable mes sdma queue test
...
Disable mes sdma queue test on sienna cichlid+,
for fw hasn't supported to map sdma queue.
The test can be enabled if fw supports.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:53 -04:00
Jack Xiao
7c18b40e22
drm/amdgpu/mes: fix vm csa update issue
...
Need reserve VM buffers before update VM csa.
v2: rebase fixes
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:53 -04:00
Jack Xiao
6624d16103
drm/amdgpu/mes: implement mes self test
...
Add mes self test to verify its fundamental functionality by
running ring test and ib test of mes kernel queue.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
cdb7476d96
drm/amdgpu/mes: add ring/ib test for mes self test
...
Run the ring test and ib test for mes self test.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
f1d93c9c27
drm/amdgpu/mes: create gang and queues for mes self test
...
Create gang and queues for mes self test.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
a22f760a02
drm/amdgpu/mes: map ctx metadata for mes self test
...
Map ctx metadata for mes self test.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
e3652b0976
drm/amdgpu/mes: add helper functions to alloc/free ctx metadata
...
Add the helper functions to allocate/free context metadata.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
9cc654c8ce
drm/amdgpu/mes: implement removing mes ring
...
Remove the mes ring and its resources.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
d0c423b647
drm/amdgpu/mes: use ring for kernel queue submission
...
Use ring as the front end for kernel queue submission.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
11ec5b3605
drm/amdgpu/mes: add helper function to get the ctx meta data offset
...
Add the helper function to get the corresponding ctx meta data offset.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
1a27aacb6e
drm/amdgpu/mes: add helper function to convert ring to queue property
...
Add the helper function to convert ring to queue property.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
bcc4e1e1d4
drm/amdgpu/mes: implement removing mes queue
...
Remove the MES queue from MES scheduling and free its resources.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:52 -04:00
Jack Xiao
be5609de15
drm/amdgpu/mes: implement adding mes queue
...
Allocate related resources for the queue and add it to mes
for scheduling.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
5fa963d0fc
drm/amdgpu/mes: initialize mqd from queue properties
...
Add helper function to initialize mqd from queue properties.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
ea756bd5cc
drm/amdgpu/mes: implement resuming all gangs
...
Implement resuming all gangs.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
c8bb10572c
drm/amdgpu/mes: implement suspending all gangs
...
Implement suspending all gangs.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
b0306e5840
drm/amdgpu/mes: implement removing mes gang
...
Free the mes gang and its resources.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
5d0f619f72
drm/amdgpu/mes: implement adding mes gang
...
Gang is a group of the same type queue, which is the scheduling
unit of mes hardware scheduler.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
063a38d662
drm/amdgpu/mes: implement destroying mes process
...
Destroy the mes process, which free resources of the process.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
48dcd2b751
drm/amdgpu/mes: implement creating mes process v2
...
Create a mes process which contains process-related resources,
like vm, doorbell bitmap, process ctx bo and etc.
v2: move the simple variable to the end
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
0bf478f01a
drm/amdgpu/mes: relocate status_fence slot allocation
...
Move the status_fence slot allocation from ip specific function
to general mes function.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
b04c1d6468
drm/amdgpu/mes: initialize/finalize common mes structure v2
...
Initialize/finalize common mes structure.
v2: add mutex_init for adev->mes.mutex
Cc: Le Ma <le.ma@amd.com >
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00
Jack Xiao
32de57e9ef
drm/amdgpu/mes: manage mes doorbell allocation
...
It is used to manage the doorbell allocation of mes processes and queues.
Driver calls into process doorbell allocation to get the slice doorbell
for the process, then the doorbell for a queue is allocated from the
process doorbell slice.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:43:51 -04:00