| 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_printer; |
| 14 | struct intel_display; |
| 15 | struct intel_overlay; |
| 16 | struct intel_overlay_snapshot; |
| 17 | |
| 18 | #ifdef I915 |
| 19 | void intel_overlay_setup(struct intel_display *display); |
| 20 | bool intel_overlay_available(struct intel_display *display); |
| 21 | void intel_overlay_cleanup(struct intel_display *display); |
| 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 intel_display *display); |
| 28 | #else |
| 29 | static inline void intel_overlay_setup(struct intel_display *display) |
| 30 | { |
| 31 | } |
| 32 | static inline bool intel_overlay_available(struct intel_display *display) |
| 33 | { |
| 34 | return false; |
| 35 | } |
| 36 | static inline void intel_overlay_cleanup(struct intel_display *display) |
| 37 | { |
| 38 | } |
| 39 | static inline int intel_overlay_switch_off(struct intel_overlay *overlay) |
| 40 | { |
| 41 | return 0; |
| 42 | } |
| 43 | static inline int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data, |
| 44 | struct drm_file *file_priv) |
| 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | static inline int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, |
| 49 | struct drm_file *file_priv) |
| 50 | { |
| 51 | return 0; |
| 52 | } |
| 53 | static inline void intel_overlay_reset(struct intel_display *display) |
| 54 | { |
| 55 | } |
| 56 | #endif |
| 57 | |
| 58 | #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR) && defined(I915) |
| 59 | struct intel_overlay_snapshot * |
| 60 | intel_overlay_snapshot_capture(struct intel_display *display); |
| 61 | void intel_overlay_snapshot_print(const struct intel_overlay_snapshot *error, |
| 62 | struct drm_printer *p); |
| 63 | #else |
| 64 | static inline struct intel_overlay_snapshot * |
| 65 | intel_overlay_snapshot_capture(struct intel_display *display) |
| 66 | { |
| 67 | return NULL; |
| 68 | } |
| 69 | static inline void intel_overlay_snapshot_print(const struct intel_overlay_snapshot *error, |
| 70 | struct drm_printer *p) |
| 71 | { |
| 72 | } |
| 73 | #endif |
| 74 | |
| 75 | #endif /* __INTEL_OVERLAY_H__ */ |
| 76 | |