Subversion Repositories Kolibri OS

Rev

Rev 6082 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6082 Rev 6936
1
/*
1
/*
2
 * Copyright (c) 2006-2009 Red Hat Inc.
2
 * Copyright (c) 2006-2009 Red Hat Inc.
3
 * Copyright (c) 2006-2008 Intel Corporation
3
 * Copyright (c) 2006-2008 Intel Corporation
4
 * Copyright (c) 2007 Dave Airlie 
4
 * Copyright (c) 2007 Dave Airlie 
5
 *
5
 *
6
 * DRM framebuffer helper functions
6
 * DRM framebuffer helper functions
7
 *
7
 *
8
 * Permission to use, copy, modify, distribute, and sell this software and its
8
 * Permission to use, copy, modify, distribute, and sell this software and its
9
 * documentation for any purpose is hereby granted without fee, provided that
9
 * documentation for any purpose is hereby granted without fee, provided that
10
 * the above copyright notice appear in all copies and that both that copyright
10
 * the above copyright notice appear in all copies and that both that copyright
11
 * notice and this permission notice appear in supporting documentation, and
11
 * notice and this permission notice appear in supporting documentation, and
12
 * that the name of the copyright holders not be used in advertising or
12
 * that the name of the copyright holders not be used in advertising or
13
 * publicity pertaining to distribution of the software without specific,
13
 * publicity pertaining to distribution of the software without specific,
14
 * written prior permission.  The copyright holders make no representations
14
 * written prior permission.  The copyright holders make no representations
15
 * about the suitability of this software for any purpose.  It is provided "as
15
 * about the suitability of this software for any purpose.  It is provided "as
16
 * is" without express or implied warranty.
16
 * is" without express or implied warranty.
17
 *
17
 *
18
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
20
 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20
 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
21
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
22
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
23
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
23
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24
 * OF THIS SOFTWARE.
24
 * OF THIS SOFTWARE.
25
 *
25
 *
26
 * Authors:
26
 * Authors:
27
 *      Dave Airlie 
27
 *      Dave Airlie 
28
 *      Jesse Barnes 
28
 *      Jesse Barnes 
29
 */
29
 */
30
#ifndef DRM_FB_HELPER_H
30
#ifndef DRM_FB_HELPER_H
31
#define DRM_FB_HELPER_H
31
#define DRM_FB_HELPER_H
32
 
32
 
33
struct drm_fb_helper;
33
struct drm_fb_helper;
34
 
34
 
35
#include 
35
#include 
-
 
36
 
-
 
37
enum mode_set_atomic {
-
 
38
	LEAVE_ATOMIC_MODE_SET,
-
 
39
	ENTER_ATOMIC_MODE_SET,
-
 
40
};
36
 
41
 
37
struct drm_fb_offset {
42
struct drm_fb_offset {
38
	int x, y;
43
	int x, y;
39
};
44
};
40
 
45
 
41
struct drm_fb_helper_crtc {
46
struct drm_fb_helper_crtc {
42
	struct drm_mode_set mode_set;
47
	struct drm_mode_set mode_set;
43
	struct drm_display_mode *desired_mode;
48
	struct drm_display_mode *desired_mode;
44
	int x, y;
49
	int x, y;
45
};
50
};
46
 
51
 
