summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_force_wake.h
diff options
context:
space:
mode:
authorFrancois Dugast <francois.dugast@intel.com>2023-09-12 11:36:35 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:41:08 +0300
commitc73acc1eeba5e380a367087cb7b933b946613ee7 (patch)
tree7f4df12ec4221d5ffefc92fbbbb813d5874f7c96 /drivers/gpu/drm/xe/xe_force_wake.h
parent1975b5917a94429096f6a2cccc97ed91e0425708 (diff)
downloadlinux-c73acc1eeba5e380a367087cb7b933b946613ee7.tar.xz
drm/xe: Use Xe assert macros instead of XE_WARN_ON macro
The XE_WARN_ON macro maps to WARN_ON which is not justified in many cases where only a simple debug check is needed. Replace the use of the XE_WARN_ON macro with the new xe_assert macros which relies on drm_*. This takes a struct drm_device argument, which is one of the main changes in this commit. The other main change is that the condition is reversed, as with XE_WARN_ON a message is displayed if the condition is true, whereas with xe_assert it is if the condition is false. v2: - Rebase - Keep WARN splats in xe_wopcm.c (Matt Roper) v3: - Rebase Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_force_wake.h')
-rw-r--r--drivers/gpu/drm/xe/xe_force_wake.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
index 7f304704190e..83cb157da7cc 100644
--- a/drivers/gpu/drm/xe/xe_force_wake.h
+++ b/drivers/gpu/drm/xe/xe_force_wake.h
@@ -6,8 +6,8 @@
#ifndef _XE_FORCE_WAKE_H_
#define _XE_FORCE_WAKE_H_
+#include "xe_assert.h"
#include "xe_force_wake_types.h"
-#include "xe_macros.h"
struct xe_gt;
@@ -24,7 +24,7 @@ static inline int
xe_force_wake_ref(struct xe_force_wake *fw,
enum xe_force_wake_domains domain)
{
- XE_WARN_ON(!domain);
+ xe_gt_assert(fw->gt, domain);
return fw->domains[ffs(domain) - 1].ref;
}
@@ -32,7 +32,7 @@ static inline void
xe_force_wake_assert_held(struct xe_force_wake *fw,
enum xe_force_wake_domains domain)
{
- XE_WARN_ON(!(fw->awake_domains & domain));
+ xe_gt_assert(fw->gt, fw->awake_domains & domain);
}
#endif