xref: /openbmc/linux/include/drm/drm_fb_helper.h (revision b516a9ef)
1785b93efSDave Airlie /*
2785b93efSDave Airlie  * Copyright (c) 2006-2009 Red Hat Inc.
3785b93efSDave Airlie  * Copyright (c) 2006-2008 Intel Corporation
4785b93efSDave Airlie  * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
5785b93efSDave Airlie  *
6785b93efSDave Airlie  * DRM framebuffer helper functions
7785b93efSDave Airlie  *
8785b93efSDave Airlie  * Permission to use, copy, modify, distribute, and sell this software and its
9785b93efSDave Airlie  * documentation for any purpose is hereby granted without fee, provided that
10785b93efSDave Airlie  * the above copyright notice appear in all copies and that both that copyright
11785b93efSDave Airlie  * notice and this permission notice appear in supporting documentation, and
12785b93efSDave Airlie  * that the name of the copyright holders not be used in advertising or
13785b93efSDave Airlie  * publicity pertaining to distribution of the software without specific,
14785b93efSDave Airlie  * written prior permission.  The copyright holders make no representations
15785b93efSDave Airlie  * about the suitability of this software for any purpose.  It is provided "as
16785b93efSDave Airlie  * is" without express or implied warranty.
17785b93efSDave Airlie  *
18785b93efSDave Airlie  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19785b93efSDave Airlie  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
20785b93efSDave Airlie  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
21785b93efSDave Airlie  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
22785b93efSDave Airlie  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
23785b93efSDave Airlie  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24785b93efSDave Airlie  * OF THIS SOFTWARE.
25785b93efSDave Airlie  *
26785b93efSDave Airlie  * Authors:
27785b93efSDave Airlie  *      Dave Airlie <airlied@linux.ie>
28785b93efSDave Airlie  *      Jesse Barnes <jesse.barnes@intel.com>
29785b93efSDave Airlie  */
30785b93efSDave Airlie #ifndef DRM_FB_HELPER_H
31785b93efSDave Airlie #define DRM_FB_HELPER_H
32785b93efSDave Airlie 
334abe3520SDave Airlie struct drm_fb_helper;
344abe3520SDave Airlie 
351a7aba7fSJesse Barnes #include <linux/kgdb.h>
361a7aba7fSJesse Barnes 
37b516a9efSDaniel Vetter enum mode_set_atomic {
38b516a9efSDaniel Vetter 	LEAVE_ATOMIC_MODE_SET,
39b516a9efSDaniel Vetter 	ENTER_ATOMIC_MODE_SET,
40b516a9efSDaniel Vetter };
41b516a9efSDaniel Vetter 
42b0ee9e7fSDave Airlie struct drm_fb_offset {
43b0ee9e7fSDave Airlie 	int x, y;
44b0ee9e7fSDave Airlie };
45b0ee9e7fSDave Airlie 
46785b93efSDave Airlie struct drm_fb_helper_crtc {
47785b93efSDave Airlie 	struct drm_mode_set mode_set;
488be48d92SDave Airlie 	struct drm_display_mode *desired_mode;
49b0ee9e7fSDave Airlie 	int x, y;
50785b93efSDave Airlie };
51785b93efSDave Airlie 
52b7b5ee59SRob Clark /**
53b7b5ee59SRob Clark  * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size
54b7b5ee59SRob Clark  * @fb_width: fbdev width
55b7b5ee59SRob Clark  * @fb_height: fbdev height
56b7b5ee59SRob Clark  * @surface_width: scanout buffer width
57b7b5ee59SRob Clark  * @surface_height: scanout buffer height
58b7b5ee59SRob Clark  * @surface_bpp: scanout buffer bpp
59b7b5ee59SRob Clark  * @surface_depth: scanout buffer depth
60b7b5ee59SRob Clark  *
61b7b5ee59SRob Clark  * Note that the scanout surface width/height may be larger than the fbdev
62b7b5ee59SRob Clark  * width/height.  In case of multiple displays, the scanout surface is sized
63b7b5ee59SRob Clark  * according to the largest width/height (so it is large enough for all CRTCs
64b7b5ee59SRob Clark  * to scanout).  But the fbdev width/height is sized to the minimum width/
65b7b5ee59SRob Clark  * height of all the displays.  This ensures that fbcon fits on the smallest
66b7b5ee59SRob Clark  * of the attached displays.
67b7b5ee59SRob Clark  *
68b7b5ee59SRob Clark  * So what is passed to drm_fb_helper_fill_var() should be fb_width/fb_height,
69b7b5ee59SRob Clark  * rather than the surface size.
70b7b5ee59SRob Clark  */
7138651674SDave Airlie struct drm_fb_helper_surface_size {
7238651674SDave Airlie 	u32 fb_width;
7338651674SDave Airlie 	u32 fb_height;
7438651674SDave Airlie 	u32 surface_width;
7538651674SDave Airlie 	u32 surface_height;
7638651674SDave Airlie 	u32 surface_bpp;
7738651674SDave Airlie 	u32 surface_depth;
7838651674SDave Airlie };
7938651674SDave Airlie 
80207fd329SDaniel Vetter /**
81207fd329SDaniel Vetter  * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
82207fd329SDaniel Vetter  *
83207fd329SDaniel Vetter  * Driver callbacks used by the fbdev emulation helper library.
84207fd329SDaniel Vetter  */
854abe3520SDave Airlie struct drm_fb_helper_funcs {
86264d6970SDaniel Vetter 	/**
87264d6970SDaniel Vetter 	 * @gamma_set:
88264d6970SDaniel Vetter 	 *
89264d6970SDaniel Vetter 	 * Set the given gamma LUT register on the given CRTC.
90264d6970SDaniel Vetter 	 *
91264d6970SDaniel Vetter 	 * This callback is optional.
92264d6970SDaniel Vetter 	 *
93264d6970SDaniel Vetter 	 * FIXME:
94264d6970SDaniel Vetter 	 *
95264d6970SDaniel Vetter 	 * This callback is functionally redundant with the core gamma table
96264d6970SDaniel Vetter 	 * support and simply exists because the fbdev hasn't yet been
97264d6970SDaniel Vetter 	 * refactored to use the core gamma table interfaces.
98264d6970SDaniel Vetter 	 */
994abe3520SDave Airlie 	void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
1004abe3520SDave Airlie 			  u16 blue, int regno);
101264d6970SDaniel Vetter 	/**
102264d6970SDaniel Vetter 	 * @gamma_get:
103264d6970SDaniel Vetter 	 *
104264d6970SDaniel Vetter 	 * Read the given gamma LUT register on the given CRTC, used to save the
105264d6970SDaniel Vetter 	 * current LUT when force-restoring the fbdev for e.g. kdbg.
106264d6970SDaniel Vetter 	 *
107264d6970SDaniel Vetter 	 * This callback is optional.
108264d6970SDaniel Vetter 	 *
109264d6970SDaniel Vetter 	 * FIXME:
110264d6970SDaniel Vetter 	 *
111264d6970SDaniel Vetter 	 * This callback is functionally redundant with the core gamma table
112264d6970SDaniel Vetter 	 * support and simply exists because the fbdev hasn't yet been
113264d6970SDaniel Vetter 	 * refactored to use the core gamma table interfaces.
114264d6970SDaniel Vetter 	 */
1154abe3520SDave Airlie 	void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green,
1164abe3520SDave Airlie 			  u16 *blue, int regno);
1174abe3520SDave Airlie 
118264d6970SDaniel Vetter 	/**
119264d6970SDaniel Vetter 	 * @fb_probe:
120264d6970SDaniel Vetter 	 *
121264d6970SDaniel Vetter 	 * Driver callback to allocate and initialize the fbdev info structure.
122264d6970SDaniel Vetter 	 * Furthermore it also needs to allocate the DRM framebuffer used to
123264d6970SDaniel Vetter 	 * back the fbdev.
124264d6970SDaniel Vetter 	 *
125264d6970SDaniel Vetter 	 * This callback is mandatory.
126264d6970SDaniel Vetter 	 *
127264d6970SDaniel Vetter 	 * RETURNS:
128264d6970SDaniel Vetter 	 *
129264d6970SDaniel Vetter 	 * The driver should return 0 on success and a negative error code on
130264d6970SDaniel Vetter 	 * failure.
131264d6970SDaniel Vetter 	 */
1324abe3520SDave Airlie 	int (*fb_probe)(struct drm_fb_helper *helper,
1334abe3520SDave Airlie 			struct drm_fb_helper_surface_size *sizes);
134264d6970SDaniel Vetter 
135264d6970SDaniel Vetter 	/**
136264d6970SDaniel Vetter 	 * @initial_config:
137264d6970SDaniel Vetter 	 *
138264d6970SDaniel Vetter 	 * Driver callback to setup an initial fbdev display configuration.
139264d6970SDaniel Vetter 	 * Drivers can use this callback to tell the fbdev emulation what the
140264d6970SDaniel Vetter 	 * preferred initial configuration is. This is useful to implement
141264d6970SDaniel Vetter 	 * smooth booting where the fbdev (and subsequently all userspace) never
142264d6970SDaniel Vetter 	 * changes the mode, but always inherits the existing configuration.
143264d6970SDaniel Vetter 	 *
144264d6970SDaniel Vetter 	 * This callback is optional.
145264d6970SDaniel Vetter 	 *
146264d6970SDaniel Vetter 	 * RETURNS:
147264d6970SDaniel Vetter 	 *
148264d6970SDaniel Vetter 	 * The driver should return true if a suitable initial configuration has
149264d6970SDaniel Vetter 	 * been filled out and false when the fbdev helper should fall back to
150264d6970SDaniel Vetter 	 * the default probing logic.
151264d6970SDaniel Vetter 	 */
15211e17a08SJesse Barnes 	bool (*initial_config)(struct drm_fb_helper *fb_helper,
15311e17a08SJesse Barnes 			       struct drm_fb_helper_crtc **crtcs,
15411e17a08SJesse Barnes 			       struct drm_display_mode **modes,
155b0ee9e7fSDave Airlie 			       struct drm_fb_offset *offsets,
15611e17a08SJesse Barnes 			       bool *enabled, int width, int height);
1574abe3520SDave Airlie };
1584abe3520SDave Airlie 
159d50ba256SDave Airlie struct drm_fb_helper_connector {
1600b4c0f3fSDave Airlie 	struct drm_connector *connector;
161d50ba256SDave Airlie };
162d50ba256SDave Airlie 
1639685cd9dSRob Clark /**
164264d6970SDaniel Vetter  * struct drm_fb_helper - main structure to emulate fbdev on top of KMS
1659685cd9dSRob Clark  * @fb: Scanout framebuffer object
1669685cd9dSRob Clark  * @dev: DRM device
1679685cd9dSRob Clark  * @crtc_count: number of possible CRTCs
1689685cd9dSRob Clark  * @crtc_info: per-CRTC helper state (mode, x/y offset, etc)
1699685cd9dSRob Clark  * @connector_count: number of connected connectors
1709685cd9dSRob Clark  * @connector_info_alloc_count: size of connector_info
171264d6970SDaniel Vetter  * @connector_info: array of per-connector information
1729685cd9dSRob Clark  * @funcs: driver callbacks for fb helper
1739685cd9dSRob Clark  * @fbdev: emulated fbdev device info struct
1749685cd9dSRob Clark  * @pseudo_palette: fake palette of 16 colors
175264d6970SDaniel Vetter  *
176264d6970SDaniel Vetter  * This is the main structure used by the fbdev helpers. Drivers supporting
177264d6970SDaniel Vetter  * fbdev emulation should embedded this into their overall driver structure.
178264d6970SDaniel Vetter  * Drivers must also fill out a struct &drm_fb_helper_funcs with a few
179264d6970SDaniel Vetter  * operations.
1809685cd9dSRob Clark  */
181785b93efSDave Airlie struct drm_fb_helper {
182785b93efSDave Airlie 	struct drm_framebuffer *fb;
183785b93efSDave Airlie 	struct drm_device *dev;
184785b93efSDave Airlie 	int crtc_count;
185785b93efSDave Airlie 	struct drm_fb_helper_crtc *crtc_info;
1860b4c0f3fSDave Airlie 	int connector_count;
18765c2a89cSDave Airlie 	int connector_info_alloc_count;
1880b4c0f3fSDave Airlie 	struct drm_fb_helper_connector **connector_info;
1893a493879SThierry Reding 	const struct drm_fb_helper_funcs *funcs;
19038651674SDave Airlie 	struct fb_info *fbdev;
19138651674SDave Airlie 	u32 pseudo_palette[17];
192264d6970SDaniel Vetter 
193264d6970SDaniel Vetter 	/**
194264d6970SDaniel Vetter 	 * @kernel_fb_list:
195264d6970SDaniel Vetter 	 *
196264d6970SDaniel Vetter 	 * Entry on the global kernel_fb_helper_list, used for kgdb entry/exit.
197264d6970SDaniel Vetter 	 */
198785b93efSDave Airlie 	struct list_head kernel_fb_list;
1998be48d92SDave Airlie 
200264d6970SDaniel Vetter 	/**
201264d6970SDaniel Vetter 	 * @delayed_hotplug:
202264d6970SDaniel Vetter 	 *
203264d6970SDaniel Vetter 	 * A hotplug was received while fbdev wasn't in control of the DRM
204264d6970SDaniel Vetter 	 * device, i.e. another KMS master was active. The output configuration
205264d6970SDaniel Vetter 	 * needs to be reprobe when fbdev is in control again.
206264d6970SDaniel Vetter 	 */
2074abe3520SDave Airlie 	bool delayed_hotplug;
208bbb1e524SRob Clark 
209bbb1e524SRob Clark 	/**
210bbb1e524SRob Clark 	 * @atomic:
211bbb1e524SRob Clark 	 *
212bbb1e524SRob Clark 	 * Use atomic updates for restore_fbdev_mode(), etc.  This defaults to
213bbb1e524SRob Clark 	 * true if driver has DRIVER_ATOMIC feature flag, but drivers can
214bbb1e524SRob Clark 	 * override it to true after drm_fb_helper_init() if they support atomic
215bbb1e524SRob Clark 	 * modeset but do not yet advertise DRIVER_ATOMIC (note that fb-helper
216bbb1e524SRob Clark 	 * does not require ASYNC commits).
217bbb1e524SRob Clark 	 */
218bbb1e524SRob Clark 	bool atomic;
219785b93efSDave Airlie };
220785b93efSDave Airlie 
221a03fdcb1SArchit Taneja #ifdef CONFIG_DRM_FBDEV_EMULATION
22210a23102SThierry Reding void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
22310a23102SThierry Reding 			   const struct drm_fb_helper_funcs *funcs);
2244abe3520SDave Airlie int drm_fb_helper_init(struct drm_device *dev,
2258be48d92SDave Airlie 		       struct drm_fb_helper *helper, int crtc_count,
226eb1f8e4fSDave Airlie 		       int max_conn);
2274abe3520SDave Airlie void drm_fb_helper_fini(struct drm_fb_helper *helper);
228785b93efSDave Airlie int drm_fb_helper_blank(int blank, struct fb_info *info);
229785b93efSDave Airlie int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
230785b93efSDave Airlie 			      struct fb_info *info);
231785b93efSDave Airlie int drm_fb_helper_set_par(struct fb_info *info);
232785b93efSDave Airlie int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
233785b93efSDave Airlie 			    struct fb_info *info);
234785b93efSDave Airlie 
235b7bdf0a8SDaniel Vetter int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
236b8017d6cSArchit Taneja 
237b8017d6cSArchit Taneja struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper);
238b8017d6cSArchit Taneja void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper);
239b8017d6cSArchit Taneja void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper);
24038651674SDave Airlie void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
241785b93efSDave Airlie 			    uint32_t fb_width, uint32_t fb_height);
2423632ef89SDave Airlie void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
2433632ef89SDave Airlie 			    uint32_t depth);
2443632ef89SDave Airlie 
24547074ab7SArchit Taneja void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
24647074ab7SArchit Taneja 
247cbb1a82eSArchit Taneja ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
248cbb1a82eSArchit Taneja 			       size_t count, loff_t *ppos);
249cbb1a82eSArchit Taneja ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
250cbb1a82eSArchit Taneja 				size_t count, loff_t *ppos);
251cbb1a82eSArchit Taneja 
252742547b7SArchit Taneja void drm_fb_helper_sys_fillrect(struct fb_info *info,
253742547b7SArchit Taneja 				const struct fb_fillrect *rect);
254742547b7SArchit Taneja void drm_fb_helper_sys_copyarea(struct fb_info *info,
255742547b7SArchit Taneja 				const struct fb_copyarea *area);
256742547b7SArchit Taneja void drm_fb_helper_sys_imageblit(struct fb_info *info,
257742547b7SArchit Taneja 				 const struct fb_image *image);
258742547b7SArchit Taneja 
259742547b7SArchit Taneja void drm_fb_helper_cfb_fillrect(struct fb_info *info,
260742547b7SArchit Taneja 				const struct fb_fillrect *rect);
261742547b7SArchit Taneja void drm_fb_helper_cfb_copyarea(struct fb_info *info,
262742547b7SArchit Taneja 				const struct fb_copyarea *area);
263742547b7SArchit Taneja void drm_fb_helper_cfb_imageblit(struct fb_info *info,
264742547b7SArchit Taneja 				 const struct fb_image *image);
265742547b7SArchit Taneja 
266fdefa58aSArchit Taneja void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state);
267fdefa58aSArchit Taneja 
268068143d3SDave Airlie int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
269d50ba256SDave Airlie 
2707394371dSChris Wilson int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
27101934c2aSThierry Reding int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
2720b4c0f3fSDave Airlie int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
2731a7aba7fSJesse Barnes int drm_fb_helper_debug_enter(struct fb_info *info);
2741a7aba7fSJesse Barnes int drm_fb_helper_debug_leave(struct fb_info *info);
2752f1046f3SJesse Barnes struct drm_display_mode *
2762f1046f3SJesse Barnes drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
2772f1046f3SJesse Barnes 			int width, int height);
2782f1046f3SJesse Barnes struct drm_display_mode *
2792f1046f3SJesse Barnes drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
2802f1046f3SJesse Barnes 		      int width, int height);
2818be48d92SDave Airlie 
28265c2a89cSDave Airlie int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
28365c2a89cSDave Airlie int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
28465c2a89cSDave Airlie 				       struct drm_connector *connector);
285a03fdcb1SArchit Taneja #else
286a03fdcb1SArchit Taneja static inline void drm_fb_helper_prepare(struct drm_device *dev,
287a03fdcb1SArchit Taneja 					struct drm_fb_helper *helper,
288a03fdcb1SArchit Taneja 					const struct drm_fb_helper_funcs *funcs)
289a03fdcb1SArchit Taneja {
290a03fdcb1SArchit Taneja }
291a03fdcb1SArchit Taneja 
292a03fdcb1SArchit Taneja static inline int drm_fb_helper_init(struct drm_device *dev,
293a03fdcb1SArchit Taneja 		       struct drm_fb_helper *helper, int crtc_count,
294a03fdcb1SArchit Taneja 		       int max_conn)
295a03fdcb1SArchit Taneja {
296a03fdcb1SArchit Taneja 	return 0;
297a03fdcb1SArchit Taneja }
298a03fdcb1SArchit Taneja 
299a03fdcb1SArchit Taneja static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
300a03fdcb1SArchit Taneja {
301a03fdcb1SArchit Taneja }
302a03fdcb1SArchit Taneja 
303a03fdcb1SArchit Taneja static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
304a03fdcb1SArchit Taneja {
305a03fdcb1SArchit Taneja 	return 0;
306a03fdcb1SArchit Taneja }
307a03fdcb1SArchit Taneja 
308a03fdcb1SArchit Taneja static inline int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
309a03fdcb1SArchit Taneja 					    struct fb_info *info)
310a03fdcb1SArchit Taneja {
311a03fdcb1SArchit Taneja 	return 0;
312a03fdcb1SArchit Taneja }
313a03fdcb1SArchit Taneja 
314a03fdcb1SArchit Taneja static inline int drm_fb_helper_set_par(struct fb_info *info)
315a03fdcb1SArchit Taneja {
316a03fdcb1SArchit Taneja 	return 0;
317a03fdcb1SArchit Taneja }
318a03fdcb1SArchit Taneja 
319a03fdcb1SArchit Taneja static inline int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
320a03fdcb1SArchit Taneja 					  struct fb_info *info)
321a03fdcb1SArchit Taneja {
322a03fdcb1SArchit Taneja 	return 0;
323a03fdcb1SArchit Taneja }
324a03fdcb1SArchit Taneja 
325b7bdf0a8SDaniel Vetter static inline int
326a03fdcb1SArchit Taneja drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
327a03fdcb1SArchit Taneja {
328b7bdf0a8SDaniel Vetter 	return 0;
329a03fdcb1SArchit Taneja }
330a03fdcb1SArchit Taneja 
331a03fdcb1SArchit Taneja static inline struct fb_info *
332a03fdcb1SArchit Taneja drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
333a03fdcb1SArchit Taneja {
334a03fdcb1SArchit Taneja 	return NULL;
335a03fdcb1SArchit Taneja }
336a03fdcb1SArchit Taneja 
337a03fdcb1SArchit Taneja static inline void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper)
338a03fdcb1SArchit Taneja {
339a03fdcb1SArchit Taneja }
340a03fdcb1SArchit Taneja static inline void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper)
341a03fdcb1SArchit Taneja {
342a03fdcb1SArchit Taneja }
343a03fdcb1SArchit Taneja 
344a03fdcb1SArchit Taneja static inline void drm_fb_helper_fill_var(struct fb_info *info,
345a03fdcb1SArchit Taneja 					  struct drm_fb_helper *fb_helper,
346a03fdcb1SArchit Taneja 					  uint32_t fb_width, uint32_t fb_height)
347a03fdcb1SArchit Taneja {
348a03fdcb1SArchit Taneja }
349a03fdcb1SArchit Taneja 
350a03fdcb1SArchit Taneja static inline void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
351a03fdcb1SArchit Taneja 					  uint32_t depth)
352a03fdcb1SArchit Taneja {
353a03fdcb1SArchit Taneja }
354a03fdcb1SArchit Taneja 
355a03fdcb1SArchit Taneja static inline int drm_fb_helper_setcmap(struct fb_cmap *cmap,
356a03fdcb1SArchit Taneja 					struct fb_info *info)
357a03fdcb1SArchit Taneja {
358a03fdcb1SArchit Taneja 	return 0;
359a03fdcb1SArchit Taneja }
360a03fdcb1SArchit Taneja 
361a03fdcb1SArchit Taneja static inline void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper)
362a03fdcb1SArchit Taneja {
363a03fdcb1SArchit Taneja }
364a03fdcb1SArchit Taneja 
365a03fdcb1SArchit Taneja static inline ssize_t drm_fb_helper_sys_read(struct fb_info *info,
366a03fdcb1SArchit Taneja 					     char __user *buf, size_t count,
367a03fdcb1SArchit Taneja 					     loff_t *ppos)
368a03fdcb1SArchit Taneja {
369a03fdcb1SArchit Taneja 	return -ENODEV;
370a03fdcb1SArchit Taneja }
371a03fdcb1SArchit Taneja 
372a03fdcb1SArchit Taneja static inline ssize_t drm_fb_helper_sys_write(struct fb_info *info,
373a03fdcb1SArchit Taneja 					      const char __user *buf,
374a03fdcb1SArchit Taneja 					      size_t count, loff_t *ppos)
375a03fdcb1SArchit Taneja {
376a03fdcb1SArchit Taneja 	return -ENODEV;
377a03fdcb1SArchit Taneja }
378a03fdcb1SArchit Taneja 
379a03fdcb1SArchit Taneja static inline void drm_fb_helper_sys_fillrect(struct fb_info *info,
380a03fdcb1SArchit Taneja 					      const struct fb_fillrect *rect)
381a03fdcb1SArchit Taneja {
382a03fdcb1SArchit Taneja }
383a03fdcb1SArchit Taneja 
384a03fdcb1SArchit Taneja static inline void drm_fb_helper_sys_copyarea(struct fb_info *info,
385a03fdcb1SArchit Taneja 					      const struct fb_copyarea *area)
386a03fdcb1SArchit Taneja {
387a03fdcb1SArchit Taneja }
388a03fdcb1SArchit Taneja 
389a03fdcb1SArchit Taneja static inline void drm_fb_helper_sys_imageblit(struct fb_info *info,
390a03fdcb1SArchit Taneja 					       const struct fb_image *image)
391a03fdcb1SArchit Taneja {
392a03fdcb1SArchit Taneja }
393a03fdcb1SArchit Taneja 
394a03fdcb1SArchit Taneja static inline void drm_fb_helper_cfb_fillrect(struct fb_info *info,
395a03fdcb1SArchit Taneja 					      const struct fb_fillrect *rect)
396a03fdcb1SArchit Taneja {
397a03fdcb1SArchit Taneja }
398a03fdcb1SArchit Taneja 
399a03fdcb1SArchit Taneja static inline void drm_fb_helper_cfb_copyarea(struct fb_info *info,
400a03fdcb1SArchit Taneja 					      const struct fb_copyarea *area)
401a03fdcb1SArchit Taneja {
402a03fdcb1SArchit Taneja }
403a03fdcb1SArchit Taneja 
404a03fdcb1SArchit Taneja static inline void drm_fb_helper_cfb_imageblit(struct fb_info *info,
405a03fdcb1SArchit Taneja 					       const struct fb_image *image)
406a03fdcb1SArchit Taneja {
407a03fdcb1SArchit Taneja }
408a03fdcb1SArchit Taneja 
409a03fdcb1SArchit Taneja static inline void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper,
410a03fdcb1SArchit Taneja 					     int state)
411a03fdcb1SArchit Taneja {
412a03fdcb1SArchit Taneja }
413a03fdcb1SArchit Taneja 
414a03fdcb1SArchit Taneja static inline int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
415a03fdcb1SArchit Taneja {
416a03fdcb1SArchit Taneja 	return 0;
417a03fdcb1SArchit Taneja }
418a03fdcb1SArchit Taneja 
419a03fdcb1SArchit Taneja static inline int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper,
420a03fdcb1SArchit Taneja 					       int bpp_sel)
421a03fdcb1SArchit Taneja {
422a03fdcb1SArchit Taneja 	return 0;
423a03fdcb1SArchit Taneja }
424a03fdcb1SArchit Taneja 
425a03fdcb1SArchit Taneja static inline int
426a03fdcb1SArchit Taneja drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
427a03fdcb1SArchit Taneja {
428a03fdcb1SArchit Taneja 	return 0;
429a03fdcb1SArchit Taneja }
430a03fdcb1SArchit Taneja 
431a03fdcb1SArchit Taneja static inline int drm_fb_helper_debug_enter(struct fb_info *info)
432a03fdcb1SArchit Taneja {
433a03fdcb1SArchit Taneja 	return 0;
434a03fdcb1SArchit Taneja }
435a03fdcb1SArchit Taneja 
436a03fdcb1SArchit Taneja static inline int drm_fb_helper_debug_leave(struct fb_info *info)
437a03fdcb1SArchit Taneja {
438a03fdcb1SArchit Taneja 	return 0;
439a03fdcb1SArchit Taneja }
440a03fdcb1SArchit Taneja 
441a03fdcb1SArchit Taneja static inline struct drm_display_mode *
442a03fdcb1SArchit Taneja drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
443a03fdcb1SArchit Taneja 		       int width, int height)
444a03fdcb1SArchit Taneja {
445a03fdcb1SArchit Taneja 	return NULL;
446a03fdcb1SArchit Taneja }
447a03fdcb1SArchit Taneja 
448a03fdcb1SArchit Taneja static inline struct drm_display_mode *
449a03fdcb1SArchit Taneja drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
450a03fdcb1SArchit Taneja 		      int width, int height)
451a03fdcb1SArchit Taneja {
452a03fdcb1SArchit Taneja 	return NULL;
453a03fdcb1SArchit Taneja }
454a03fdcb1SArchit Taneja 
455a03fdcb1SArchit Taneja static inline int
456a03fdcb1SArchit Taneja drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper,
457a03fdcb1SArchit Taneja 				struct drm_connector *connector)
458a03fdcb1SArchit Taneja {
459a03fdcb1SArchit Taneja 	return 0;
460a03fdcb1SArchit Taneja }
461a03fdcb1SArchit Taneja 
462a03fdcb1SArchit Taneja static inline int
463a03fdcb1SArchit Taneja drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
464a03fdcb1SArchit Taneja 				   struct drm_connector *connector)
465a03fdcb1SArchit Taneja {
466a03fdcb1SArchit Taneja 	return 0;
467a03fdcb1SArchit Taneja }
468a03fdcb1SArchit Taneja #endif
469785b93efSDave Airlie #endif
470