drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain()

[ Upstream commit 9d62b07027f0710b7af03d78780d0a6c2425bc1e ]

The helper xe_force_wake_ref_has_domain() checks if the input domain
has been successfully reference-counted and awakened in the reference.

v2
- Fix commit message and kernel-doc (Michal)
- Remove unnecessary paranthesis (Michal)

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241014075601.2324382-4-himal.prasad.ghimiray@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Stable-dep-of: 5dce85fecb87 ("drm/xe: Move the coredump registration to the worker thread")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Himal Prasad Ghimiray
2024-10-14 13:25:38 +05:30
committed by Greg Kroah-Hartman
parent e7fd13686a
commit deb05f8431
+16
View File
@@ -46,4 +46,20 @@ xe_force_wake_assert_held(struct xe_force_wake *fw,
xe_gt_assert(fw->gt, fw->awake_domains & domain);
}
/**
* xe_force_wake_ref_has_domain - verifies if the domains are in fw_ref
* @fw_ref : the force_wake reference
* @domain : forcewake domain to verify
*
* This function confirms whether the @fw_ref includes a reference to the
* specified @domain.
*
* Return: true if domain is refcounted.
*/
static inline bool
xe_force_wake_ref_has_domain(unsigned int fw_ref, enum xe_force_wake_domains domain)
{
return fw_ref & domain;
}
#endif