From 6140e2fdb0110deadadb90c08087a941b317bfe1 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 15 Nov 2020 23:52:38 +1100 Subject: [PATCH] [amd] all: removed dependency on DRM --- src/amd/amdgpu/atom.c | 6 ++++-- src/amd/common.h | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/amd/amdgpu/atom.c b/src/amd/amdgpu/atom.c index 5f854ed..9a04857 100644 --- a/src/amd/amdgpu/atom.c +++ b/src/amd/amdgpu/atom.c @@ -22,14 +22,16 @@ * Author: Stanislaw Skowronek */ +#include "common.h" + #include #include #include #include #include -#include -#include +//#include +//#include #define ATOM_DEBUG diff --git a/src/amd/common.h b/src/amd/common.h index b999809..5e32fcd 100644 --- a/src/amd/common.h +++ b/src/amd/common.h @@ -24,10 +24,16 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include "vendor-reset-dev.h" /* these are to remove the dependency on DRM */ +#include #define DRM_INFO(fmt, args...) pr_info("vendor-reset-drm: " fmt, ##args) #define DRM_ERROR(fmt, args...) pr_err("vendor-reset-drm: " fmt, ##args) #define DRM_DEBUG(fmt, args...) pr_debug("vendor-reset-drm: " fmt, ##args) - +static inline bool drm_can_sleep(void) +{ + if (in_atomic() || in_dbg_master() || irqs_disabled()) + return false; + return true; +} #define RREG32(reg) \ ({ \