xref: /openbmc/linux/include/drm/drm_fb_helper.h (revision 39b1320e)
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 
33f231af49SThomas Zimmermann struct drm_clip_rect;
344abe3520SDave Airlie struct drm_fb_helper;
354abe3520SDave Airlie 
3673289afeSVille Syrjälä #include <linux/fb.h>
377e8c9ef5SThomas Zimmermann 
387e8c9ef5SThomas Zimmermann #include <drm/drm_client.h>
391a7aba7fSJesse Barnes 
40b7b5ee59SRob Clark /**
41b7b5ee59SRob Clark  * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size
42b7b5ee59SRob Clark  * @fb_width: fbdev width
43b7b5ee59SRob Clark  * @fb_height: fbdev height
44b7b5ee59SRob Clark  * @surface_width: scanout buffer width
45b7b5ee59SRob Clark  * @surface_height: scanout buffer height
46b7b5ee59SRob Clark  * @surface_bpp: scanout buffer bpp
47b7b5ee59SRob Clark  * @surface_depth: scanout buffer depth
48b7b5ee59SRob Clark  *
49b7b5ee59SRob Clark  * Note that the scanout surface width/height may be larger than the fbdev
50b7b5ee59SRob Clark  * width/height.  In case of multiple displays, the scanout surface is sized
51b7b5ee59SRob Clark  * according to the largest width/height (so it is large enough for all CRTCs
52b7b5ee59SRob Clark  * to scanout).  But the fbdev width/height is sized to the minimum width/
53b7b5ee59SRob Clark  * height of all the displays.  This ensures that fbcon fits on the smallest
54ec8bf194SDaniel Vetter  * of the attached displays. fb_width/fb_height is used by
55ec8bf194SDaniel Vetter  * drm_fb_helper_fill_info() to fill out the &fb_info.var structure.
56b7b5ee59SRob Clark  */
5738651674SDave Airlie struct drm_fb_helper_surface_size {
5838651674SDave Airlie 	u32 fb_width;
5938651674SDave Airlie 	u32 fb_height;
6038651674SDave Airlie 	u32 surface_width;
6138651674SDave Airlie 	u32 surface_height;
6238651674SDave Airlie 	u32 surface_bpp;
6338651674SDave Airlie 	u32 surface_depth;
6438651674SDave Airlie };
6538651674SDave Airlie 
66207fd329SDaniel Vetter /**
67207fd329SDaniel Vetter  * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
68207fd329SDaniel Vetter  *
69207fd329SDaniel Vetter  * Driver callbacks used by the fbdev emulation helper library.
70207fd329SDaniel Vetter  */
714abe3520SDave Airlie struct drm_fb_helper_funcs {
72264d6970SDaniel Vetter 	/**
73264d6970SDaniel Vetter 	 * @fb_probe:
74264d6970SDaniel Vetter 	 *
75264d6970SDaniel Vetter 	 * Driver callback to allocate and initialize the fbdev info structure.
76264d6970SDaniel Vetter 	 * Furthermore it also needs to allocate the DRM framebuffer used to
77264d6970SDaniel Vetter 	 * back the fbdev.
78264d6970SDaniel Vetter 	 *
79264d6970SDaniel Vetter 	 * This callback is mandatory.
80264d6970SDaniel Vetter 	 *
81264d6970SDaniel Vetter 	 * RETURNS:
82264d6970SDaniel Vetter 	 *
83264d6970SDaniel Vetter 	 * The driver should return 0 on success and a negative error code on
84264d6970SDaniel Vetter 	 * failure.
85264d6970SDaniel Vetter 	 */
864abe3520SDave Airlie 	int (*fb_probe)(struct drm_fb_helper *helper,
874abe3520SDave Airlie 			struct drm_fb_helper_surface_size *sizes);
88f231af49SThomas Zimmermann 
89f231af49SThomas Zimmermann 	/**
90f231af49SThomas Zimmermann 	 * @fb_dirty:
91f231af49SThomas Zimmermann 	 *
92f231af49SThomas Zimmermann 	 * Driver callback to update the framebuffer memory. If set, fbdev
93f231af49SThomas Zimmermann 	 * emulation will invoke this callback in regular intervals after
94f231af49SThomas Zimmermann 	 * the framebuffer has been written.
95f231af49SThomas Zimmermann 	 *
96f231af49SThomas Zimmermann 	 * This callback is optional.
97f231af49SThomas Zimmermann 	 *
98f231af49SThomas Zimmermann 	 * Returns:
99f231af49SThomas Zimmermann 	 * 0 on success, or an error code otherwise.
100f231af49SThomas Zimmermann 	 */
101f231af49SThomas Zimmermann 	int (*fb_dirty)(struct drm_fb_helper *helper, struct drm_clip_rect *clip);
1024abe3520SDave Airlie };
1034abe3520SDave Airlie 
1049685cd9dSRob Clark /**
105264d6970SDaniel Vetter  * struct drm_fb_helper - main structure to emulate fbdev on top of KMS
1069685cd9dSRob Clark  * @fb: Scanout framebuffer object
1079685cd9dSRob Clark  * @dev: DRM device
1089685cd9dSRob Clark  * @funcs: driver callbacks for fb helper
1099877d8f6SThomas Zimmermann  * @info: emulated fbdev device info struct
1109685cd9dSRob Clark  * @pseudo_palette: fake palette of 16 colors
1119622349eSThomas Zimmermann  * @damage_clip: clip rectangle used with deferred_io to accumulate damage to
112eaa434deSNoralf Trønnes  *                the screen buffer
1139622349eSThomas Zimmermann  * @damage_lock: spinlock protecting @damage_clip
1147aa3d63eSThomas Zimmermann  * @damage_work: worker used to flush the framebuffer
115cfe63423SNoralf Trønnes  * @resume_work: worker used during resume if the console lock is already taken
116264d6970SDaniel Vetter  *
117264d6970SDaniel Vetter  * This is the main structure used by the fbdev helpers. Drivers supporting
118264d6970SDaniel Vetter  * fbdev emulation should embedded this into their overall driver structure.
119ea0dd85aSDaniel Vetter  * Drivers must also fill out a &struct drm_fb_helper_funcs with a few
120264d6970SDaniel Vetter  * operations.
1219685cd9dSRob Clark  */
122785b93efSDave Airlie struct drm_fb_helper {
123d536540fSNoralf Trønnes 	/**
124d536540fSNoralf Trønnes 	 * @client:
125d536540fSNoralf Trønnes 	 *
126d536540fSNoralf Trønnes 	 * DRM client used by the generic fbdev emulation.
127d536540fSNoralf Trønnes 	 */
128d536540fSNoralf Trønnes 	struct drm_client_dev client;
129d536540fSNoralf Trønnes 
130d536540fSNoralf Trønnes 	/**
131d536540fSNoralf Trønnes 	 * @buffer:
132d536540fSNoralf Trønnes 	 *
133d536540fSNoralf Trønnes 	 * Framebuffer used by the generic fbdev emulation.
134d536540fSNoralf Trønnes 	 */
135d536540fSNoralf Trønnes 	struct drm_client_buffer *buffer;
136d536540fSNoralf Trønnes 
137785b93efSDave Airlie 	struct drm_framebuffer *fb;
138785b93efSDave Airlie 	struct drm_device *dev;
1393a493879SThierry Reding 	const struct drm_fb_helper_funcs *funcs;
1409877d8f6SThomas Zimmermann 	struct fb_info *info;
14138651674SDave Airlie 	u32 pseudo_palette[17];
1429622349eSThomas Zimmermann 	struct drm_clip_rect damage_clip;
1439622349eSThomas Zimmermann 	spinlock_t damage_lock;
1447aa3d63eSThomas Zimmermann 	struct work_struct damage_work;
145cfe63423SNoralf Trønnes 	struct work_struct resume_work;
146264d6970SDaniel Vetter 
147264d6970SDaniel Vetter 	/**
148e9827d8eSThierry Reding 	 * @lock:
149e9827d8eSThierry Reding 	 *
150e9827d8eSThierry Reding 	 * Top-level FBDEV helper lock. This protects all internal data
151e9827d8eSThierry Reding 	 * structures and lists, such as @connector_info and @crtc_info.
152e9827d8eSThierry Reding 	 *
153e9827d8eSThierry Reding 	 * FIXME: fbdev emulation locking is a mess and long term we want to
154e9827d8eSThierry Reding 	 * protect all helper internal state with this lock as well as reduce
155e9827d8eSThierry Reding 	 * core KMS locking as much as possible.
156e9827d8eSThierry Reding 	 */
157e9827d8eSThierry Reding 	struct mutex lock;
158e9827d8eSThierry Reding 
159e9827d8eSThierry Reding 	/**
160264d6970SDaniel Vetter 	 * @kernel_fb_list:
161264d6970SDaniel Vetter 	 *
162264d6970SDaniel Vetter 	 * Entry on the global kernel_fb_helper_list, used for kgdb entry/exit.
163264d6970SDaniel Vetter 	 */
164785b93efSDave Airlie 	struct list_head kernel_fb_list;
1658be48d92SDave Airlie 
166264d6970SDaniel Vetter 	/**
167264d6970SDaniel Vetter 	 * @delayed_hotplug:
168264d6970SDaniel Vetter 	 *
169264d6970SDaniel Vetter 	 * A hotplug was received while fbdev wasn't in control of the DRM
170264d6970SDaniel Vetter 	 * device, i.e. another KMS master was active. The output configuration
171264d6970SDaniel Vetter 	 * needs to be reprobe when fbdev is in control again.
172264d6970SDaniel Vetter 	 */
1734abe3520SDave Airlie 	bool delayed_hotplug;
174ca91a275SDaniel Vetter 
175ca91a275SDaniel Vetter 	/**
176ca91a275SDaniel Vetter 	 * @deferred_setup:
177ca91a275SDaniel Vetter 	 *
178ca91a275SDaniel Vetter 	 * If no outputs are connected (disconnected or unknown) the FB helper
179ca91a275SDaniel Vetter 	 * code will defer setup until at least one of the outputs shows up.
180ca91a275SDaniel Vetter 	 * This field keeps track of the status so that setup can be retried
181ca91a275SDaniel Vetter 	 * at every hotplug event until it succeeds eventually.
182ca91a275SDaniel Vetter 	 *
183ca91a275SDaniel Vetter 	 * Protected by @lock.
184ca91a275SDaniel Vetter 	 */
185ca91a275SDaniel Vetter 	bool deferred_setup;
186ca91a275SDaniel Vetter 
187ca91a275SDaniel Vetter 	/**
188ca91a275SDaniel Vetter 	 * @preferred_bpp:
189ca91a275SDaniel Vetter 	 *
190ca91a275SDaniel Vetter 	 * Temporary storage for the driver's preferred BPP setting passed to
191ca91a275SDaniel Vetter 	 * FB helper initialization. This needs to be tracked so that deferred
192ca91a275SDaniel Vetter 	 * FB helper setup can pass this on.
193ca91a275SDaniel Vetter 	 *
194ca91a275SDaniel Vetter 	 * See also: @deferred_setup
195ca91a275SDaniel Vetter 	 */
196ca91a275SDaniel Vetter 	int preferred_bpp;
197e7c5c29aSThomas Zimmermann 
198d6591da5SJavier Martinez Canillas #ifdef CONFIG_FB_DEFERRED_IO
199d6591da5SJavier Martinez Canillas 	/**
200d6591da5SJavier Martinez Canillas 	 * @fbdefio:
201d6591da5SJavier Martinez Canillas 	 *
202d6591da5SJavier Martinez Canillas 	 * Temporary storage for the driver's FB deferred I/O handler. If the
203d6591da5SJavier Martinez Canillas 	 * driver uses the DRM fbdev emulation layer, this is set by the core
204d6591da5SJavier Martinez Canillas 	 * to a generic deferred I/O handler if a driver is preferring to use
205d6591da5SJavier Martinez Canillas 	 * a shadow buffer.
206d6591da5SJavier Martinez Canillas 	 */
207d6591da5SJavier Martinez Canillas 	struct fb_deferred_io fbdefio;
208d6591da5SJavier Martinez Canillas #endif
209785b93efSDave Airlie };
210785b93efSDave Airlie 
211d536540fSNoralf Trønnes static inline struct drm_fb_helper *
drm_fb_helper_from_client(struct drm_client_dev * client)212d536540fSNoralf Trønnes drm_fb_helper_from_client(struct drm_client_dev *client)
213d536540fSNoralf Trønnes {
214d536540fSNoralf Trønnes 	return container_of(client, struct drm_fb_helper, client);
215d536540fSNoralf Trønnes }
216d536540fSNoralf Trønnes 
21774064893SStefan Christ /**
21821bf75ecSStefan Christ  * define DRM_FB_HELPER_DEFAULT_OPS - helper define for drm drivers
21974064893SStefan Christ  *
22074064893SStefan Christ  * Helper define to register default implementations of drm_fb_helper
22174064893SStefan Christ  * functions. To be used in struct fb_ops of drm drivers.
22274064893SStefan Christ  */
22374064893SStefan Christ #define DRM_FB_HELPER_DEFAULT_OPS \
22474064893SStefan Christ 	.fb_check_var	= drm_fb_helper_check_var, \
22574064893SStefan Christ 	.fb_set_par	= drm_fb_helper_set_par, \
22674064893SStefan Christ 	.fb_setcmap	= drm_fb_helper_setcmap, \
22774064893SStefan Christ 	.fb_blank	= drm_fb_helper_blank, \
2281e008928SStefan Christ 	.fb_pan_display	= drm_fb_helper_pan_display, \
2291e008928SStefan Christ 	.fb_debug_enter = drm_fb_helper_debug_enter, \
2300f3bbe07SMaxime Ripard 	.fb_debug_leave = drm_fb_helper_debug_leave, \
2310f3bbe07SMaxime Ripard 	.fb_ioctl	= drm_fb_helper_ioctl
23274064893SStefan Christ 
233a03fdcb1SArchit Taneja #ifdef CONFIG_DRM_FBDEV_EMULATION
23410a23102SThierry Reding void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
2356c80a93bSThomas Zimmermann 			   unsigned int preferred_bpp,
23610a23102SThierry Reding 			   const struct drm_fb_helper_funcs *funcs);
2374825797cSThomas Zimmermann void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper);
2382dea2d11SPankaj Bharadiya int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper);
2394abe3520SDave Airlie void drm_fb_helper_fini(struct drm_fb_helper *helper);
240785b93efSDave Airlie int drm_fb_helper_blank(int blank, struct fb_info *info);
241785b93efSDave Airlie int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
242785b93efSDave Airlie 			      struct fb_info *info);
243785b93efSDave Airlie int drm_fb_helper_set_par(struct fb_info *info);
244785b93efSDave Airlie int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
245785b93efSDave Airlie 			    struct fb_info *info);
246785b93efSDave Airlie 
247b7bdf0a8SDaniel Vetter int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
248b8017d6cSArchit Taneja 
2497fd50bc3SThomas Zimmermann struct fb_info *drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper);
2506a4fef21SThomas Zimmermann void drm_fb_helper_release_info(struct drm_fb_helper *fb_helper);
251afb0ff78SThomas Zimmermann void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper);
2523df3116aSDaniel Vetter void drm_fb_helper_fill_info(struct fb_info *info,
2533df3116aSDaniel Vetter 			     struct drm_fb_helper *fb_helper,
2543df3116aSDaniel Vetter 			     struct drm_fb_helper_surface_size *sizes);
2553632ef89SDave Airlie 
256*c51b3620SThomas Zimmermann void drm_fb_helper_damage_range(struct fb_info *info, off_t off, size_t len);
257*c51b3620SThomas Zimmermann void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
258*c51b3620SThomas Zimmermann 
259e80eec1bSThomas Zimmermann void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);
260eaa434deSNoralf Trønnes 
26128579f37SDaniel Vetter void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, bool suspend);
262cfe63423SNoralf Trønnes void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper,
26328579f37SDaniel Vetter 					bool suspend);
264fdefa58aSArchit Taneja 
265068143d3SDave Airlie int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
266d50ba256SDave Airlie 
2670f3bbe07SMaxime Ripard int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
2680f3bbe07SMaxime Ripard 			unsigned long arg);
2690f3bbe07SMaxime Ripard 
2707394371dSChris Wilson int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
2716c80a93bSThomas Zimmermann int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper);
2721a7aba7fSJesse Barnes int drm_fb_helper_debug_enter(struct fb_info *info);
2731a7aba7fSJesse Barnes int drm_fb_helper_debug_leave(struct fb_info *info);
274304a4f6aSNoralf Trønnes 
275304a4f6aSNoralf Trønnes void drm_fb_helper_lastclose(struct drm_device *dev);
276304a4f6aSNoralf Trønnes void drm_fb_helper_output_poll_changed(struct drm_device *dev);
277a03fdcb1SArchit Taneja #else
drm_fb_helper_prepare(struct drm_device * dev,struct drm_fb_helper * helper,unsigned int preferred_bpp,const struct drm_fb_helper_funcs * funcs)278a03fdcb1SArchit Taneja static inline void drm_fb_helper_prepare(struct drm_device *dev,
279a03fdcb1SArchit Taneja 					 struct drm_fb_helper *helper,
2806c80a93bSThomas Zimmermann 					 unsigned int preferred_bpp,
281a03fdcb1SArchit Taneja 					 const struct drm_fb_helper_funcs *funcs)
282a03fdcb1SArchit Taneja {
283a03fdcb1SArchit Taneja }
284a03fdcb1SArchit Taneja 
drm_fb_helper_unprepare(struct drm_fb_helper * fb_helper)2854825797cSThomas Zimmermann static inline void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper)
2864825797cSThomas Zimmermann {
2874825797cSThomas Zimmermann }
2884825797cSThomas Zimmermann 
drm_fb_helper_init(struct drm_device * dev,struct drm_fb_helper * helper)289a03fdcb1SArchit Taneja static inline int drm_fb_helper_init(struct drm_device *dev,
2902dea2d11SPankaj Bharadiya 		       struct drm_fb_helper *helper)
291a03fdcb1SArchit Taneja {
292a65eb01fSNoralf Trønnes 	/* So drivers can use it to free the struct */
293a65eb01fSNoralf Trønnes 	helper->dev = dev;
294a65eb01fSNoralf Trønnes 	dev->fb_helper = helper;
295a65eb01fSNoralf Trønnes 
296a03fdcb1SArchit Taneja 	return 0;
297a03fdcb1SArchit Taneja }
298a03fdcb1SArchit Taneja 
drm_fb_helper_fini(struct drm_fb_helper * helper)299a03fdcb1SArchit Taneja static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
300a03fdcb1SArchit Taneja {
301a65eb01fSNoralf Trønnes 	if (helper && helper->dev)
302a65eb01fSNoralf Trønnes 		helper->dev->fb_helper = NULL;
303a03fdcb1SArchit Taneja }
304a03fdcb1SArchit Taneja 
drm_fb_helper_blank(int blank,struct fb_info * info)305a03fdcb1SArchit Taneja static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
306a03fdcb1SArchit Taneja {
307a03fdcb1SArchit Taneja 	return 0;
308a03fdcb1SArchit Taneja }
309a03fdcb1SArchit Taneja 
drm_fb_helper_pan_display(struct fb_var_screeninfo * var,struct fb_info * info)310a03fdcb1SArchit Taneja static inline int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
311a03fdcb1SArchit Taneja 					    struct fb_info *info)
312a03fdcb1SArchit Taneja {
313a03fdcb1SArchit Taneja 	return 0;
314a03fdcb1SArchit Taneja }
315a03fdcb1SArchit Taneja 
drm_fb_helper_set_par(struct fb_info * info)316a03fdcb1SArchit Taneja static inline int drm_fb_helper_set_par(struct fb_info *info)
317a03fdcb1SArchit Taneja {
318a03fdcb1SArchit Taneja 	return 0;
319a03fdcb1SArchit Taneja }
320a03fdcb1SArchit Taneja 
drm_fb_helper_check_var(struct fb_var_screeninfo * var,struct fb_info * info)321a03fdcb1SArchit Taneja static inline int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
322a03fdcb1SArchit Taneja 					  struct fb_info *info)
323a03fdcb1SArchit Taneja {
324a03fdcb1SArchit Taneja 	return 0;
325a03fdcb1SArchit Taneja }
326a03fdcb1SArchit Taneja 
327b7bdf0a8SDaniel Vetter static inline int
drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper * fb_helper)328a03fdcb1SArchit Taneja drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
329a03fdcb1SArchit Taneja {
330b7bdf0a8SDaniel Vetter 	return 0;
331a03fdcb1SArchit Taneja }
332a03fdcb1SArchit Taneja 
333a03fdcb1SArchit Taneja static inline struct fb_info *
drm_fb_helper_alloc_info(struct drm_fb_helper * fb_helper)3347fd50bc3SThomas Zimmermann drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper)
335a03fdcb1SArchit Taneja {
336a03fdcb1SArchit Taneja 	return NULL;
337a03fdcb1SArchit Taneja }
338a03fdcb1SArchit Taneja 
drm_fb_helper_release_info(struct drm_fb_helper * fb_helper)3396a4fef21SThomas Zimmermann static inline void drm_fb_helper_release_info(struct drm_fb_helper *fb_helper)
3406a4fef21SThomas Zimmermann {
3416a4fef21SThomas Zimmermann }
3426a4fef21SThomas Zimmermann 
drm_fb_helper_unregister_info(struct drm_fb_helper * fb_helper)343afb0ff78SThomas Zimmermann static inline void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
344a03fdcb1SArchit Taneja {
345a03fdcb1SArchit Taneja }
346a03fdcb1SArchit Taneja 
347ec8bf194SDaniel Vetter static inline void
drm_fb_helper_fill_info(struct fb_info * info,struct drm_fb_helper * fb_helper,struct drm_fb_helper_surface_size * sizes)348ec8bf194SDaniel Vetter drm_fb_helper_fill_info(struct fb_info *info,
349a03fdcb1SArchit Taneja 			struct drm_fb_helper *fb_helper,
350ec8bf194SDaniel Vetter 			struct drm_fb_helper_surface_size *sizes)
351a03fdcb1SArchit Taneja {
352a03fdcb1SArchit Taneja }
353a03fdcb1SArchit Taneja 
drm_fb_helper_setcmap(struct fb_cmap * cmap,struct fb_info * info)354a03fdcb1SArchit Taneja static inline int drm_fb_helper_setcmap(struct fb_cmap *cmap,
355a03fdcb1SArchit Taneja 					struct fb_info *info)
356a03fdcb1SArchit Taneja {
357a03fdcb1SArchit Taneja 	return 0;
358a03fdcb1SArchit Taneja }
359a03fdcb1SArchit Taneja 
drm_fb_helper_ioctl(struct fb_info * info,unsigned int cmd,unsigned long arg)3600f3bbe07SMaxime Ripard static inline int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
3610f3bbe07SMaxime Ripard 				      unsigned long arg)
3620f3bbe07SMaxime Ripard {
3630f3bbe07SMaxime Ripard 	return 0;
3640f3bbe07SMaxime Ripard }
3650f3bbe07SMaxime Ripard 
drm_fb_helper_deferred_io(struct fb_info * info,struct list_head * pagelist)366eaa434deSNoralf Trønnes static inline void drm_fb_helper_deferred_io(struct fb_info *info,
367eaa434deSNoralf Trønnes 					     struct list_head *pagelist)
368eaa434deSNoralf Trønnes {
369eaa434deSNoralf Trønnes }
370eaa434deSNoralf Trønnes 
drm_fb_helper_set_suspend(struct drm_fb_helper * fb_helper,bool suspend)371a03fdcb1SArchit Taneja static inline void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper,
37228579f37SDaniel Vetter 					     bool suspend)
373a03fdcb1SArchit Taneja {
374a03fdcb1SArchit Taneja }
375a03fdcb1SArchit Taneja 
376cfe63423SNoralf Trønnes static inline void
drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper * fb_helper,bool suspend)37728579f37SDaniel Vetter drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper, bool suspend)
378cfe63423SNoralf Trønnes {
379cfe63423SNoralf Trønnes }
380cfe63423SNoralf Trønnes 
drm_fb_helper_hotplug_event(struct drm_fb_helper * fb_helper)381a03fdcb1SArchit Taneja static inline int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
382a03fdcb1SArchit Taneja {
383a03fdcb1SArchit Taneja 	return 0;
384a03fdcb1SArchit Taneja }
385a03fdcb1SArchit Taneja 
drm_fb_helper_initial_config(struct drm_fb_helper * fb_helper)3866c80a93bSThomas Zimmermann static inline int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper)
387a03fdcb1SArchit Taneja {
388a03fdcb1SArchit Taneja 	return 0;
389a03fdcb1SArchit Taneja }
390a03fdcb1SArchit Taneja 
drm_fb_helper_debug_enter(struct fb_info * info)391a03fdcb1SArchit Taneja static inline int drm_fb_helper_debug_enter(struct fb_info *info)
392a03fdcb1SArchit Taneja {
393a03fdcb1SArchit Taneja 	return 0;
394a03fdcb1SArchit Taneja }
395a03fdcb1SArchit Taneja 
drm_fb_helper_debug_leave(struct fb_info * info)396a03fdcb1SArchit Taneja static inline int drm_fb_helper_debug_leave(struct fb_info *info)
397a03fdcb1SArchit Taneja {
398a03fdcb1SArchit Taneja 	return 0;
399a03fdcb1SArchit Taneja }
400a03fdcb1SArchit Taneja 
drm_fb_helper_lastclose(struct drm_device * dev)401304a4f6aSNoralf Trønnes static inline void drm_fb_helper_lastclose(struct drm_device *dev)
402304a4f6aSNoralf Trønnes {
403304a4f6aSNoralf Trønnes }
404304a4f6aSNoralf Trønnes 
drm_fb_helper_output_poll_changed(struct drm_device * dev)405304a4f6aSNoralf Trønnes static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
406304a4f6aSNoralf Trønnes {
407304a4f6aSNoralf Trønnes }
4080a3bfe29SChris Wilson #endif
4090a3bfe29SChris Wilson 
410785b93efSDave Airlie #endif
411