drm/amdgpu: refactor code to split devcoredump code
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: refactor code to split devcoredump code
Refractor devcoredump code into new files since its functionality is expanded further and better to slit and devcoredump to have its own file.
v2: Fix the build failure caught by arm compiler
of implicit function declaration with #ifdef
Cc Ivan Lipski <[email protected]>
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/Makefile | 2 +- .../gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 218 ++++++++++++++++++ .../gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h | 47 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 191 --------------- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 16 -- 6 files changed, 270 insertions(+), 208 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -1
@@ -81,7 +81,7 @@ amdgpu-y += amdgpu_device.o amdgpu_doorbell_mgr.o amdgpu_kms.o \ amdgpu_umc.o smu_v11_0_i2c.o amdgpu_fru_eeprom.o amdgpu_rap.o \ amdgpu_fw_attestation.o amdgpu_securedisplay.o \ amdgpu_eeprom.o amdgpu_mca.o amdgpu_psp_ta.o amdgpu_lsdma.o \ - amdgpu_ring_mux.o amdgpu_xcp.o amdgpu_seq64.o amdgpu_aca.o + amdgpu_ring_mux.o amdgpu_xcp.o amdgpu_seq64.o amdgpu_aca.o amdgpu_dev_coredump.o amdgpu-$(CONFIG_PROC_FS) += amdgpu_fdinfo.o
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c new file +218 -0
218 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h new file +47 -0
47 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -0
@@ -75,6 +75,10 @@#include "amdgpu_reset.h" #include "amdgpu_virt.h" +#ifdef CONFIG_DEV_COREDUMP +#include "amdgpu_dev_coredump.h" +#endif +#include <linux/suspend.h> #include <drm/task_barrier.h> #include <linux/pm_runtime.h>
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +0 -191
205 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +0 -16
@@ -88,19 +88,6 @@ struct amdgpu_reset_domain {atomic_t reset_res; }; -#ifdef CONFIG_DEV_COREDUMP - -#define AMDGPU_COREDUMP_VERSION "1" - -struct amdgpu_coredump_info { -struct amdgpu_device *adev; -struct amdgpu_task_info reset_task_info; -struct timespec64 reset_time; -bool reset_vram_lost; -struct amdgpu_ring *ring; -}; -#endif -int amdgpu_reset_init (struct amdgpu_device *adev);int amdgpu_reset_fini (struct amdgpu_device *adev);
@@ -141,9 +128,6 @@ void amdgpu_device_lock_reset_domain(struct amdgpu_reset_domain *reset_domain);void amdgpu_device_unlock_reset_domain (struct amdgpu_reset_domain *reset_domain); -void amdgpu_coredump (struct amdgpu_device *adev,bool vram_lost, -struct amdgpu_reset_context *reset_context); -#define for_each_handler (i, handler, reset_ctl) \ for (i = 0; (i < AMDGPU_RESET_MAX_HANDLERS) && \ (handler = (*reset_ctl->reset_handlers)[i]); \
Signature · 1 line
2.34.1