1 /* SPDX-License-Identifier: MIT */
2 /* Copyright © 2024 Intel Corporation */
3 
4 /*
5  * This header is for transitional struct intel_display conversion helpers only.
6  */
7 
8 #ifndef __INTEL_DISPLAY_CONVERSION__
9 #define __INTEL_DISPLAY_CONVERSION__
10 
11 struct drm_device;
12 struct drm_i915_private;
13 struct intel_display;
14 
15 struct intel_display *__i915_to_display(struct drm_i915_private *i915);
16 struct intel_display *__drm_to_display(struct drm_device *drm);
17 /*
18  * Transitional macro to optionally convert struct drm_i915_private * to struct
19  * intel_display *, also accepting the latter.
20  */
21 #define __to_intel_display(p)						\
22 	_Generic(p,							\
23 		 const struct drm_i915_private *: __i915_to_display((struct drm_i915_private *)(p)), \
24 		 struct drm_i915_private *: __i915_to_display((struct drm_i915_private *)(p)), \
25 		 const struct intel_display *: (p),			\
26 		 struct intel_display *: (p))
27 
28 #endif /* __INTEL_DISPLAY_CONVERSION__ */
29