Lines Matching refs:doorbell

28  * amdgpu_mm_rdoorbell - read a doorbell dword
31 * @index: doorbell index
33 * Returns the value in the doorbell aperture at the
34 * requested doorbell index (CIK).
41 if (index < adev->doorbell.num_kernel_doorbells)
42 return readl(adev->doorbell.cpu_addr + index);
44 DRM_ERROR("reading beyond doorbell aperture: 0x%08x!\n", index);
49 * amdgpu_mm_wdoorbell - write a doorbell dword
52 * @index: doorbell index
55 * Writes @v to the doorbell aperture at the
56 * requested doorbell index (CIK).
63 if (index < adev->doorbell.num_kernel_doorbells)
64 writel(v, adev->doorbell.cpu_addr + index);
66 DRM_ERROR("writing beyond doorbell aperture: 0x%08x!\n", index);
70 * amdgpu_mm_rdoorbell64 - read a doorbell Qword
73 * @index: doorbell index
75 * Returns the value in the doorbell aperture at the
76 * requested doorbell index (VEGA10+).
83 if (index < adev->doorbell.num_kernel_doorbells)
84 return atomic64_read((atomic64_t *)(adev->doorbell.cpu_addr + index));
86 DRM_ERROR("reading beyond doorbell aperture: 0x%08x!\n", index);
91 * amdgpu_mm_wdoorbell64 - write a doorbell Qword
94 * @index: doorbell index
97 * Writes @v to the doorbell aperture at the
98 * requested doorbell index (VEGA10+).
105 if (index < adev->doorbell.num_kernel_doorbells)
106 atomic64_set((atomic64_t *)(adev->doorbell.cpu_addr + index), v);
108 DRM_ERROR("writing beyond doorbell aperture: 0x%08x!\n", index);
112 * amdgpu_doorbell_index_on_bar - Find doorbell's absolute offset in BAR
115 * @db_bo: doorbell object's bo
116 * @doorbell_index: doorbell relative index in this doorbell object
117 * @db_size: doorbell size is in byte
119 * returns doorbell's absolute index in BAR
130 /* doorbell index is 32 bit but doorbell's size can be 32 bit
151 if (adev->doorbell.num_kernel_doorbells == 0)
155 size = ALIGN(adev->doorbell.num_kernel_doorbells * sizeof(u32), PAGE_SIZE);
165 &adev->doorbell.kernel_doorbells,
167 (void **)&adev->doorbell.cpu_addr);
173 adev->doorbell.num_kernel_doorbells = size / sizeof(u32);
178 * GPU doorbell aperture helpers function.
181 * amdgpu_doorbell_init - Init doorbell driver information.
185 * Init doorbell driver information (CIK)
191 /* No doorbell on SI hardware generation */
193 adev->doorbell.base = 0;
194 adev->doorbell.size = 0;
195 adev->doorbell.num_kernel_doorbells = 0;
204 /* doorbell bar mapping */
205 adev->doorbell.base = pci_resource_start(adev->pdev, 2);
206 adev->doorbell.size = pci_resource_len(adev->pdev, 2);
208 adev->doorbell.num_kernel_doorbells =
209 min_t(u32, adev->doorbell.size / sizeof(u32),
211 if (adev->doorbell.num_kernel_doorbells == 0)
215 * For Vega, reserve and map two pages on doorbell BAR since SDMA
216 * paging queue doorbell use the second page. The
222 adev->doorbell.num_kernel_doorbells += 0x400;
228 * amdgpu_doorbell_fini - Tear down doorbell driver information.
232 * Tear down doorbell driver information (CIK)
236 amdgpu_bo_free_kernel(&adev->doorbell.kernel_doorbells,
238 (void **)&adev->doorbell.cpu_addr);