Loading...
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2022 Intel Corporation
4 */
5
6#ifndef _XE_PM_H_
7#define _XE_PM_H_
8
9#include <linux/pm_runtime.h>
10
11#define DEFAULT_VRAM_THRESHOLD 300 /* in MB */
12
13struct xe_device;
14
15int xe_pm_suspend(struct xe_device *xe);
16int xe_pm_resume(struct xe_device *xe);
17
18int xe_pm_init_early(struct xe_device *xe);
19int xe_pm_init(struct xe_device *xe);
20void xe_pm_runtime_fini(struct xe_device *xe);
21bool xe_pm_runtime_suspended(struct xe_device *xe);
22int xe_pm_runtime_suspend(struct xe_device *xe);
23int xe_pm_runtime_resume(struct xe_device *xe);
24void xe_pm_runtime_get(struct xe_device *xe);
25int xe_pm_runtime_get_ioctl(struct xe_device *xe);
26void xe_pm_runtime_put(struct xe_device *xe);
27bool xe_pm_runtime_get_if_active(struct xe_device *xe);
28bool xe_pm_runtime_get_if_in_use(struct xe_device *xe);
29void xe_pm_runtime_get_noresume(struct xe_device *xe);
30bool xe_pm_runtime_resume_and_get(struct xe_device *xe);
31void xe_pm_assert_unbounded_bridge(struct xe_device *xe);
32int xe_pm_set_vram_threshold(struct xe_device *xe, u32 threshold);
33void xe_pm_d3cold_allowed_toggle(struct xe_device *xe);
34bool xe_rpm_reclaim_safe(const struct xe_device *xe);
35struct task_struct *xe_pm_read_callback_task(struct xe_device *xe);
36int xe_pm_module_init(void);
37
38#endif
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2022 Intel Corporation
4 */
5
6#ifndef _XE_PM_H_
7#define _XE_PM_H_
8
9#include <linux/pm_runtime.h>
10
11/*
12 * TODO: Threshold = 0 will block D3Cold.
13 * Before we can move this to a higher value (like 300), we need to:
14 * 1. rewrite the VRAM save / restore to avoid buffer object locks
15 */
16#define DEFAULT_VRAM_THRESHOLD 0 /* in MB */
17
18struct xe_device;
19
20int xe_pm_suspend(struct xe_device *xe);
21int xe_pm_resume(struct xe_device *xe);
22
23void xe_pm_init(struct xe_device *xe);
24void xe_pm_runtime_fini(struct xe_device *xe);
25int xe_pm_runtime_suspend(struct xe_device *xe);
26int xe_pm_runtime_resume(struct xe_device *xe);
27int xe_pm_runtime_get(struct xe_device *xe);
28int xe_pm_runtime_put(struct xe_device *xe);
29int xe_pm_runtime_get_if_active(struct xe_device *xe);
30void xe_pm_assert_unbounded_bridge(struct xe_device *xe);
31int xe_pm_set_vram_threshold(struct xe_device *xe, u32 threshold);
32void xe_pm_d3cold_allowed_toggle(struct xe_device *xe);
33struct task_struct *xe_pm_read_callback_task(struct xe_device *xe);
34
35#endif