xref: /openbmc/linux/include/drm/drm_fb_helper.h (revision afb0ff78)
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 
3573289afeSVille Syrjälä #include <linux/fb.h>
367e8c9ef5SThomas Zimmermann 
377e8c9ef5SThomas Zimmermann #include <drm/drm_client.h>
381a7aba7fSJesse Barnes 
39b516a9efSDaniel Vetter enum mode_set_atomic {
40b516a9efSDaniel Vetter 	LEAVE_ATOMIC_MODE_SET,
41b516a9efSDaniel Vetter 	ENTER_ATOMIC_MODE_SET,
42b516a9efSDaniel Vetter };
43b516a9efSDaniel Vetter 
44b7b5ee59SRob Clark /**
45b7b5ee59SRob Clark  * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size
46b7b5ee59SRob Clark  * @fb_width: fbdev width
47b7b5ee59SRob Clark  * @fb_height: fbdev height
48b7b5ee59SRob Clark  * @surface_width: scanout buffer width
49b7b5ee59SRob Clark  * @surface_height: scanout buffer height
50b7b5ee59SRob Clark  * @surface_bpp: scanout buffer bpp
51b7b5ee59SRob Clark  * @surface_depth: scanout buffer depth
52b7b5ee59SRob Clark  *
53b7b5ee59SRob Clark  * Note that the scanout surface width/height may be larger than the fbdev
54b7b5ee59SRob Clark  * width/height.  In case of multiple displays, the scanout surface is sized
55b7b5ee59SRob Clark  * according to the largest width/height (so it is large enough for all CRTCs
56b7b5ee59SRob Clark  * to scanout).  But the fbdev width/height is sized to the minimum width/
57b7b5ee59SRob Clark  * height of all the displays.  This ensures that fbcon fits on the smallest
58ec8bf194SDaniel Vetter  * of the attached displays. fb_width/fb_height is used by
59ec8bf194SDaniel Vetter  * drm_fb_helper_fill_info() to fill out the &fb_info.var structure.
60b7b5ee59SRob Clark  */
6138651674SDave Airlie struct drm_fb_helper_surface_size {
6238651674SDave Airlie 	u32 fb_width;
6338651674SDave Airlie 	u32 fb_height;
6438651674SDave Airlie 	u32 surface_width;
6538651674SDave Airlie 	u32 surface_height;
6638651674SDave Airlie 	u32 surface_bpp;
6738651674SDave Airlie 	u32 surface_depth;
6838651674SDave Airlie };
6938651674SDave Airlie 
70207fd329SDaniel Vetter /**
71207fd329SDaniel Vetter  * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
72207fd329SDaniel Vetter  *
73207fd329SDaniel Vetter  * Driver callbacks used by the fbdev emulation helper library.
74207fd329SDaniel Vetter  */
754abe3520SDave Airlie struct drm_fb_helper_funcs {
76264d6970SDaniel Vetter 	/**
77264d6970SDaniel Vetter 	 * @fb_probe:
78264d6970SDaniel Vetter 	 *
79264d6970SDaniel Vetter 	 * Driver callback to allocate and initialize the fbdev info structure.
80264d6970SDaniel Vetter 	 * Furthermore it also needs to allocate the DRM framebuffer used to
81264d6970SDaniel Vetter 	 * back the fbdev.
82264d6970SDaniel Vetter 	 *
83264d6970SDaniel Vetter 	 * This callback is mandatory.
84264d6970SDaniel Vetter 	 *
85264d6970SDaniel Vetter 	 * RETURNS:
86264d6970SDaniel Vetter 	 *
87264d6970SDaniel Vetter 	 * The driver should return 0 on success and a negative error code on
88264d6970SDaniel Vetter 	 * failure.
89264d6970SDaniel Vetter 	 */
904abe3520SDave Airlie 	int (*fb_probe)(struct drm_fb_helper *helper,
914abe3520SDave Airlie 			struct drm_fb_helper_surface_size *sizes);
924abe3520SDave Airlie };
934abe3520SDave Airlie 
949685cd9dSRob Clark /**
95264d6970SDaniel Vetter  * struct drm_fb_helper - main structure to emulate fbdev on top of KMS
969685cd9dSRob Clark  * @fb: Scanout framebuffer object
979685cd9dSRob Clark  * @dev: DRM device
989685cd9dSRob Clark  * @funcs: driver callbacks for fb helper
999877d8f6SThomas Zimmermann  * @info: emulated fbdev device info struct
1009685cd9dSRob Clark  * @pseudo_palette: fake palette of 16 colors
1019622349eSThomas Zimmermann  * @damage_clip: clip rectangle used with deferred_io to accumulate damage to
102eaa434deSNoralf Trønnes  *                the screen buffer
1039622349eSThomas Zimmermann  * @damage_lock: spinlock protecting @damage_clip
1049622349eSThomas Zimmermann  * @damage_work: worker used to flush the framebuffer
105cfe63423SNoralf Trønnes  * @resume_work: worker used during resume if the console lock is already taken
106264d6970SDaniel Vetter  *
107264d6970SDaniel Vetter  * This is the main structure used by the fbdev helpers. Drivers supporting
108264d6970SDaniel Vetter  * fbdev emulation should embedded this into their overall driver structure.
109ea0dd85aSDaniel Vetter  * Drivers must also fill out a &struct drm_fb_helper_funcs with a few
110264d6970SDaniel Vetter  * operations.
1119685cd9dSRob Clark  */
112785b93efSDave Airlie struct drm_fb_helper {
113d536540fSNoralf Trønnes 	/**
114d536540fSNoralf Trønnes 	 * @client:
115d536540fSNoralf Trønnes 	 *
116d536540fSNoralf Trønnes 	 * DRM client used by the generic fbdev emulation.
117d536540fSNoralf Trønnes 	 */
118d536540fSNoralf Trønnes 	struct drm_client_dev client;
119d536540fSNoralf Trønnes 
120d536540fSNoralf Trønnes 	/**
121d536540fSNoralf Trønnes 	 * @buffer:
122d536540fSNoralf Trønnes 	 *
123d536540fSNoralf Trønnes 	 * Framebuffer used by the generic fbdev emulation.
124d536540fSNoralf Trønnes 	 */
125d536540fSNoralf Trønnes 	struct drm_client_buffer *buffer;
126d536540fSNoralf Trønnes 
127785b93efSDave Airlie 	struct drm_framebuffer *fb;
128785b93efSDave Airlie 	struct drm_device *dev;
1293a493879SThierry Reding 	const struct drm_fb_helper_funcs *funcs;
1309877d8f6SThomas Zimmermann 	struct fb_info *info;
13138651674SDave Airlie 	u32 pseudo_palette[17];
1329622349eSThomas Zimmermann 	struct drm_clip_rect damage_clip;
1339622349eSThomas Zimmermann 	spinlock_t damage_lock;
1349622349eSThomas Zimmermann 	struct work_struct damage_work;
135cfe63423SNoralf Trønnes 	struct work_struct resume_work;
136264d6970SDaniel Vetter 
137264d6970SDaniel Vetter 	/**
138e9827d8eSThierry Reding 	 * @lock:
139e9827d8eSThierry Reding 	 *
140e9827d8eSThierry Reding 	 * Top-level FBDEV helper lock. This protects all internal data
141e9827d8eSThierry Reding 	 * structures and lists, such as @connector_info and @crtc_info.
142e9827d8eSThierry Reding 	 *
143e9827d8eSThierry Reding 	 * FIXME: fbdev emulation locking is a mess and long term we want to
144e9827d8eSThierry Reding 	 * protect all helper internal state with this lock as well as reduce
145e9827d8eSThierry Reding 	 * core KMS locking as much as possible.
146e9827d8eSThierry Reding 	 */
147e9827d8eSThierry Reding 	struct mutex lock;
148e9827d8eSThierry Reding 
149e9827d8eSThierry Reding 	/**
150264d6970SDaniel Vetter 	 * @kernel_fb_list:
151264d6970SDaniel Vetter 	 *
152264d6970SDaniel Vetter 	 * Entry on the global kernel_fb_helper_list, used for kgdb entry/exit.
153264d6970SDaniel Vetter 	 */
154785b93efSDave Airlie 	struct list_head kernel_fb_list;
1558be48d92SDave Airlie 
156264d6970SDaniel Vetter 	/**
157264d6970SDaniel Vetter 	 * @delayed_hotplug:
158264d6970SDaniel Vetter 	 *
159264d6970SDaniel Vetter 	 * A hotplug was received while fbdev wasn't in control of the DRM
160264d6970SDaniel Vetter 	 * device, i.e. another KMS master was active. The output configuration
161264d6970SDaniel Vetter 	 * needs to be reprobe when fbdev is in control again.
162264d6970SDaniel Vetter 	 */
1634abe3520SDave Airlie 	bool delayed_hotplug;
164ca91a275SDaniel Vetter 
165ca91a275SDaniel Vetter 	/**
166ca91a275SDaniel Vetter 	 * @deferred_setup:
167ca91a275SDaniel Vetter 	 *
168ca91a275SDaniel Vetter 	 * If no outputs are connected (disconnected or unknown) the FB helper
169ca91a275SDaniel Vetter 	 * code will defer setup until at least one of the outputs shows up.
170ca91a275SDaniel Vetter 	 * This field keeps track of the status so that setup can be retried
171ca91a275SDaniel Vetter 	 * at every hotplug event until it succeeds eventually.
172ca91a275SDaniel Vetter 	 *
173ca91a275SDaniel Vetter 	 * Protected by @lock.
174ca91a275SDaniel Vetter 	 */
175ca91a275SDaniel Vetter 	bool deferred_setup;
176ca91a275SDaniel Vetter 
177ca91a275SDaniel Vetter 	/**
178ca91a275SDaniel Vetter 	 * @preferred_bpp:
179ca91a275SDaniel Vetter 	 *
180ca91a275SDaniel Vetter 	 * Temporary storage for the driver's preferred BPP setting passed to
181ca91a275SDaniel Vetter 	 * FB helper initialization. This needs to be tracked so that deferred
182ca91a275SDaniel Vetter 	 * FB helper setup can pass this on.
183ca91a275SDaniel Vetter 	 *
184ca91a275SDaniel Vetter 	 * See also: @deferred_setup
185ca91a275SDaniel Vetter 	 */
186ca91a275SDaniel Vetter 	int preferred_bpp;
187785b93efSDave Airlie };
188785b93efSDave Airlie 
189d536540fSNoralf Trønnes static inline struct drm_fb_helper *
190d536540fSNoralf Trønnes drm_fb_helper_from_client(struct drm_client_dev *client)
191d536540fSNoralf Trønnes {
192d536540fSNoralf Trønnes 	return container_of(client, struct drm_fb_helper, client);
193d536540fSNoralf Trønnes }
194d536540fSNoralf Trønnes 
19574064893SStefan Christ /**
19621bf75ecSStefan Christ  * define DRM_FB_HELPER_DEFAULT_OPS - helper define for drm drivers
19774064893SStefan Christ  *
19874064893SStefan Christ  * Helper define to register default implementations of drm_fb_helper
19974064893SStefan Christ  * functions. To be used in struct fb_ops of drm drivers.
20074064893SStefan Christ  */
20174064893SStefan Christ #define DRM_FB_HELPER_DEFAULT_OPS \
20274064893SStefan Christ 	.fb_check_var	= drm_fb_helper_check_var, \
20374064893SStefan Christ 	.fb_set_par	= drm_fb_helper_set_par, \
20474064893SStefan Christ 	.fb_setcmap	= drm_fb_helper_setcmap, \
20574064893SStefan Christ 	.fb_blank	= drm_fb_helper_blank, \
2061e008928SStefan Christ 	.fb_pan_display	= drm_fb_helper_pan_display, \
2071e008928SStefan Christ 	.fb_debug_enter = drm_fb_helper_debug_enter, \
2080f3bbe07SMaxime Ripard 	.fb_debug_leave = drm_fb_helper_debug_leave, \
2090f3bbe07SMaxime Ripard 	.fb_ioctl	= drm_fb_helper_ioctl
21074064893SStefan Christ 
211a03fdcb1SArchit Taneja #ifdef CONFIG_DRM_FBDEV_EMULATION
21210a23102SThierry Reding void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
21310a23102SThierry Reding 			   const struct drm_fb_helper_funcs *funcs);
2142dea2d11SPankaj Bharadiya int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper);
2154abe3520SDave Airlie void drm_fb_helper_fini(struct drm_fb_helper *helper);
216785b93efSDave Airlie int drm_fb_helper_blank(int blank, struct fb_info *info);
217785b93efSDave Airlie int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
218785b93efSDave Airlie 			      struct fb_info *info);
219785b93efSDave Airlie int drm_fb_helper_set_par(struct fb_info *info);
220785b93efSDave Airlie int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
221785b93efSDave Airlie 			    struct fb_info *info);
222785b93efSDave Airlie 
223b7bdf0a8SDaniel Vetter int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
224b8017d6cSArchit Taneja 
2257fd50bc3SThomas Zimmermann struct fb_info *drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper);
226*afb0ff78SThomas Zimmermann void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper);
2273df3116aSDaniel Vetter void drm_fb_helper_fill_info(struct fb_info *info,
2283df3116aSDaniel Vetter 			     struct drm_fb_helper *fb_helper,
2293df3116aSDaniel Vetter 			     struct drm_fb_helper_surface_size *sizes);
2303632ef89SDave Airlie 
231e80eec1bSThomas Zimmermann void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);
232eaa434deSNoralf Trønnes 
233cbb1a82eSArchit Taneja ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
234cbb1a82eSArchit Taneja 			       size_t count, loff_t *ppos);
235cbb1a82eSArchit Taneja ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
236cbb1a82eSArchit Taneja 				size_t count, loff_t *ppos);
237cbb1a82eSArchit Taneja 
238742547b7SArchit Taneja void drm_fb_helper_sys_fillrect(struct fb_info *info,
239742547b7SArchit Taneja 				const struct fb_fillrect *rect);
240742547b7SArchit Taneja void drm_fb_helper_sys_copyarea(struct fb_info *info,
241742547b7SArchit Taneja 				const struct fb_copyarea *area);
242742547b7SArchit Taneja void drm_fb_helper_sys_imageblit(struct fb_info *info,
243742547b7SArchit Taneja 				 const struct fb_image *image);
244742547b7SArchit Taneja 
245742547b7SArchit Taneja void drm_fb_helper_cfb_fillrect(struct fb_info *info,
246742547b7SArchit Taneja 				const struct fb_fillrect *rect);
247742547b7SArchit Taneja void drm_fb_helper_cfb_copyarea(struct fb_info *info,
248742547b7SArchit Taneja 				const struct fb_copyarea *area);
249742547b7SArchit Taneja void drm_fb_helper_cfb_imageblit(struct fb_info *info,
250742547b7SArchit Taneja 				 const struct fb_image *image);
251742547b7SArchit Taneja 
25228579f37SDaniel Vetter void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, bool suspend);
253cfe63423SNoralf Trønnes void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper,
25428579f37SDaniel Vetter 					bool suspend);
255fdefa58aSArchit Taneja 
256068143d3SDave Airlie int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
257d50ba256SDave Airlie 
2580f3bbe07SMaxime Ripard int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
2590f3bbe07SMaxime Ripard 			unsigned long arg);
2600f3bbe07SMaxime Ripard 
2617394371dSChris Wilson int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
26201934c2aSThierry Reding int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
2631a7aba7fSJesse Barnes int drm_fb_helper_debug_enter(struct fb_info *info);
2641a7aba7fSJesse Barnes int drm_fb_helper_debug_leave(struct fb_info *info);
265304a4f6aSNoralf Trønnes 
266304a4f6aSNoralf Trønnes void drm_fb_helper_lastclose(struct drm_device *dev);
267304a4f6aSNoralf Trønnes void drm_fb_helper_output_poll_changed(struct drm_device *dev);
268d536540fSNoralf Trønnes 
2691aed9509SThomas Zimmermann void drm_fbdev_generic_setup(struct drm_device *dev,
2701aed9509SThomas Zimmermann 			     unsigned int preferred_bpp);
271a03fdcb1SArchit Taneja #else
272a03fdcb1SArchit Taneja static inline void drm_fb_helper_prepare(struct drm_device *dev,
273a03fdcb1SArchit Taneja 					struct drm_fb_helper *helper,
274a03fdcb1SArchit Taneja 					const struct drm_fb_helper_funcs *funcs)
275a03fdcb1SArchit Taneja {
276a03fdcb1SArchit Taneja }
277a03fdcb1SArchit Taneja 
278a03fdcb1SArchit Taneja static inline int drm_fb_helper_init(struct drm_device *dev,
2792dea2d11SPankaj Bharadiya 		       struct drm_fb_helper *helper)
280a03fdcb1SArchit Taneja {
281a65eb01fSNoralf Trønnes 	/* So drivers can use it to free the struct */
282a65eb01fSNoralf Trønnes 	helper->dev = dev;
283a65eb01fSNoralf Trønnes 	dev->fb_helper = helper;
284a65eb01fSNoralf Trønnes 
285a03fdcb1SArchit Taneja 	return 0;
286a03fdcb1SArchit Taneja }
287a03fdcb1SArchit Taneja 
288a03fdcb1SArchit Taneja static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
289a03fdcb1SArchit Taneja {
290a65eb01fSNoralf Trønnes 	if (helper && helper->dev)
291a65eb01fSNoralf Trønnes 		helper->dev->fb_helper = NULL;
292a03fdcb1SArchit Taneja }
293a03fdcb1SArchit Taneja 
294a03fdcb1SArchit Taneja static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
295a03fdcb1SArchit Taneja {
296a03fdcb1SArchit Taneja 	return 0;
297a03fdcb1SArchit Taneja }
298a03fdcb1SArchit Taneja 
299a03fdcb1SArchit Taneja static inline int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
300a03fdcb1SArchit Taneja 					    struct fb_info *info)
301a03fdcb1SArchit Taneja {
302a03fdcb1SArchit Taneja 	return 0;
303a03fdcb1SArchit Taneja }
304a03fdcb1SArchit Taneja 
305a03fdcb1SArchit Taneja static inline int drm_fb_helper_set_par(struct fb_info *info)
306a03fdcb1SArchit Taneja {
307a03fdcb1SArchit Taneja 	return 0;
308a03fdcb1SArchit Taneja }
309a03fdcb1SArchit Taneja 
310a03fdcb1SArchit Taneja static inline int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
311a03fdcb1SArchit Taneja 					  struct fb_info *info)
312a03fdcb1SArchit Taneja {
313a03fdcb1SArchit Taneja 	return 0;
314a03fdcb1SArchit Taneja }
315a03fdcb1SArchit Taneja 
316b7bdf0a8SDaniel Vetter static inline int
317a03fdcb1SArchit Taneja drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
318a03fdcb1SArchit Taneja {
319b7bdf0a8SDaniel Vetter 	return 0;
320a03fdcb1SArchit Taneja }
321a03fdcb1SArchit Taneja 
322a03fdcb1SArchit Taneja static inline struct fb_info *
3237fd50bc3SThomas Zimmermann drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper)
324a03fdcb1SArchit Taneja {
325a03fdcb1SArchit Taneja 	return NULL;
326a03fdcb1SArchit Taneja }
327a03fdcb1SArchit Taneja 
328*afb0ff78SThomas Zimmermann static inline void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
329a03fdcb1SArchit Taneja {
330a03fdcb1SArchit Taneja }
331a03fdcb1SArchit Taneja 
332ec8bf194SDaniel Vetter static inline void
333ec8bf194SDaniel Vetter drm_fb_helper_fill_info(struct fb_info *info,
334a03fdcb1SArchit Taneja 			struct drm_fb_helper *fb_helper,
335ec8bf194SDaniel Vetter 			struct drm_fb_helper_surface_size *sizes)
336a03fdcb1SArchit Taneja {
337a03fdcb1SArchit Taneja }
338a03fdcb1SArchit Taneja 
339a03fdcb1SArchit Taneja static inline int drm_fb_helper_setcmap(struct fb_cmap *cmap,
340a03fdcb1SArchit Taneja 					struct fb_info *info)
341a03fdcb1SArchit Taneja {
342a03fdcb1SArchit Taneja 	return 0;
343a03fdcb1SArchit Taneja }
344a03fdcb1SArchit Taneja 
3450f3bbe07SMaxime Ripard static inline int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
3460f3bbe07SMaxime Ripard 				      unsigned long arg)
3470f3bbe07SMaxime Ripard {
3480f3bbe07SMaxime Ripard 	return 0;
3490f3bbe07SMaxime Ripard }
3500f3bbe07SMaxime Ripard 
351eaa434deSNoralf Trønnes static inline void drm_fb_helper_deferred_io(struct fb_info *info,
352eaa434deSNoralf Trønnes 					     struct list_head *pagelist)
353eaa434deSNoralf Trønnes {
354eaa434deSNoralf Trønnes }
355eaa434deSNoralf Trønnes 
35648c9571cSNoralf Trønnes static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper)
35748c9571cSNoralf Trønnes {
35848c9571cSNoralf Trønnes 	return -ENODEV;
35948c9571cSNoralf Trønnes }
36048c9571cSNoralf Trønnes 
361a03fdcb1SArchit Taneja static inline ssize_t drm_fb_helper_sys_read(struct fb_info *info,
362a03fdcb1SArchit Taneja 					     char __user *buf, size_t count,
363a03fdcb1SArchit Taneja 					     loff_t *ppos)
364a03fdcb1SArchit Taneja {
365a03fdcb1SArchit Taneja 	return -ENODEV;
366a03fdcb1SArchit Taneja }
367a03fdcb1SArchit Taneja 
368a03fdcb1SArchit Taneja static inline ssize_t drm_fb_helper_sys_write(struct fb_info *info,
369a03fdcb1SArchit Taneja 					      const char __user *buf,
370a03fdcb1SArchit Taneja 					      size_t count, loff_t *ppos)
371a03fdcb1SArchit Taneja {
372a03fdcb1SArchit Taneja 	return -ENODEV;
373a03fdcb1SArchit Taneja }
374a03fdcb1SArchit Taneja 
375a03fdcb1SArchit Taneja static inline void drm_fb_helper_sys_fillrect(struct fb_info *info,
376a03fdcb1SArchit Taneja 					      const struct fb_fillrect *rect)
377a03fdcb1SArchit Taneja {
378a03fdcb1SArchit Taneja }
379a03fdcb1SArchit Taneja 
380a03fdcb1SArchit Taneja static inline void drm_fb_helper_sys_copyarea(struct fb_info *info,
381a03fdcb1SArchit Taneja 					      const struct fb_copyarea *area)
382a03fdcb1SArchit Taneja {
383a03fdcb1SArchit Taneja }
384a03fdcb1SArchit Taneja 
385a03fdcb1SArchit Taneja static inline void drm_fb_helper_sys_imageblit(struct fb_info *info,
386a03fdcb1SArchit Taneja 					       const struct fb_image *image)
387a03fdcb1SArchit Taneja {
388a03fdcb1SArchit Taneja }
389a03fdcb1SArchit Taneja 
390a03fdcb1SArchit Taneja static inline void drm_fb_helper_cfb_fillrect(struct fb_info *info,
391a03fdcb1SArchit Taneja 					      const struct fb_fillrect *rect)
392a03fdcb1SArchit Taneja {
393a03fdcb1SArchit Taneja }
394a03fdcb1SArchit Taneja 
395a03fdcb1SArchit Taneja static inline void drm_fb_helper_cfb_copyarea(struct fb_info *info,
396a03fdcb1SArchit Taneja 					      const struct fb_copyarea *area)
397a03fdcb1SArchit Taneja {
398a03fdcb1SArchit Taneja }
399a03fdcb1SArchit Taneja 
400a03fdcb1SArchit Taneja static inline void drm_fb_helper_cfb_imageblit(struct fb_info *info,
401a03fdcb1SArchit Taneja 					       const struct fb_image *image)
402a03fdcb1SArchit Taneja {
403a03fdcb1SArchit Taneja }
404a03fdcb1SArchit Taneja 
405a03fdcb1SArchit Taneja static inline void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper,
40628579f37SDaniel Vetter 					     bool suspend)
407a03fdcb1SArchit Taneja {
408a03fdcb1SArchit Taneja }
409a03fdcb1SArchit Taneja 
410cfe63423SNoralf Trønnes static inline void
41128579f37SDaniel Vetter drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper, bool suspend)
412cfe63423SNoralf Trønnes {
413cfe63423SNoralf Trønnes }
414cfe63423SNoralf Trønnes 
415a03fdcb1SArchit Taneja static inline int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
416a03fdcb1SArchit Taneja {
417a03fdcb1SArchit Taneja 	return 0;
418a03fdcb1SArchit Taneja }
419a03fdcb1SArchit Taneja 
420a03fdcb1SArchit Taneja static inline int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper,
421a03fdcb1SArchit Taneja 					       int bpp_sel)
422a03fdcb1SArchit Taneja {
423a03fdcb1SArchit Taneja 	return 0;
424a03fdcb1SArchit Taneja }
425a03fdcb1SArchit Taneja 
426a03fdcb1SArchit Taneja static inline int drm_fb_helper_debug_enter(struct fb_info *info)
427a03fdcb1SArchit Taneja {
428a03fdcb1SArchit Taneja 	return 0;
429a03fdcb1SArchit Taneja }
430a03fdcb1SArchit Taneja 
431a03fdcb1SArchit Taneja static inline int drm_fb_helper_debug_leave(struct fb_info *info)
432a03fdcb1SArchit Taneja {
433a03fdcb1SArchit Taneja 	return 0;
434a03fdcb1SArchit Taneja }
435a03fdcb1SArchit Taneja 
436304a4f6aSNoralf Trønnes static inline void drm_fb_helper_lastclose(struct drm_device *dev)
437304a4f6aSNoralf Trønnes {
438304a4f6aSNoralf Trønnes }
439304a4f6aSNoralf Trønnes 
440304a4f6aSNoralf Trønnes static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
441304a4f6aSNoralf Trønnes {
442304a4f6aSNoralf Trønnes }
443304a4f6aSNoralf Trønnes 
4441aed9509SThomas Zimmermann static inline void
4459060d7f4SNoralf Trønnes drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
4469060d7f4SNoralf Trønnes {
4479060d7f4SNoralf Trønnes }
4489060d7f4SNoralf Trønnes 
4490a3bfe29SChris Wilson #endif
4500a3bfe29SChris Wilson 
451785b93efSDave Airlie #endif
452