47
/**
52
/**
48
 * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size
53
 * struct drm_fb_helper_surface_size - describes fbdev size and scanout surface size
49
 * @fb_width: fbdev width
54
 * @fb_width: fbdev width
50
 * @fb_height: fbdev height
55
 * @fb_height: fbdev height
51
 * @surface_width: scanout buffer width
56
 * @surface_width: scanout buffer width
52
 * @surface_height: scanout buffer height
57
 * @surface_height: scanout buffer height
53
 * @surface_bpp: scanout buffer bpp
58
 * @surface_bpp: scanout buffer bpp
54
 * @surface_depth: scanout buffer depth
59
 * @surface_depth: scanout buffer depth
55
 *
60
 *
56
 * Note that the scanout surface width/height may be larger than the fbdev
61
 * Note that the scanout surface width/height may be larger than the fbdev
57
 * width/height.  In case of multiple displays, the scanout surface is sized
62
 * width/height.  In case of multiple displays, the scanout surface is sized
58
 * according to the largest width/height (so it is large enough for all CRTCs
63
 * according to the largest width/height (so it is large enough for all CRTCs
59
 * to scanout).  But the fbdev width/height is sized to the minimum width/
64
 * to scanout).  But the fbdev width/height is sized to the minimum width/
60
 * height of all the displays.  This ensures that fbcon fits on the smallest
65
 * height of all the displays.  This ensures that fbcon fits on the smallest
61
 * of the attached displays.
66
 * of the attached displays.
62
 *
67
 *
63
 * So what is passed to drm_fb_helper_fill_var() should be fb_width/fb_height,
68
 * So what is passed to drm_fb_helper_fill_var() should be fb_width/fb_height,
64
 * rather than the surface size.
69
 * rather than the surface size.
65
 */
70
 */
66
struct drm_fb_helper_surface_size {
71
struct drm_fb_helper_surface_size {
67
	u32 fb_width;
72
	u32 fb_width;
68
	u32 fb_height;
73
	u32 fb_height;
69
	u32 surface_width;
74
	u32 surface_width;
70
	u32 surface_height;
75
	u32 surface_height;
71
	u32 surface_bpp;
76
	u32 surface_bpp;
72
	u32 surface_depth;
77
	u32 surface_depth;
73
};
78
};
74
 
79
 
75
/**
80
/**
76
 * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
81
 * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
77
 * @gamma_set: Set the given gamma lut register on the given crtc.
-
 
78
 * @gamma_get: Read the given gamma lut register on the given crtc, used to
-
 
79
 *             save the current lut when force-restoring the fbdev for e.g.
-
 
80
 *             kdbg.
-
 
81
 * @fb_probe: Driver callback to allocate and initialize the fbdev info
-
 
82
 *            structure. Furthermore it also needs to allocate the drm
-
 
83
 *            framebuffer used to back the fbdev.
-
 
84
 * @initial_config: Setup an initial fbdev display configuration
-
 
85
 *
82
 *
86
 * Driver callbacks used by the fbdev emulation helper library.
83
 * Driver callbacks used by the fbdev emulation helper library.
87
 */
84
 */
88
struct drm_fb_helper_funcs {
85
struct drm_fb_helper_funcs {
-
 
86
	/**
-
 
87
	 * @gamma_set:
-
 
88
	 *
-
 
89
	 * Set the given gamma LUT register on the given CRTC.
-
 
90
	 *
-
 
91
	 * This callback is optional.
-
 
92
	 *
-
 
93
	 * FIXME:
-
 
94
	 *
-
 
95
	 * This callback is functionally redundant with the core gamma table
-
 
96
	 * support and simply exists because the fbdev hasn't yet been
-
 
97
	 * refactored to use the core gamma table interfaces.
-
 
98
	 */
89
	void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
99
	void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
90
			  u16 blue, int regno);
100
			  u16 blue, int regno);
-
 
101
	/**
-
 
102
	 * @gamma_get:
-
 
103
	 *
-
 
104
	 * Read the given gamma LUT register on the given CRTC, used to save the
-
 
105
	 * current LUT when force-restoring the fbdev for e.g. kdbg.
-
 
106
	 *
-
 
107
	 * This callback is optional.
-
 
108
	 *
-
 
109
	 * FIXME:
-
 
110
	 *
-
 
111
	 * This callback is functionally redundant with the core gamma table
-
 
112
	 * support and simply exists because the fbdev hasn't yet been
-
 
113
	 * refactored to use the core gamma table interfaces.
-
 
114
	 */
91
	void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green,
115
	void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green,
92
			  u16 *blue, int regno);
116
			  u16 *blue, int regno);
-
 
117
 
-
 
