Skip to content

Commit

Permalink
drm/i915/gt: document with_intel_gt_pm_if_awake()
Browse files Browse the repository at this point in the history
Add a kernel-doc markup to document this new macro.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b974905bd0f6b5308b91561cc85eeecd94f1452a.1658924372.git.mchehab@kernel.org
  • Loading branch information
Mauro Carvalho Chehab authored and Andi Shyti committed Jul 28, 2022
1 parent 4bedcea commit 4d87d36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_gt_pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ static inline void intel_gt_pm_might_put(struct intel_gt *gt)
for (tmp = 1, intel_gt_pm_get(gt); tmp; \
intel_gt_pm_put(gt), tmp = 0)

/**
* with_intel_gt_pm_if_awake - if GT is PM awake, get a reference to prevent
* it to sleep, run some code and then asynchrously put the reference
* away.
*
* @gt: pointer to the gt
* @wf: pointer to a temporary wakeref.
*/
#define with_intel_gt_pm_if_awake(gt, wf) \
for (wf = intel_gt_pm_get_if_awake(gt); wf; intel_gt_pm_put_async(gt), wf = 0)

Expand Down

0 comments on commit 4d87d36

Please sign in to comment.