Skip to content

Commit

Permalink
drm/xe: Define xe_reg_is_valid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Karthik Poosa authored and Lucas De Marchi committed Apr 9, 2024
1 parent c151ff5 commit b39c705
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/xe/regs/xe_reg_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b39c705

Please sign in to comment.