118
	/**
-
 
119
	 * @fb_probe:
-
 
120
	 *
-
 
121
	 * Driver callback to allocate and initialize the fbdev info structure.
-
 
122
	 * Furthermore it also needs to allocate the DRM framebuffer used to
-
 
123
	 * back the fbdev.
-
 
124
	 *
-
 
125
	 * This callback is mandatory.
-
 
126
	 *
-
 
127
	 * RETURNS:
-
 
128
	 *
-
 
129
	 * The driver should return 0 on success and a negative error code on
-
 
130
	 * failure.
93
 
131
	 */
94
	int (*fb_probe)(struct drm_fb_helper *helper,
132
	int (*fb_probe)(struct drm_fb_helper *helper,
-
 
133
			struct drm_fb_helper_surface_size *sizes);
-
 
134
 
-
 
135
	/**
-
 
136
	 * @initial_config:
-
 
137
	 *
-
 
138
	 * Driver callback to setup an initial fbdev display configuration.
-
 
139
	 * Drivers can use this callback to tell the fbdev emulation what the
-
 
140
	 * preferred initial configuration is. This is useful to implement
-
 
141
	 * smooth booting where the fbdev (and subsequently all userspace) never
-
 
142
	 * changes the mode, but always inherits the existing configuration.
-
 
143
	 *
-
 
144
	 * This callback is optional.
-
 
145
	 *
-
 
146
	 * RETURNS:
-
 
147
	 *
-
 
148
	 * The driver should return true if a suitable initial configuration has
-
 
149
	 * been filled out and false when the fbdev helper should fall back to
-
 
150
	 * the default probing logic.
95
			struct drm_fb_helper_surface_size *sizes);
151
	 */
96
	bool (*initial_config)(struct drm_fb_helper *fb_helper,
152
	bool (*initial_config)(struct drm_fb_helper *fb_helper,
97
			       struct drm_fb_helper_crtc **crtcs,
153
			       struct drm_fb_helper_crtc **crtcs,
98
			       struct drm_display_mode **modes,
154
			       struct drm_display_mode **modes,
99
			       struct drm_fb_offset *offsets,
155
			       struct drm_fb_offset *offsets,
100
			       bool *enabled, int width, int height);
156
			       bool *enabled, int width, int height);
101
};
157
};
102
 
158
 
103
struct drm_fb_helper_connector {
159
struct drm_fb_helper_connector {
104
	struct drm_connector *connector;
160
	struct drm_connector *connector;
105
};
161
};
106
 
162
 
107
/**
163
/**
108
 * struct drm_fb_helper - helper to emulate fbdev on top of kms
164
 * struct drm_fb_helper - main structure to emulate fbdev on top of KMS
109
 * @fb:  Scanout framebuffer object
165
 * @fb:  Scanout framebuffer object
110
 * @dev:  DRM device
166
 * @dev:  DRM device
111
 * @crtc_count: number of possible CRTCs
167
 * @crtc_count: number of possible CRTCs
112
 * @crtc_info: per-CRTC helper state (mode, x/y offset, etc)
168
 * @crtc_info: per-CRTC helper state (mode, x/y offset, etc)
113
 * @connector_count: number of connected connectors
169
 * @connector_count: number of connected connectors
114
 * @connector_info_alloc_count: size of connector_info
170
 * @connector_info_alloc_count: size of connector_info
-
 
171
 * @connector_info: array of per-connector information
115
 * @funcs: driver callbacks for fb helper
172
 * @funcs: driver callbacks for fb helper
116
 * @fbdev: emulated fbdev device info struct
173
 * @fbdev: emulated fbdev device info struct
117
 * @pseudo_palette: fake palette of 16 colors
174
 * @pseudo_palette: fake palette of 16 colors
-
 
175
 *
118
 * @kernel_fb_list: list_head in kernel_fb_helper_list
176
 * This is the main structure used by the fbdev helpers. Drivers supporting
119
 * @delayed_hotplug: was there a hotplug while kms master active?
177
 * fbdev emulation should embedded this into their overall driver structure.
-
 
178
 * Drivers must also fill out a struct &drm_fb_helper_funcs with a few
-
 
179
 * operations.
120
 */
