/* * Copyright 2019 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE.
*/ #include <linux/module.h> #include <linux/uaccess.h> #include <linux/firmware.h> #include"amdgpu.h" #include"amdgpu_amdkfd.h" #include"amdgpu_amdkfd_arcturus.h" #include"amdgpu_reset.h" #include"sdma0/sdma0_4_2_2_offset.h" #include"sdma0/sdma0_4_2_2_sh_mask.h" #include"sdma1/sdma1_4_2_2_offset.h" #include"sdma1/sdma1_4_2_2_sh_mask.h" #include"sdma2/sdma2_4_2_2_offset.h" #include"sdma2/sdma2_4_2_2_sh_mask.h" #include"sdma3/sdma3_4_2_2_offset.h" #include"sdma3/sdma3_4_2_2_sh_mask.h" #include"sdma4/sdma4_4_2_2_offset.h" #include"sdma4/sdma4_4_2_2_sh_mask.h" #include"sdma5/sdma5_4_2_2_offset.h" #include"sdma5/sdma5_4_2_2_sh_mask.h" #include"sdma6/sdma6_4_2_2_offset.h" #include"sdma6/sdma6_4_2_2_sh_mask.h" #include"sdma7/sdma7_4_2_2_offset.h" #include"sdma7/sdma7_4_2_2_sh_mask.h" #include"v9_structs.h" #include"soc15.h" #include"soc15d.h" #include"amdgpu_amdkfd_gfx_v9.h" #include"gfxhub_v1_0.h" #include"mmhub_v9_4.h" #include"gc/gc_9_0_offset.h" #include"gc/gc_9_0_sh_mask.h"
#define HQD_N_REGS 56 #define DUMP_REG(addr) do { \ if (WARN_ON_ONCE(i >= HQD_N_REGS)) \ break; \
(*dump)[i][0] = (addr) << 2; \
(*dump)[i++][1] = RREG32(addr); \
} while (0)
/* * Helper used to suspend/resume gfx pipe for image post process work to set * barrier behaviour.
*/ staticint suspend_resume_compute_scheduler(struct amdgpu_device *adev, bool suspend)
{ int i, r = 0;
for (i = 0; i < adev->gfx.num_compute_rings; i++) { struct amdgpu_ring *ring = &adev->gfx.compute_ring[i];
if (!amdgpu_ring_sched_ready(ring)) continue;
/* stop secheduler and drain ring. */ if (suspend) {
drm_sched_stop(&ring->sched, NULL);
r = amdgpu_fence_wait_empty(ring); if (r) goto out;
} else {
drm_sched_start(&ring->sched, 0);
}
}
out: /* return on resume or failure to drain rings. */ if (!suspend || r) return r;
/* * restore_dbg_registers is ignored here but is a general interface requirement * for devices that support GFXOFF and where the RLC save/restore list * does not support hw registers for debugging i.e. the driver has to manually * initialize the debug mode registers after it has disabled GFX off during the * debug session.
*/ static uint32_t kgd_arcturus_enable_debug_trap(struct amdgpu_device *adev, bool restore_dbg_registers,
uint32_t vmid)
{
mutex_lock(&adev->grbm_idx_mutex);
/* * keep_trap_enabled is ignored here but is a general interface requirement * for devices that support multi-process debugging where the performance * overhead from trap temporary setup needs to be bypassed when the debug * session has ended.
*/ static uint32_t kgd_arcturus_disable_debug_trap(struct amdgpu_device *adev, bool keep_trap_enabled,
uint32_t vmid)
{
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.