51fbd8de87
Currently, we only sample if the intel_gt is awake, but we acquire our own runtime_pm wakeref. Since intel_gt has transitioned to tracking its own wakeref, we can atomically test and acquire that wakeref instead. v2: Take engine->wakeref for engine sampling Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190801233616.23007-1-chris@chris-wilson.co.uk
36 lines
742 B
C
36 lines
742 B
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef INTEL_GT_PM_H
|
|
#define INTEL_GT_PM_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include "intel_gt_types.h"
|
|
#include "intel_wakeref.h"
|
|
|
|
enum {
|
|
INTEL_GT_UNPARK,
|
|
INTEL_GT_PARK,
|
|
};
|
|
|
|
void intel_gt_pm_get(struct intel_gt *gt);
|
|
void intel_gt_pm_put(struct intel_gt *gt);
|
|
|
|
static inline bool intel_gt_pm_get_if_awake(struct intel_gt *gt)
|
|
{
|
|
return intel_wakeref_get_if_active(>->wakeref);
|
|
}
|
|
|
|
void intel_gt_pm_init_early(struct intel_gt *gt);
|
|
|
|
void intel_gt_sanitize(struct intel_gt *gt, bool force);
|
|
int intel_gt_resume(struct intel_gt *gt);
|
|
void intel_gt_runtime_suspend(struct intel_gt *gt);
|
|
int intel_gt_runtime_resume(struct intel_gt *gt);
|
|
|
|
#endif /* INTEL_GT_PM_H */
|