180
 */
121
struct drm_fb_helper {
181
struct drm_fb_helper {
122
	struct drm_framebuffer *fb;
182
	struct drm_framebuffer *fb;
123
	struct drm_device *dev;
183
	struct drm_device *dev;
124
	int crtc_count;
184
	int crtc_count;
125
	struct drm_fb_helper_crtc *crtc_info;
185
	struct drm_fb_helper_crtc *crtc_info;
126
	int connector_count;
186
	int connector_count;
127
	int connector_info_alloc_count;
187
	int connector_info_alloc_count;
128
	struct drm_fb_helper_connector **connector_info;
188
	struct drm_fb_helper_connector **connector_info;
129
	const struct drm_fb_helper_funcs *funcs;
189
	const struct drm_fb_helper_funcs *funcs;
130
	struct fb_info *fbdev;
190
	struct fb_info *fbdev;
131
	u32 pseudo_palette[17];
191
	u32 pseudo_palette[17];
-
 
192
 
-
 
193
	/**
-
 
194
	 * @kernel_fb_list:
-
 
195
	 *
-
 
196
	 * Entry on the global kernel_fb_helper_list, used for kgdb entry/exit.
-
 
197
	 */
132
	struct list_head kernel_fb_list;
198
	struct list_head kernel_fb_list;
-
 
199
 
-
 
200
	/**
-
 
201
	 * @delayed_hotplug:
133
 
202
	 *
-
 
203
	 * A hotplug was received while fbdev wasn't in control of the DRM
134
	/* we got a hotplug but fbdev wasn't running the console
204
	 * device, i.e. another KMS master was active. The output configuration
-
 
205
	 * needs to be reprobe when fbdev is in control again.
135
	   delay until next set_par */
206
	 */
136
	bool delayed_hotplug;
207
	bool delayed_hotplug;
137
 
208
 
138
	/**
209
	/**
139
	 * @atomic:
210
	 * @atomic:
140
	 *
211
	 *
141
	 * Use atomic updates for restore_fbdev_mode(), etc.  This defaults to
212
	 * Use atomic updates for restore_fbdev_mode(), etc.  This defaults to
142
	 * true if driver has DRIVER_ATOMIC feature flag, but drivers can
213
	 * true if driver has DRIVER_ATOMIC feature flag, but drivers can
143
	 * override it to true after drm_fb_helper_init() if they support atomic
214
	 * override it to true after drm_fb_helper_init() if they support atomic
144
	 * modeset but do not yet advertise DRIVER_ATOMIC (note that fb-helper
215
	 * modeset but do not yet advertise DRIVER_ATOMIC (note that fb-helper
145
	 * does not require ASYNC commits).
216
	 * does not require ASYNC commits).
146
	 */
217
	 */
147
	bool atomic;
218
	bool atomic;
148
};
219
};
149
 
220
 
150
#ifdef CONFIG_DRM_FBDEV_EMULATION
221
#ifdef CONFIG_DRM_FBDEV_EMULATION
151
void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
222
void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
152
			   const struct drm_fb_helper_funcs *funcs);
223
			   const struct drm_fb_helper_funcs *funcs);
153
int drm_fb_helper_init(struct drm_device *dev,
224
int drm_fb_helper_init(struct drm_device *dev,
154
		       struct drm_fb_helper *helper, int crtc_count,
225
		       struct drm_fb_helper *helper, int crtc_count,
155
		       int max_conn);
226
		       int max_conn);
156
void drm_fb_helper_fini(struct drm_fb_helper *helper);
227
void drm_fb_helper_fini(struct drm_fb_helper *helper);
157
int drm_fb_helper_blank(int blank, struct fb_info *info);
228
int drm_fb_helper_blank(int blank, struct fb_info *info);
158
int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
229
int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
159
			      struct fb_info *info);
