intel_engine_pm.h 823 字节
Newer Older
1 2 3 4 5 6 7 8 9
/*
 * SPDX-License-Identifier: MIT
 *
 * Copyright © 2019 Intel Corporation
 */

#ifndef INTEL_ENGINE_PM_H
#define INTEL_ENGINE_PM_H

10 11 12
#include "intel_engine_types.h"
#include "intel_wakeref.h"

13 14 15 16 17
struct drm_i915_private;

void intel_engine_pm_get(struct intel_engine_cs *engine);
void intel_engine_pm_put(struct intel_engine_cs *engine);

18 19 20 21 22 23
static inline bool
intel_engine_pm_is_awake(const struct intel_engine_cs *engine)
{
	return intel_wakeref_is_active(&engine->wakeref);
}

24 25 26 27 28 29
static inline bool
intel_engine_pm_get_if_awake(struct intel_engine_cs *engine)
{
	return intel_wakeref_get_if_active(&engine->wakeref);
}

30 31
void intel_engine_park(struct intel_engine_cs *engine);

32 33 34 35 36
void intel_engine_init__pm(struct intel_engine_cs *engine);

int intel_engines_resume(struct drm_i915_private *i915);

#endif /* INTEL_ENGINE_PM_H */