xref: /linux/drivers/gpu/drm/i915/display/intel_overlay.h (revision 79d2e1919a2728ef49d938eb20ebd5903c14dfb0)
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 #include <linux/types.h>
10 
11 struct drm_device;
12 struct drm_file;
13 struct drm_i915_private;
14 struct drm_printer;
15 struct intel_display;
16 struct intel_overlay;
17 struct intel_overlay_snapshot;
18 
19 #ifdef I915
20 void intel_overlay_setup(struct drm_i915_private *dev_priv);
21 void intel_overlay_cleanup(struct drm_i915_private *dev_priv);
22 int intel_overlay_switch_off(struct intel_overlay *overlay);
23 int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
24 				  struct drm_file *file_priv);
25 int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
26 			      struct drm_file *file_priv);
27 void intel_overlay_reset(struct drm_i915_private *dev_priv);
28 #else
29 static inline void intel_overlay_setup(struct drm_i915_private *dev_priv)
30 {
31 }
32 static inline void intel_overlay_cleanup(struct drm_i915_private *dev_priv)
33 {
34 }
35 static inline int intel_overlay_switch_off(struct intel_overlay *overlay)
36 {
37 	return 0;
38 }
39 static inline int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
40 				  struct drm_file *file_priv)
41 {
42 	return 0;
43 }
44 static inline int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
45 					    struct drm_file *file_priv)
46 {
47 	return 0;
48 }
49 static inline void intel_overlay_reset(struct drm_i915_private *dev_priv)
50 {
51 }
52 #endif
53 
54 #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR) && defined(I915)
55 struct intel_overlay_snapshot *
56 intel_overlay_snapshot_capture(struct intel_display *display);
57 void intel_overlay_snapshot_print(const struct intel_overlay_snapshot *error,
58 				  struct drm_printer *p);
59 #else
60 static inline struct intel_overlay_snapshot *
61 intel_overlay_snapshot_capture(struct intel_display *display)
62 {
63 	return NULL;
64 }
65 static inline void intel_overlay_snapshot_print(const struct intel_overlay_snapshot *error,
66 						struct drm_printer *p)
67 {
68 }
69 #endif
70 
71 #endif /* __INTEL_OVERLAY_H__ */
72