230
			      struct fb_info *info);
160
int drm_fb_helper_set_par(struct fb_info *info);
231
int drm_fb_helper_set_par(struct fb_info *info);
161
int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
232
int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
162
			    struct fb_info *info);
233
			    struct fb_info *info);
163
 
234
 
164
int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
235
int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper);
165
 
236
 
166
struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper);
237
struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper);
167
void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper);
238
void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper);
168
void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper);
239
void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper);
169
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
240
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
170
			    uint32_t fb_width, uint32_t fb_height);
241
			    uint32_t fb_width, uint32_t fb_height);
171
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
242
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
172
			    uint32_t depth);
243
			    uint32_t depth);
173
 
244
 
174
void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
245
void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper);
175
 
246
 
176
ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
247
ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
177
			       size_t count, loff_t *ppos);
248
			       size_t count, loff_t *ppos);
178
ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
249
ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
179
				size_t count, loff_t *ppos);
250
				size_t count, loff_t *ppos);
180
 
251
 
181
void drm_fb_helper_sys_fillrect(struct fb_info *info,
252
void drm_fb_helper_sys_fillrect(struct fb_info *info,
182
				const struct fb_fillrect *rect);
253
				const struct fb_fillrect *rect);
183
void drm_fb_helper_sys_copyarea(struct fb_info *info,
254
void drm_fb_helper_sys_copyarea(struct fb_info *info,
184
				const struct fb_copyarea *area);
255
				const struct fb_copyarea *area);
185
void drm_fb_helper_sys_imageblit(struct fb_info *info,
256
void drm_fb_helper_sys_imageblit(struct fb_info *info,
186
				 const struct fb_image *image);
257
				 const struct fb_image *image);
187
 
258
 
188
void drm_fb_helper_cfb_fillrect(struct fb_info *info,
259
void drm_fb_helper_cfb_fillrect(struct fb_info *info,
189
				const struct fb_fillrect *rect);
260
				const struct fb_fillrect *rect);
190
void drm_fb_helper_cfb_copyarea(struct fb_info *info,
261
void drm_fb_helper_cfb_copyarea(struct fb_info *info,
191
				const struct fb_copyarea *area);
262
				const struct fb_copyarea *area);
192
void drm_fb_helper_cfb_imageblit(struct fb_info *info,
263
void drm_fb_helper_cfb_imageblit(struct fb_info *info,
193
				 const struct fb_image *image);
264
				 const struct fb_image *image);
194
 
265
 
195
void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state);
266
void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, int state);
196
 
267
 
197
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
268
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
198
 
269
 
199
int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
270
int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
200
int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
271
int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
201
int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
272
int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
202
int drm_fb_helper_debug_enter(struct fb_info *info);
273
int drm_fb_helper_debug_enter(struct fb_info *info);
203
int drm_fb_helper_debug_leave(struct fb_info *info);
274
int drm_fb_helper_debug_leave(struct fb_info *info);
204
struct drm_display_mode *
275
struct drm_display_mode *
205
drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
276
drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
206
			int width, int height);
277
			int width, int height);
207
struct drm_display_mode *
278
struct drm_display_mode *
208
drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
279
drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
209
		      int width, int height);
280
		      int width, int height);
210
 
281
 
211
int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
282
int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
212
int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
283
int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
213
				       struct drm_connector *connector);
284
				       struct drm_connector *connector);
214
#else
285
#else
215
static inline void drm_fb_helper_prepare(struct drm_device *dev,
286
static inline void drm_fb_helper_prepare(struct drm_device *dev,
216
					struct drm_fb_helper *helper,
287
					struct drm_fb_helper *helper,
217
					const struct drm_fb_helper_funcs *funcs)
288
					const struct drm_fb_helper_funcs *funcs)
218
{
289
{
219
}
290
}
220
 
291
 
