1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_OVERLAY_H__
7 #define __INTEL_OVERLAY_H__
8 
9 struct drm_device;
10 struct drm_file;
11 struct drm_i915_private;
12 struct drm_printer;
13 struct intel_overlay;
14 struct intel_overlay_error_state;
15 
16 #ifdef I915
17 void intel_overlay_setup(struct drm_i915_private *dev_priv);
18 void intel_overlay_cleanup(struct drm_i915_private *dev_priv);
19 int intel_overlay_switch_off(struct intel_overlay *overlay);
20 int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
21 				  struct drm_file *file_priv);
22 int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
23 			      struct drm_file *file_priv);
24 void intel_overlay_reset(struct drm_i915_private *dev_priv);
25 struct intel_overlay_error_state *
26 intel_overlay_capture_error_state(struct drm_i915_private *dev_priv);
27 void intel_overlay_print_error_state(struct drm_printer *p,
28 				     struct intel_overlay_error_state *error);
29 #else
intel_overlay_setup(struct drm_i915_private * dev_priv)30 static inline void intel_overlay_setup(struct drm_i915_private *dev_priv)
31 {
32 }
intel_overlay_cleanup(struct drm_i915_private * dev_priv)33 static inline void intel_overlay_cleanup(struct drm_i915_private *dev_priv)
34 {
35 }
intel_overlay_switch_off(struct intel_overlay * overlay)36 static inline int intel_overlay_switch_off(struct intel_overlay *overlay)
37 {
38 	return 0;
39 }
intel_overlay_put_image_ioctl(struct drm_device * dev,void * data,struct drm_file * file_priv)40 static inline int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
41 				  struct drm_file *file_priv)
42 {
43 	return 0;
44 }
intel_overlay_attrs_ioctl(struct drm_device * dev,void * data,struct drm_file * file_priv)45 static inline int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
46 					    struct drm_file *file_priv)
47 {
48 	return 0;
49 }
intel_overlay_reset(struct drm_i915_private * dev_priv)50 static inline void intel_overlay_reset(struct drm_i915_private *dev_priv)
51 {
52 }
53 static inline struct intel_overlay_error_state *
intel_overlay_capture_error_state(struct drm_i915_private * dev_priv)54 intel_overlay_capture_error_state(struct drm_i915_private *dev_priv)
55 {
56 	return NULL;
57 }
intel_overlay_print_error_state(struct drm_printer * p,struct intel_overlay_error_state * error)58 static inline void intel_overlay_print_error_state(struct drm_printer *p,
59 						   struct intel_overlay_error_state *error)
60 {
61 }
62 #endif
63 
64 #endif /* __INTEL_OVERLAY_H__ */
65