[PATCH v6 1/4] drm/xe: Define XE_REG_IS_VALID

Karthik Poosa karthik.poosa at intel.com
Thu Apr 4 10:08:24 UTC 2024


Add macro to check if struct xe_reg has valid address.

Signed-off-by: Karthik Poosa <karthik.poosa at intel.com>
Suggested-by: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Badal Nilawar <badal.nilawar at intel.com>
Reviewed-by: Badal Nilawar <badal.nilawar at intel.com>
---
 drivers/gpu/drm/xe/regs/xe_reg_defs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/xe/regs/xe_reg_defs.h b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
index c89ef2b79a3f..42078643be6b 100644
--- a/drivers/gpu/drm/xe/regs/xe_reg_defs.h
+++ b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
@@ -131,4 +131,6 @@ struct xe_reg_mcr {
 				 .__reg = XE_REG_INITIALIZER(r_,  ##__VA_ARGS__, .mcr = 1)	\
 				 })
 
+#define XE_REG_IS_VALID(r)	((r.addr) ? true : false)
+
 #endif
-- 
2.25.1



More information about the Intel-xe mailing list