221
static inline int drm_fb_helper_init(struct drm_device *dev,
292
static inline int drm_fb_helper_init(struct drm_device *dev,
222
		       struct drm_fb_helper *helper, int crtc_count,
293
		       struct drm_fb_helper *helper, int crtc_count,
223
		       int max_conn)
294
		       int max_conn)
224
{
295
{
225
	return 0;
296
	return 0;
226
}
297
}
227
 
298
 
228
static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
299
static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
229
{
300
{
230
}
301
}
231
 
302
 
232
static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
303
static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
233
{
304
{
234
	return 0;
305
	return 0;
235
}
306
}
236
 
307
 
237
static inline int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
308
static inline int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
238
					    struct fb_info *info)
309
					    struct fb_info *info)
239
{
310
{
240
	return 0;
311
	return 0;
241
}
312
}
242
 
313
 
243
static inline int drm_fb_helper_set_par(struct fb_info *info)
314
static inline int drm_fb_helper_set_par(struct fb_info *info)
244
{
315
{
245
	return 0;
316
	return 0;
246
}
317
}
247
 
318
 
248
static inline int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
319
static inline int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
249
					  struct fb_info *info)
320
					  struct fb_info *info)
250
{
321
{
251
	return 0;
322
	return 0;
252
}
323
}
253
 
324
 
254
static inline int
325
static inline int
255
drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
326
drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
256
{
327
{
257
	return 0;
328
	return 0;
258
}
329
}
259
 
330
 
260
static inline struct fb_info *
331
static inline struct fb_info *
261
drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
332
drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
262
{
333
{
263
	return NULL;
334
	return NULL;
264
}
335
}
265
 
336
 
266
static inline void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper)
337
static inline void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper)
267
{
338
{
268
}
339
}
269
static inline void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper)
340
static inline void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper)
270
{
341
{
271
}
342
}
272
 
343
 
273
static inline void drm_fb_helper_fill_var(struct fb_info *info,
344
static inline void drm_fb_helper_fill_var(struct fb_info *info,
274
					  struct drm_fb_helper *fb_helper,
345
					  struct drm_fb_helper *fb_helper,
275
					  uint32_t fb_width, uint32_t fb_height)
346
					  uint32_t fb_width, uint32_t fb_height)
276
{
347
{
277
}
348
}
278
 
349
 
279
static inline void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
350
static inline void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
280
					  uint32_t depth)
351
					  uint32_t depth)
281
{
352
{
282
}
353
}
283
 
354
 
284
static inline int drm_fb_helper_setcmap(struct fb_cmap *cmap,
355
static inline int drm_fb_helper_setcmap(struct fb_cmap *cmap,
285
					struct fb_info *info)
356
					struct fb_info *info)
286
{
357
{
287
	return 0;
358
	return 0;
288
}
359
}
289
 
360
 
290
static inline void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper)
361
static inline void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper)
291
{
362
{
292
}
363
}
293
 
364
 
294
static inline ssize_t drm_fb_helper_sys_read(struct fb_info *info,
365
static inline ssize_t drm_fb_helper_sys_read(struct fb_info *info,
295
					     char __user *buf, size_t count,
366
					     char __user *buf, size_t count,
296
					     loff_t *ppos)
367
					     loff_t *ppos)
297
{
368
{
298
	return -ENODEV;
369
	return -ENODEV;
299
}
370
}
300
 
371
 
301
static inline ssize_t drm_fb_helper_sys_write(struct fb_info *info,
372
static inline ssize_t drm_fb_helper_sys_write(struct fb_info *info,
302
					      const char __user *buf,
373
					      const char __user *buf,
303
					      size_t count, loff_t *ppos)
374
					      size_t count, loff_t *ppos)
304
{
375
{
305
	return -ENODEV;
376
	return -ENODEV;
306
}
377
}
307
 
378
 
308
static inline void drm_fb_helper_sys_fillrect(struct fb_info *info,
379
static inline void drm_fb_helper_sys_fillrect(struct fb_info *info,
309
					      const struct fb_fillrect *rect)
380
					      const struct fb_fillrect *rect)
