Skip to content

Commit 9d62b07

Browse files
hghimirarodrigovivi
authored andcommitted
drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain()
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 <[email protected]> Cc: Badal Nilawar <[email protected]> Cc: Rodrigo Vivi <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Badal Nilawar <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 38820e6 commit 9d62b07

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/gpu/drm/xe/xe_force_wake.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,20 @@ xe_force_wake_assert_held(struct xe_force_wake *fw,
4646
xe_gt_assert(fw->gt, fw->awake_domains & domain);
4747
}
4848

49+
/**
50+
* xe_force_wake_ref_has_domain - verifies if the domains are in fw_ref
51+
* @fw_ref : the force_wake reference
52+
* @domain : forcewake domain to verify
53+
*
54+
* This function confirms whether the @fw_ref includes a reference to the
55+
* specified @domain.
56+
*
57+
* Return: true if domain is refcounted.
58+
*/
59+
static inline bool
60+
xe_force_wake_ref_has_domain(unsigned int fw_ref, enum xe_force_wake_domains domain)
61+
{
62+
return fw_ref & domain;
63+
}
64+
4965
#endif

0 commit comments

Comments
 (0)