aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/include')
-rw-r--r--drivers/gpu/drm/amd/include/amd_shared.h4
-rw-r--r--drivers/gpu/drm/amd/include/atomfirmware.h7
-rw-r--r--drivers/gpu/drm/amd/include/kgd_kfd_interface.h115
3 files changed, 9 insertions, 117 deletions
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 2083c308007c..470d7b89071a 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -133,6 +133,10 @@ enum PP_FEATURE_MASK {
133 PP_AVFS_MASK = 0x40000, 133 PP_AVFS_MASK = 0x40000,
134}; 134};
135 135
136enum DC_FEATURE_MASK {
137 DC_FBC_MASK = 0x1,
138};
139
136/** 140/**
137 * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks 141 * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks
138 */ 142 */
diff --git a/drivers/gpu/drm/amd/include/atomfirmware.h b/drivers/gpu/drm/amd/include/atomfirmware.h
index d2e7c0fa96c2..8eb0bb241210 100644
--- a/drivers/gpu/drm/amd/include/atomfirmware.h
+++ b/drivers/gpu/drm/amd/include/atomfirmware.h
@@ -1325,7 +1325,7 @@ struct atom_smu_info_v3_3 {
1325 struct atom_common_table_header table_header; 1325 struct atom_common_table_header table_header;
1326 uint8_t smuip_min_ver; 1326 uint8_t smuip_min_ver;
1327 uint8_t smuip_max_ver; 1327 uint8_t smuip_max_ver;
1328 uint8_t smu_rsd1; 1328 uint8_t waflclk_ss_mode;
1329 uint8_t gpuclk_ss_mode; 1329 uint8_t gpuclk_ss_mode;
1330 uint16_t sclk_ss_percentage; 1330 uint16_t sclk_ss_percentage;
1331 uint16_t sclk_ss_rate_10hz; 1331 uint16_t sclk_ss_rate_10hz;
@@ -1355,7 +1355,10 @@ struct atom_smu_info_v3_3 {
1355 uint32_t syspll3_1_vco_freq_10khz; 1355 uint32_t syspll3_1_vco_freq_10khz;
1356 uint32_t bootup_fclk_10khz; 1356 uint32_t bootup_fclk_10khz;
1357 uint32_t bootup_waflclk_10khz; 1357 uint32_t bootup_waflclk_10khz;
1358 uint32_t reserved[3]; 1358 uint32_t smu_info_caps;
1359 uint16_t waflclk_ss_percentage; // in unit of 0.001%
1360 uint16_t smuinitoffset;
1361 uint32_t reserved;
1359}; 1362};
1360 1363
1361/* 1364/*
diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
index 64ecffd52126..58ac0b90c310 100644
--- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@ -205,20 +205,6 @@ struct tile_config {
205/** 205/**
206 * struct kfd2kgd_calls 206 * struct kfd2kgd_calls
207 * 207 *
208 * @init_gtt_mem_allocation: Allocate a buffer on the gart aperture.
209 * The buffer can be used for mqds, hpds, kernel queue, fence and runlists
210 *
211 * @free_gtt_mem: Frees a buffer that was allocated on the gart aperture
212 *
213 * @get_local_mem_info: Retrieves information about GPU local memory
214 *
215 * @get_gpu_clock_counter: Retrieves GPU clock counter
216 *
217 * @get_max_engine_clock_in_mhz: Retrieves maximum GPU clock in MHz
218 *
219 * @alloc_pasid: Allocate a PASID
220 * @free_pasid: Free a PASID
221 *
222 * @program_sh_mem_settings: A function that should initiate the memory 208 * @program_sh_mem_settings: A function that should initiate the memory
223 * properties such as main aperture memory type (cache / non cached) and 209 * properties such as main aperture memory type (cache / non cached) and
224 * secondary aperture base address, size and memory type. 210 * secondary aperture base address, size and memory type.
@@ -255,64 +241,16 @@ struct tile_config {
255 * 241 *
256 * @get_tile_config: Returns GPU-specific tiling mode information 242 * @get_tile_config: Returns GPU-specific tiling mode information
257 * 243 *
258 * @get_cu_info: Retrieves activated cu info
259 *
260 * @get_vram_usage: Returns current VRAM usage
261 *
262 * @create_process_vm: Create a VM address space for a given process and GPU
263 *
264 * @destroy_process_vm: Destroy a VM
265 *
266 * @get_process_page_dir: Get physical address of a VM page directory
267 *
268 * @set_vm_context_page_table_base: Program page table base for a VMID 244 * @set_vm_context_page_table_base: Program page table base for a VMID
269 * 245 *
270 * @alloc_memory_of_gpu: Allocate GPUVM memory
271 *
272 * @free_memory_of_gpu: Free GPUVM memory
273 *
274 * @map_memory_to_gpu: Map GPUVM memory into a specific VM address
275 * space. Allocates and updates page tables and page directories as
276 * needed. This function may return before all page table updates have
277 * completed. This allows multiple map operations (on multiple GPUs)
278 * to happen concurrently. Use sync_memory to synchronize with all
279 * pending updates.
280 *
281 * @unmap_memor_to_gpu: Unmap GPUVM memory from a specific VM address space
282 *
283 * @sync_memory: Wait for pending page table updates to complete
284 *
285 * @map_gtt_bo_to_kernel: Map a GTT BO for kernel access
286 * Pins the BO, maps it to kernel address space. Such BOs are never evicted.
287 * The kernel virtual address remains valid until the BO is freed.
288 *
289 * @restore_process_bos: Restore all BOs that belong to the
290 * process. This is intended for restoring memory mappings after a TTM
291 * eviction.
292 *
293 * @invalidate_tlbs: Invalidate TLBs for a specific PASID 246 * @invalidate_tlbs: Invalidate TLBs for a specific PASID
294 * 247 *
295 * @invalidate_tlbs_vmid: Invalidate TLBs for a specific VMID 248 * @invalidate_tlbs_vmid: Invalidate TLBs for a specific VMID
296 * 249 *
297 * @submit_ib: Submits an IB to the engine specified by inserting the
298 * IB to the corresponding ring (ring type). The IB is executed with the
299 * specified VMID in a user mode context.
300 *
301 * @get_vm_fault_info: Return information about a recent VM fault on
302 * GFXv7 and v8. If multiple VM faults occurred since the last call of
303 * this function, it will return information about the first of those
304 * faults. On GFXv9 VM fault information is fully contained in the IH
305 * packet and this function is not needed.
306 *
307 * @read_vmid_from_vmfault_reg: On Hawaii the VMID is not set in the 250 * @read_vmid_from_vmfault_reg: On Hawaii the VMID is not set in the
308 * IH ring entry. This function allows the KFD ISR to get the VMID 251 * IH ring entry. This function allows the KFD ISR to get the VMID
309 * from the fault status register as early as possible. 252 * from the fault status register as early as possible.
310 * 253 *
311 * @gpu_recover: let kgd reset gpu after kfd detect CPC hang
312 *
313 * @set_compute_idle: Indicates that compute is idle on a device. This
314 * can be used to change power profiles depending on compute activity.
315 *
316 * @get_hive_id: Returns hive id of current device, 0 if xgmi is not enabled 254 * @get_hive_id: Returns hive id of current device, 0 if xgmi is not enabled
317 * 255 *
318 * This structure contains function pointers to services that the kgd driver 256 * This structure contains function pointers to services that the kgd driver
@@ -320,21 +258,6 @@ struct tile_config {
320 * 258 *
321 */ 259 */
322struct kfd2kgd_calls { 260struct kfd2kgd_calls {
323 int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size,
324 void **mem_obj, uint64_t *gpu_addr,
325 void **cpu_ptr, bool mqd_gfx9);
326
327 void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj);
328
329 void (*get_local_mem_info)(struct kgd_dev *kgd,
330 struct kfd_local_mem_info *mem_info);
331 uint64_t (*get_gpu_clock_counter)(struct kgd_dev *kgd);
332
333 uint32_t (*get_max_engine_clock_in_mhz)(struct kgd_dev *kgd);
334
335 int (*alloc_pasid)(unsigned int bits);
336 void (*free_pasid)(unsigned int pasid);
337
338 /* Register access functions */ 261 /* Register access functions */
339 void (*program_sh_mem_settings)(struct kgd_dev *kgd, uint32_t vmid, 262 void (*program_sh_mem_settings)(struct kgd_dev *kgd, uint32_t vmid,
340 uint32_t sh_mem_config, uint32_t sh_mem_ape1_base, 263 uint32_t sh_mem_config, uint32_t sh_mem_ape1_base,
@@ -398,49 +321,11 @@ struct kfd2kgd_calls {
398 uint64_t va, uint32_t vmid); 321 uint64_t va, uint32_t vmid);
399 int (*get_tile_config)(struct kgd_dev *kgd, struct tile_config *config); 322 int (*get_tile_config)(struct kgd_dev *kgd, struct tile_config *config);
400 323
401 void (*get_cu_info)(struct kgd_dev *kgd,
402 struct kfd_cu_info *cu_info);
403 uint64_t (*get_vram_usage)(struct kgd_dev *kgd);
404
405 int (*create_process_vm)(struct kgd_dev *kgd, unsigned int pasid, void **vm,
406 void **process_info, struct dma_fence **ef);
407 int (*acquire_process_vm)(struct kgd_dev *kgd, struct file *filp,
408 unsigned int pasid, void **vm, void **process_info,
409 struct dma_fence **ef);
410 void (*destroy_process_vm)(struct kgd_dev *kgd, void *vm);
411 void (*release_process_vm)(struct kgd_dev *kgd, void *vm);
412 uint64_t (*get_process_page_dir)(void *vm);
413 void (*set_vm_context_page_table_base)(struct kgd_dev *kgd, 324 void (*set_vm_context_page_table_base)(struct kgd_dev *kgd,
414 uint32_t vmid, uint64_t page_table_base); 325 uint32_t vmid, uint64_t page_table_base);
415 int (*alloc_memory_of_gpu)(struct kgd_dev *kgd, uint64_t va,
416 uint64_t size, void *vm,
417 struct kgd_mem **mem, uint64_t *offset,
418 uint32_t flags);
419 int (*free_memory_of_gpu)(struct kgd_dev *kgd, struct kgd_mem *mem);
420 int (*map_memory_to_gpu)(struct kgd_dev *kgd, struct kgd_mem *mem,
421 void *vm);
422 int (*unmap_memory_to_gpu)(struct kgd_dev *kgd, struct kgd_mem *mem,
423 void *vm);
424 int (*sync_memory)(struct kgd_dev *kgd, struct kgd_mem *mem, bool intr);
425 int (*map_gtt_bo_to_kernel)(struct kgd_dev *kgd, struct kgd_mem *mem,
426 void **kptr, uint64_t *size);
427 int (*restore_process_bos)(void *process_info, struct dma_fence **ef);
428
429 int (*invalidate_tlbs)(struct kgd_dev *kgd, uint16_t pasid); 326 int (*invalidate_tlbs)(struct kgd_dev *kgd, uint16_t pasid);
430 int (*invalidate_tlbs_vmid)(struct kgd_dev *kgd, uint16_t vmid); 327 int (*invalidate_tlbs_vmid)(struct kgd_dev *kgd, uint16_t vmid);
431
432 int (*submit_ib)(struct kgd_dev *kgd, enum kgd_engine_type engine,
433 uint32_t vmid, uint64_t gpu_addr,
434 uint32_t *ib_cmd, uint32_t ib_len);
435
436 int (*get_vm_fault_info)(struct kgd_dev *kgd,
437 struct kfd_vm_fault_info *info);
438 uint32_t (*read_vmid_from_vmfault_reg)(struct kgd_dev *kgd); 328 uint32_t (*read_vmid_from_vmfault_reg)(struct kgd_dev *kgd);
439
440 void (*gpu_recover)(struct kgd_dev *kgd);
441
442 void (*set_compute_idle)(struct kgd_dev *kgd, bool idle);
443
444 uint64_t (*get_hive_id)(struct kgd_dev *kgd); 329 uint64_t (*get_hive_id)(struct kgd_dev *kgd);
445 330
446}; 331};