310
{
381
{
311
}
382
}
312
 
383
 
313
static inline void drm_fb_helper_sys_copyarea(struct fb_info *info,
384
static inline void drm_fb_helper_sys_copyarea(struct fb_info *info,
314
					      const struct fb_copyarea *area)
385
					      const struct fb_copyarea *area)
315
{
386
{
316
}
387
}
317
 
388
 
318
static inline void drm_fb_helper_sys_imageblit(struct fb_info *info,
389
static inline void drm_fb_helper_sys_imageblit(struct fb_info *info,
319
					       const struct fb_image *image)
390
					       const struct fb_image *image)
320
{
391
{
321
}
392
}
322
 
393
 
323
static inline void drm_fb_helper_cfb_fillrect(struct fb_info *info,
394
static inline void drm_fb_helper_cfb_fillrect(struct fb_info *info,
324
					      const struct fb_fillrect *rect)
395
					      const struct fb_fillrect *rect)
325
{
396
{
326
}
397
}
327
 
398
 
328
static inline void drm_fb_helper_cfb_copyarea(struct fb_info *info,
399
static inline void drm_fb_helper_cfb_copyarea(struct fb_info *info,
329
					      const struct fb_copyarea *area)
400
					      const struct fb_copyarea *area)
330
{
401
{
331
}
402
}
332
 
403
 
333
static inline void drm_fb_helper_cfb_imageblit(struct fb_info *info,
404
static inline void drm_fb_helper_cfb_imageblit(struct fb_info *info,
334
					       const struct fb_image *image)
405
					       const struct fb_image *image)
335
{
406
{
336
}
407
}
337
 
408
 
338
static inline void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper,
409
static inline void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper,
339
					     int state)
410
					     int state)
340
{
411
{
341
}
412
}
342
 
413
 
343
static inline int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
414
static inline int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
344
{
415
{
345
	return 0;
416
	return 0;
346
}
417
}
347
 
418
 
348
static inline int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper,
419
static inline int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper,
349
					       int bpp_sel)
420
					       int bpp_sel)
350
{
421
{
351
	return 0;
422
	return 0;
352
}
423
}
353
 
424
 
354
static inline int
425
static inline int
355
drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
426
drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
356
{
427
{
357
	return 0;
428
	return 0;
358
}
429
}
359
 
430
 
360
static inline int drm_fb_helper_debug_enter(struct fb_info *info)
431
static inline int drm_fb_helper_debug_enter(struct fb_info *info)
361
{
432
{
362
	return 0;
433
	return 0;
363
}
434
}
364
 
435
 
365
static inline int drm_fb_helper_debug_leave(struct fb_info *info)
436
static inline int drm_fb_helper_debug_leave(struct fb_info *info)
366
{
437
{
367
	return 0;
438
	return 0;
368
}
439
}
369
 
440
 
370
static inline struct drm_display_mode *
441
static inline struct drm_display_mode *
371
drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
442
drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
372
		       int width, int height)
443
		       int width, int height)
373
{
444
{
374
	return NULL;
445
	return NULL;
375
}
446
}
376
 
447
 
377
static inline struct drm_display_mode *
448
static inline struct drm_display_mode *
378
drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
449
drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
379
		      int width, int height)
450
		      int width, int height)
380
{
451
{
381
	return NULL;
452
	return NULL;
382
}
453
}
383
 
454
 
384
static inline int
455
static inline int
385
drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper,
456
drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper,
386
				struct drm_connector *connector)
457
				struct drm_connector *connector)
387
{
458
{
388
	return 0;
459
	return 0;
389
}
460
}
390
 
461
 
391
static inline int
462
static inline int
392
drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
463
drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
393
				   struct drm_connector *connector)
464
				   struct drm_connector *connector)
394
{
465
{
395
	return 0;
466
	return 0;
396
}
467
}
397
#endif
468
#endif
398
#endif
469
#endif