1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_FBDEV_H__
7 #define __INTEL_FBDEV_H__
8 
9 #include <linux/types.h>
10 
11 struct drm_fb_helper;
12 struct drm_fb_helper_surface_size;
13 struct drm_i915_private;
14 struct intel_fbdev;
15 struct intel_framebuffer;
16 
17 #ifdef CONFIG_DRM_FBDEV_EMULATION
18 int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
19 				   struct drm_fb_helper_surface_size *sizes);
20 #define INTEL_FBDEV_DRIVER_OPS \
21 	.fbdev_probe = intel_fbdev_driver_fbdev_probe
22 void intel_fbdev_setup(struct drm_i915_private *dev_priv);
23 struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev *fbdev);
24 struct i915_vma *intel_fbdev_vma_pointer(struct intel_fbdev *fbdev);
25 
26 #else
27 #define INTEL_FBDEV_DRIVER_OPS \
28 	.fbdev_probe = NULL
intel_fbdev_setup(struct drm_i915_private * dev_priv)29 static inline void intel_fbdev_setup(struct drm_i915_private *dev_priv)
30 {
31 }
intel_fbdev_framebuffer(struct intel_fbdev * fbdev)32 static inline struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev *fbdev)
33 {
34 	return NULL;
35 }
36 
intel_fbdev_vma_pointer(struct intel_fbdev * fbdev)37 static inline struct i915_vma *intel_fbdev_vma_pointer(struct intel_fbdev *fbdev)
38 {
39 	return NULL;
40 }
41 
42 #endif
43 
44 #endif /* __INTEL_FBDEV_H__ */
45