summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/regs/xe_reg_defs.h
diff options
context:
space:
mode:
authorKarthik Poosa <karthik.poosa@intel.com>2024-04-05 18:31:24 +0530
committerLucas De Marchi <lucas.demarchi@intel.com>2024-04-09 09:57:31 -0700
commitb39c7056d01be638523ef9b4bfb5b60337ba08fb (patch)
tree85d54b637666cfc6eac37d6d676b0c1a41660ffb /drivers/gpu/drm/xe/regs/xe_reg_defs.h
parentc151ff5c9053338ca9c7fc6fa6435e210cfd5ca7 (diff)
downloadlwn-b39c7056d01be638523ef9b4bfb5b60337ba08fb.tar.gz
lwn-b39c7056d01be638523ef9b4bfb5b60337ba08fb.zip
drm/xe: Define xe_reg_is_valid
Add a function to check if struct xe_reg has valid address. v2: - Rebase. - Make xe_reg_is_valid as inline function instead of a macro. (Badal). - Update commit msg. Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240405130127.1392426-2-karthik.poosa@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/regs/xe_reg_defs.h')
-rw-r--r--drivers/gpu/drm/xe/regs/xe_reg_defs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/regs/xe_reg_defs.h b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
index c89ef2b79a3f..23f7dc5bbe99 100644
--- a/drivers/gpu/drm/xe/regs/xe_reg_defs.h
+++ b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
@@ -131,4 +131,9 @@ struct xe_reg_mcr {
.__reg = XE_REG_INITIALIZER(r_, ##__VA_ARGS__, .mcr = 1) \
})
+static inline bool xe_reg_is_valid(struct xe_reg r)
+{
+ return r.addr;
+}
+
#endif