xref: /linux/drivers/gpu/drm/i915/i915_irq.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __I915_IRQ_H__
7 #define __I915_IRQ_H__
8 
9 #include <linux/ktime.h>
10 #include <linux/types.h>
11 
12 #include "i915_reg_defs.h"
13 
14 enum pipe;
15 struct drm_crtc;
16 struct drm_device;
17 struct drm_display_mode;
18 struct drm_i915_private;
19 struct intel_crtc;
20 struct intel_encoder;
21 struct intel_uncore;
22 
23 void intel_irq_init(struct drm_i915_private *dev_priv);
24 void intel_irq_fini(struct drm_i915_private *dev_priv);
25 int intel_irq_install(struct drm_i915_private *dev_priv);
26 void intel_irq_uninstall(struct drm_i915_private *dev_priv);
27 
28 void gen5_enable_gt_irq(struct drm_i915_private *dev_priv, u32 mask);
29 void gen5_disable_gt_irq(struct drm_i915_private *dev_priv, u32 mask);
30 void gen11_reset_rps_interrupts(struct drm_i915_private *dev_priv);
31 void gen6_reset_rps_interrupts(struct drm_i915_private *dev_priv);
32 void gen6_enable_rps_interrupts(struct drm_i915_private *dev_priv);
33 void gen6_disable_rps_interrupts(struct drm_i915_private *dev_priv);
34 void gen6_rps_reset_ei(struct drm_i915_private *dev_priv);
35 u32 gen6_sanitize_rps_pm_mask(const struct drm_i915_private *i915, u32 mask);
36 
37 void intel_irq_suspend(struct drm_i915_private *i915);
38 void intel_irq_resume(struct drm_i915_private *i915);
39 bool intel_irqs_enabled(struct drm_i915_private *dev_priv);
40 void intel_synchronize_irq(struct drm_i915_private *i915);
41 void intel_synchronize_hardirq(struct drm_i915_private *i915);
42 
43 void gen2_assert_iir_is_zero(struct intel_uncore *uncore, i915_reg_t reg);
44 
45 void gen2_irq_reset(struct intel_uncore *uncore, struct i915_irq_regs regs);
46 
47 void gen2_irq_init(struct intel_uncore *uncore, struct i915_irq_regs regs,
48 		   u32 imr_val, u32 ier_val);
49 
50 #endif /* __I915_IRQ_H__ */
51