Lines Matching refs:adev

40 int amdgpu_debugfs_wait_dump(struct amdgpu_device *adev)  in amdgpu_debugfs_wait_dump()  argument
46 wake_up_interruptible(&adev->autodump.gpu_hang); in amdgpu_debugfs_wait_dump()
48 ret = wait_for_completion_interruptible_timeout(&adev->autodump.dumping, timeout); in amdgpu_debugfs_wait_dump()
61 struct amdgpu_device *adev = inode->i_private; in amdgpu_debugfs_autodump_open() local
64 file->private_data = adev; in amdgpu_debugfs_autodump_open()
66 ret = down_read_killable(&adev->reset_sem); in amdgpu_debugfs_autodump_open()
70 if (adev->autodump.dumping.done) { in amdgpu_debugfs_autodump_open()
71 reinit_completion(&adev->autodump.dumping); in amdgpu_debugfs_autodump_open()
77 up_read(&adev->reset_sem); in amdgpu_debugfs_autodump_open()
84 struct amdgpu_device *adev = file->private_data; in amdgpu_debugfs_autodump_release() local
86 complete_all(&adev->autodump.dumping); in amdgpu_debugfs_autodump_release()
92 struct amdgpu_device *adev = file->private_data; in amdgpu_debugfs_autodump_poll() local
94 poll_wait(file, &adev->autodump.gpu_hang, poll_table); in amdgpu_debugfs_autodump_poll()
96 if (amdgpu_in_reset(adev)) in amdgpu_debugfs_autodump_poll()
109 static void amdgpu_debugfs_autodump_init(struct amdgpu_device *adev) in amdgpu_debugfs_autodump_init() argument
111 init_completion(&adev->autodump.dumping); in amdgpu_debugfs_autodump_init()
112 complete_all(&adev->autodump.dumping); in amdgpu_debugfs_autodump_init()
113 init_waitqueue_head(&adev->autodump.gpu_hang); in amdgpu_debugfs_autodump_init()
116 adev_to_drm(adev)->primary->debugfs_root, in amdgpu_debugfs_autodump_init()
117 adev, &autodump_debug_fops); in amdgpu_debugfs_autodump_init()
150 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_process_reg_op() local
192 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
194 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
198 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_process_reg_op()
200 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
205 if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) || in amdgpu_debugfs_process_reg_op()
206 (se_bank != 0xFFFFFFFF && se_bank >= adev->gfx.config.max_shader_engines)) { in amdgpu_debugfs_process_reg_op()
207 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
208 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
209 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_process_reg_op()
212 mutex_lock(&adev->grbm_idx_mutex); in amdgpu_debugfs_process_reg_op()
213 amdgpu_gfx_select_se_sh(adev, se_bank, in amdgpu_debugfs_process_reg_op()
216 mutex_lock(&adev->srbm_mutex); in amdgpu_debugfs_process_reg_op()
217 amdgpu_gfx_select_me_pipe_q(adev, me, pipe, queue, vmid); in amdgpu_debugfs_process_reg_op()
221 mutex_lock(&adev->pm.mutex); in amdgpu_debugfs_process_reg_op()
232 amdgpu_mm_wreg_mmio_rlc(adev, *pos >> 2, value); in amdgpu_debugfs_process_reg_op()
247 amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); in amdgpu_debugfs_process_reg_op()
248 mutex_unlock(&adev->grbm_idx_mutex); in amdgpu_debugfs_process_reg_op()
250 amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0, 0); in amdgpu_debugfs_process_reg_op()
251 mutex_unlock(&adev->srbm_mutex); in amdgpu_debugfs_process_reg_op()
255 mutex_unlock(&adev->pm.mutex); in amdgpu_debugfs_process_reg_op()
257 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
258 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_process_reg_op()
260 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_process_reg_op()
298 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_regs_pcie_read() local
305 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
307 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
311 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_regs_pcie_read()
313 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
323 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
324 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
325 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_pcie_read()
335 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
336 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_read()
338 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_pcie_read()
357 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_regs_pcie_write() local
364 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
366 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
370 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_regs_pcie_write()
372 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
381 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
382 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
383 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_pcie_write()
395 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
396 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_pcie_write()
398 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_pcie_write()
417 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_regs_didt_read() local
424 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
426 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
430 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_regs_didt_read()
432 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
442 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
443 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
444 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_didt_read()
454 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
455 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_read()
457 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_didt_read()
476 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_regs_didt_write() local
483 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
485 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
489 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_regs_didt_write()
491 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
500 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
501 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
502 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_didt_write()
514 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
515 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_didt_write()
517 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_didt_write()
536 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_regs_smc_read() local
543 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
545 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
549 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_regs_smc_read()
551 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
561 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
562 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
563 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_smc_read()
573 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
574 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_read()
576 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_smc_read()
595 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_regs_smc_write() local
602 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
604 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
608 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_regs_smc_write()
610 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
619 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
620 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
621 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_smc_write()
633 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
634 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_regs_smc_write()
636 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_regs_smc_write()
657 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_gca_config_read() local
671 config[no_regs++] = adev->gfx.config.max_shader_engines; in amdgpu_debugfs_gca_config_read()
672 config[no_regs++] = adev->gfx.config.max_tile_pipes; in amdgpu_debugfs_gca_config_read()
673 config[no_regs++] = adev->gfx.config.max_cu_per_sh; in amdgpu_debugfs_gca_config_read()
674 config[no_regs++] = adev->gfx.config.max_sh_per_se; in amdgpu_debugfs_gca_config_read()
675 config[no_regs++] = adev->gfx.config.max_backends_per_se; in amdgpu_debugfs_gca_config_read()
676 config[no_regs++] = adev->gfx.config.max_texture_channel_caches; in amdgpu_debugfs_gca_config_read()
677 config[no_regs++] = adev->gfx.config.max_gprs; in amdgpu_debugfs_gca_config_read()
678 config[no_regs++] = adev->gfx.config.max_gs_threads; in amdgpu_debugfs_gca_config_read()
679 config[no_regs++] = adev->gfx.config.max_hw_contexts; in amdgpu_debugfs_gca_config_read()
680 config[no_regs++] = adev->gfx.config.sc_prim_fifo_size_frontend; in amdgpu_debugfs_gca_config_read()
681 config[no_regs++] = adev->gfx.config.sc_prim_fifo_size_backend; in amdgpu_debugfs_gca_config_read()
682 config[no_regs++] = adev->gfx.config.sc_hiz_tile_fifo_size; in amdgpu_debugfs_gca_config_read()
683 config[no_regs++] = adev->gfx.config.sc_earlyz_tile_fifo_size; in amdgpu_debugfs_gca_config_read()
684 config[no_regs++] = adev->gfx.config.num_tile_pipes; in amdgpu_debugfs_gca_config_read()
685 config[no_regs++] = adev->gfx.config.backend_enable_mask; in amdgpu_debugfs_gca_config_read()
686 config[no_regs++] = adev->gfx.config.mem_max_burst_length_bytes; in amdgpu_debugfs_gca_config_read()
687 config[no_regs++] = adev->gfx.config.mem_row_size_in_kb; in amdgpu_debugfs_gca_config_read()
688 config[no_regs++] = adev->gfx.config.shader_engine_tile_size; in amdgpu_debugfs_gca_config_read()
689 config[no_regs++] = adev->gfx.config.num_gpus; in amdgpu_debugfs_gca_config_read()
690 config[no_regs++] = adev->gfx.config.multi_gpu_tile_size; in amdgpu_debugfs_gca_config_read()
691 config[no_regs++] = adev->gfx.config.mc_arb_ramcfg; in amdgpu_debugfs_gca_config_read()
692 config[no_regs++] = adev->gfx.config.gb_addr_config; in amdgpu_debugfs_gca_config_read()
693 config[no_regs++] = adev->gfx.config.num_rbs; in amdgpu_debugfs_gca_config_read()
696 config[no_regs++] = adev->rev_id; in amdgpu_debugfs_gca_config_read()
697 config[no_regs++] = adev->pg_flags; in amdgpu_debugfs_gca_config_read()
698 config[no_regs++] = adev->cg_flags; in amdgpu_debugfs_gca_config_read()
701 config[no_regs++] = adev->family; in amdgpu_debugfs_gca_config_read()
702 config[no_regs++] = adev->external_rev_id; in amdgpu_debugfs_gca_config_read()
705 config[no_regs++] = adev->pdev->device; in amdgpu_debugfs_gca_config_read()
706 config[no_regs++] = adev->pdev->revision; in amdgpu_debugfs_gca_config_read()
707 config[no_regs++] = adev->pdev->subsystem_device; in amdgpu_debugfs_gca_config_read()
708 config[no_regs++] = adev->pdev->subsystem_vendor; in amdgpu_debugfs_gca_config_read()
746 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_sensor_read() local
753 if (!adev->pm.dpm_enabled) in amdgpu_debugfs_sensor_read()
761 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_sensor_read()
763 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_sensor_read()
767 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_sensor_read()
769 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_sensor_read()
773 r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize); in amdgpu_debugfs_sensor_read()
775 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_sensor_read()
776 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_sensor_read()
779 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_sensor_read()
784 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_sensor_read()
799 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_sensor_read()
827 struct amdgpu_device *adev = f->f_inode->i_private; in amdgpu_debugfs_wave_read() local
843 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_wave_read()
845 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_wave_read()
849 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_wave_read()
851 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_wave_read()
856 mutex_lock(&adev->grbm_idx_mutex); in amdgpu_debugfs_wave_read()
857 amdgpu_gfx_select_se_sh(adev, se, sh, cu); in amdgpu_debugfs_wave_read()
860 if (adev->gfx.funcs->read_wave_data) in amdgpu_debugfs_wave_read()
861 adev->gfx.funcs->read_wave_data(adev, simd, wave, data, &x); in amdgpu_debugfs_wave_read()
863 amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); in amdgpu_debugfs_wave_read()
864 mutex_unlock(&adev->grbm_idx_mutex); in amdgpu_debugfs_wave_read()
866 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_wave_read()
867 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_wave_read()
870 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_wave_read()
880 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_wave_read()
890 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_wave_read()
919 struct amdgpu_device *adev = f->f_inode->i_private; in amdgpu_debugfs_gpr_read() local
941 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_gpr_read()
945 r = amdgpu_virt_enable_access_debugfs(adev); in amdgpu_debugfs_gpr_read()
950 mutex_lock(&adev->grbm_idx_mutex); in amdgpu_debugfs_gpr_read()
951 amdgpu_gfx_select_se_sh(adev, se, sh, cu); in amdgpu_debugfs_gpr_read()
954 if (adev->gfx.funcs->read_wave_vgprs) in amdgpu_debugfs_gpr_read()
955 adev->gfx.funcs->read_wave_vgprs(adev, simd, wave, thread, offset, size>>2, data); in amdgpu_debugfs_gpr_read()
957 if (adev->gfx.funcs->read_wave_sgprs) in amdgpu_debugfs_gpr_read()
958 adev->gfx.funcs->read_wave_sgprs(adev, simd, wave, offset, size>>2, data); in amdgpu_debugfs_gpr_read()
961 amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); in amdgpu_debugfs_gpr_read()
962 mutex_unlock(&adev->grbm_idx_mutex); in amdgpu_debugfs_gpr_read()
964 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_gpr_read()
965 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gpr_read()
973 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_gpr_read()
983 amdgpu_virt_disable_access_debugfs(adev); in amdgpu_debugfs_gpr_read()
987 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gpr_read()
1005 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_gfxoff_write() local
1012 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_write()
1014 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_write()
1023 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_write()
1024 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_write()
1028 amdgpu_gfx_off_ctrl(adev, value ? true : false); in amdgpu_debugfs_gfxoff_write()
1036 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_write()
1037 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_write()
1054 struct amdgpu_device *adev = file_inode(f)->i_private; in amdgpu_debugfs_gfxoff_read() local
1061 r = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1068 r = amdgpu_get_gfx_off_status(adev, &value); in amdgpu_debugfs_gfxoff_read()
1070 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1071 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1077 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1078 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1088 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1089 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_gfxoff_read()
1179 int amdgpu_debugfs_regs_init(struct amdgpu_device *adev) in amdgpu_debugfs_regs_init() argument
1181 struct drm_minor *minor = adev_to_drm(adev)->primary; in amdgpu_debugfs_regs_init()
1188 adev, debugfs_regs[i]); in amdgpu_debugfs_regs_init()
1190 i_size_write(ent->d_inode, adev->rmmio_size); in amdgpu_debugfs_regs_init()
1198 struct amdgpu_device *adev = (struct amdgpu_device *)m->private; in amdgpu_debugfs_test_ib_show() local
1199 struct drm_device *dev = adev_to_drm(adev); in amdgpu_debugfs_test_ib_show()
1209 r = down_read_killable(&adev->reset_sem); in amdgpu_debugfs_test_ib_show()
1215 struct amdgpu_ring *ring = adev->rings[i]; in amdgpu_debugfs_test_ib_show()
1223 r = amdgpu_ib_ring_tests(adev); in amdgpu_debugfs_test_ib_show()
1231 struct amdgpu_ring *ring = adev->rings[i]; in amdgpu_debugfs_test_ib_show()
1238 up_read(&adev->reset_sem); in amdgpu_debugfs_test_ib_show()
1248 struct amdgpu_device *adev = (struct amdgpu_device *)data; in amdgpu_debugfs_evict_vram() local
1249 struct drm_device *dev = adev_to_drm(adev); in amdgpu_debugfs_evict_vram()
1258 *val = amdgpu_bo_evict_vram(adev); in amdgpu_debugfs_evict_vram()
1269 struct amdgpu_device *adev = (struct amdgpu_device *)data; in amdgpu_debugfs_evict_gtt() local
1270 struct drm_device *dev = adev_to_drm(adev); in amdgpu_debugfs_evict_gtt()
1276 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_evict_gtt()
1280 man = ttm_manager_type(&adev->mman.bdev, TTM_PL_TT); in amdgpu_debugfs_evict_gtt()
1281 *val = ttm_resource_manager_evict_all(&adev->mman.bdev, man); in amdgpu_debugfs_evict_gtt()
1292 struct amdgpu_device *adev = (struct amdgpu_device *)m->private; in amdgpu_debugfs_vm_info_show() local
1293 struct drm_device *dev = adev_to_drm(adev); in amdgpu_debugfs_vm_info_show()
1429 struct amdgpu_device *adev = (struct amdgpu_device *)data; in amdgpu_debugfs_ib_preempt() local
1434 ring = adev->rings[val]; in amdgpu_debugfs_ib_preempt()
1449 r = down_read_killable(&adev->reset_sem); in amdgpu_debugfs_ib_preempt()
1456 resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev); in amdgpu_debugfs_ib_preempt()
1492 up_read(&adev->reset_sem); in amdgpu_debugfs_ib_preempt()
1494 ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched); in amdgpu_debugfs_ib_preempt()
1506 struct amdgpu_device *adev = (struct amdgpu_device *)data; in amdgpu_debugfs_sclk_set() local
1508 if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) in amdgpu_debugfs_sclk_set()
1511 ret = pm_runtime_get_sync(adev_to_drm(adev)->dev); in amdgpu_debugfs_sclk_set()
1513 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_sclk_set()
1517 if (is_support_sw_smu(adev)) { in amdgpu_debugfs_sclk_set()
1518 ret = smu_get_dpm_freq_range(&adev->smu, SMU_SCLK, &min_freq, &max_freq); in amdgpu_debugfs_sclk_set()
1521 ret = smu_set_soft_freq_range(&adev->smu, SMU_SCLK, (uint32_t)val, (uint32_t)val); in amdgpu_debugfs_sclk_set()
1526 pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); in amdgpu_debugfs_sclk_set()
1527 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); in amdgpu_debugfs_sclk_set()
1541 int amdgpu_debugfs_init(struct amdgpu_device *adev) in amdgpu_debugfs_init() argument
1543 struct dentry *root = adev_to_drm(adev)->primary->debugfs_root; in amdgpu_debugfs_init()
1547 ent = debugfs_create_file("amdgpu_preempt_ib", 0600, root, adev, in amdgpu_debugfs_init()
1554 ent = debugfs_create_file("amdgpu_force_sclk", 0200, root, adev, in amdgpu_debugfs_init()
1562 amdgpu_ttm_debugfs_init(adev); in amdgpu_debugfs_init()
1563 amdgpu_debugfs_pm_init(adev); in amdgpu_debugfs_init()
1564 amdgpu_debugfs_sa_init(adev); in amdgpu_debugfs_init()
1565 amdgpu_debugfs_fence_init(adev); in amdgpu_debugfs_init()
1566 amdgpu_debugfs_gem_init(adev); in amdgpu_debugfs_init()
1568 r = amdgpu_debugfs_regs_init(adev); in amdgpu_debugfs_init()
1572 amdgpu_debugfs_firmware_init(adev); in amdgpu_debugfs_init()
1575 if (amdgpu_device_has_dc_support(adev)) in amdgpu_debugfs_init()
1576 dtn_debugfs_init(adev); in amdgpu_debugfs_init()
1580 struct amdgpu_ring *ring = adev->rings[i]; in amdgpu_debugfs_init()
1585 if (amdgpu_debugfs_ring_init(adev, ring)) { in amdgpu_debugfs_init()
1590 amdgpu_ras_debugfs_create_all(adev); in amdgpu_debugfs_init()
1591 amdgpu_debugfs_autodump_init(adev); in amdgpu_debugfs_init()
1592 amdgpu_rap_debugfs_init(adev); in amdgpu_debugfs_init()
1593 amdgpu_securedisplay_debugfs_init(adev); in amdgpu_debugfs_init()
1594 amdgpu_fw_attestation_debugfs_init(adev); in amdgpu_debugfs_init()
1596 debugfs_create_file("amdgpu_evict_vram", 0444, root, adev, in amdgpu_debugfs_init()
1598 debugfs_create_file("amdgpu_evict_gtt", 0444, root, adev, in amdgpu_debugfs_init()
1600 debugfs_create_file("amdgpu_test_ib", 0444, root, adev, in amdgpu_debugfs_init()
1602 debugfs_create_file("amdgpu_vm_info", 0444, root, adev, in amdgpu_debugfs_init()
1605 adev->debugfs_vbios_blob.data = adev->bios; in amdgpu_debugfs_init()
1606 adev->debugfs_vbios_blob.size = adev->bios_size; in amdgpu_debugfs_init()
1608 &adev->debugfs_vbios_blob); in amdgpu_debugfs_init()
1614 int amdgpu_debugfs_init(struct amdgpu_device *adev) in amdgpu_debugfs_init() argument
1618 int amdgpu_debugfs_regs_init(struct amdgpu_device *adev) in amdgpu_debugfs_regs_init() argument