This source file includes following definitions.
- device_queue_manager_init_v9
- compute_sh_mem_bases_64bit
- update_qpd_v9
- init_sdma_vm_v9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "kfd_device_queue_manager.h"
25 #include "vega10_enum.h"
26 #include "gc/gc_9_0_offset.h"
27 #include "gc/gc_9_0_sh_mask.h"
28 #include "sdma0/sdma0_4_0_sh_mask.h"
29
30 static int update_qpd_v9(struct device_queue_manager *dqm,
31 struct qcm_process_device *qpd);
32 static void init_sdma_vm_v9(struct device_queue_manager *dqm, struct queue *q,
33 struct qcm_process_device *qpd);
34
35 void device_queue_manager_init_v9(
36 struct device_queue_manager_asic_ops *asic_ops)
37 {
38 asic_ops->update_qpd = update_qpd_v9;
39 asic_ops->init_sdma_vm = init_sdma_vm_v9;
40 asic_ops->mqd_manager_init = mqd_manager_init_v9;
41 }
42
43 static uint32_t compute_sh_mem_bases_64bit(struct kfd_process_device *pdd)
44 {
45 uint32_t shared_base = pdd->lds_base >> 48;
46 uint32_t private_base = pdd->scratch_base >> 48;
47
48 return (shared_base << SH_MEM_BASES__SHARED_BASE__SHIFT) |
49 private_base;
50 }
51
52 static int update_qpd_v9(struct device_queue_manager *dqm,
53 struct qcm_process_device *qpd)
54 {
55 struct kfd_process_device *pdd;
56
57 pdd = qpd_to_pdd(qpd);
58
59
60 if (qpd->sh_mem_config == 0) {
61 qpd->sh_mem_config =
62 SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
63 SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT;
64 if (amdgpu_noretry &&
65 !dqm->dev->device_info->needs_iommu_device)
66 qpd->sh_mem_config |=
67 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT;
68
69 qpd->sh_mem_ape1_limit = 0;
70 qpd->sh_mem_ape1_base = 0;
71 }
72
73 qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd);
74
75 pr_debug("sh_mem_bases 0x%X\n", qpd->sh_mem_bases);
76
77 return 0;
78 }
79
80 static void init_sdma_vm_v9(struct device_queue_manager *dqm, struct queue *q,
81 struct qcm_process_device *qpd)
82 {
83
84 q->properties.sdma_vm_addr = 0;
85 }