blob: c06c6a846d9a8d4cf1e76232b8502c0059810c94 [file] [log] [blame]
Jani Nikula696173b2019-04-05 14:00:15 +03001/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2019 Intel Corporation
4 */
5
6#ifndef __INTEL_PM_H__
7#define __INTEL_PM_H__
8
9#include <linux/types.h>
10
Jani Nikulaecbb5fb2019-04-29 15:29:37 +030011#include "i915_reg.h"
12
Jani Nikula696173b2019-04-05 14:00:15 +030013struct drm_device;
14struct drm_i915_private;
15struct i915_request;
Maarten Lankhorst855e0d62019-06-28 10:55:13 +020016struct intel_atomic_state;
Jani Nikula696173b2019-04-05 14:00:15 +030017struct intel_crtc;
18struct intel_crtc_state;
19struct intel_plane;
20struct skl_ddb_allocation;
21struct skl_ddb_entry;
22struct skl_pipe_wm;
23struct skl_wm_level;
24
25void intel_init_clock_gating(struct drm_i915_private *dev_priv);
26void intel_suspend_hw(struct drm_i915_private *dev_priv);
27int ilk_wm_max_level(const struct drm_i915_private *dev_priv);
28void intel_update_watermarks(struct intel_crtc *crtc);
29void intel_init_pm(struct drm_i915_private *dev_priv);
30void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv);
31void intel_pm_setup(struct drm_i915_private *dev_priv);
Jani Nikula696173b2019-04-05 14:00:15 +030032void g4x_wm_get_hw_state(struct drm_i915_private *dev_priv);
33void vlv_wm_get_hw_state(struct drm_i915_private *dev_priv);
34void ilk_wm_get_hw_state(struct drm_i915_private *dev_priv);
35void skl_wm_get_hw_state(struct drm_i915_private *dev_priv);
36void skl_pipe_ddb_get_hw_state(struct intel_crtc *crtc,
37 struct skl_ddb_entry *ddb_y,
38 struct skl_ddb_entry *ddb_uv);
39void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
40 struct skl_ddb_allocation *ddb /* out */);
41void skl_pipe_wm_get_hw_state(struct intel_crtc *crtc,
42 struct skl_pipe_wm *out);
43void g4x_wm_sanitize(struct drm_i915_private *dev_priv);
44void vlv_wm_sanitize(struct drm_i915_private *dev_priv);
Maarten Lankhorst855e0d62019-06-28 10:55:13 +020045bool intel_can_enable_sagv(struct intel_atomic_state *state);
Jani Nikula696173b2019-04-05 14:00:15 +030046int intel_enable_sagv(struct drm_i915_private *dev_priv);
47int intel_disable_sagv(struct drm_i915_private *dev_priv);
48bool skl_wm_level_equals(const struct skl_wm_level *l1,
49 const struct skl_wm_level *l2);
50bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry *ddb,
51 const struct skl_ddb_entry *entries,
52 int num_entries, int ignore_idx);
53void skl_write_plane_wm(struct intel_plane *plane,
54 const struct intel_crtc_state *crtc_state);
55void skl_write_cursor_wm(struct intel_plane *plane,
56 const struct intel_crtc_state *crtc_state);
Ville Syrjälä60aca572019-11-27 21:05:51 +020057bool ilk_disable_lp_wm(struct drm_i915_private *dev_priv);
Jani Nikula696173b2019-04-05 14:00:15 +030058void intel_init_ipc(struct drm_i915_private *dev_priv);
59void intel_enable_ipc(struct drm_i915_private *dev_priv);
60
Jani Nikulad13616d2019-06-06 15:22:00 +030061bool intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable);
Jani Nikulaecbb5fb2019-04-29 15:29:37 +030062
Jani Nikula696173b2019-04-05 14:00:15 +030063#endif /* __INTEL_PM_H__ */