XenevaOS
Loading...
Searching...
No Matches
drm_fb_helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006-2009 Red Hat Inc.
3 * Copyright (c) 2006-2008 Intel Corporation
4 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
5 *
6 * DRM framebuffer helper functions
7 *
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
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
12 * that the name of the copyright holders not be used in advertising or
13 * publicity pertaining to distribution of the software without specific,
14 * written prior permission. The copyright holders make no representations
15 * about the suitability of this software for any purpose. It is provided "as
16 * is" without express or implied warranty.
17 *
18 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
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,
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
24 * OF THIS SOFTWARE.
25 *
26 * Authors:
27 * Dave Airlie <airlied@linux.ie>
28 * Jesse Barnes <jesse.barnes@intel.com>
29 */
30#ifndef DRM_FB_HELPER_H
31#define DRM_FB_HELPER_H
32
33struct drm_clip_rect;
34struct drm_fb_helper;
35
36#include <linux/fb.h>
37
38#include <drm/drm_client.h>
39
65
84 int (*fb_dirty)(struct drm_fb_helper *helper, struct drm_clip_rect *clip);
85
97 void (*fb_restore)(struct drm_fb_helper *helper);
98
111 void (*fb_set_suspend)(struct drm_fb_helper *helper, bool suspend);
112};
113
139
146
150 struct fb_info *info;
156
167 struct mutex lock;
168
177
189
200
201#ifdef CONFIG_FB_DEFERRED_IO
210 struct fb_deferred_io fbdefio;
211#endif
212};
213
214static inline struct drm_fb_helper *
215drm_fb_helper_from_client(struct drm_client_dev *client)
216{
217 return container_of(client, struct drm_fb_helper, client);
218}
219
226#define DRM_FB_HELPER_DEFAULT_OPS \
227 .fb_check_var = drm_fb_helper_check_var, \
228 .fb_set_par = drm_fb_helper_set_par, \
229 .fb_setcmap = drm_fb_helper_setcmap, \
230 .fb_blank = drm_fb_helper_blank, \
231 .fb_pan_display = drm_fb_helper_pan_display, \
232 .fb_ioctl = drm_fb_helper_ioctl
233
234#ifdef CONFIG_DRM_FBDEV_EMULATION
235void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
236 unsigned int preferred_bpp,
237 const struct drm_fb_helper_funcs *funcs);
238void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper);
239int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper);
240void drm_fb_helper_fini(struct drm_fb_helper *helper);
241int drm_fb_helper_blank(int blank, struct fb_info *info);
242int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
243 struct fb_info *info);
244int drm_fb_helper_set_par(struct fb_info *info);
245int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
246 struct fb_info *info);
247
248int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper,
249 bool force);
250
251void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper);
252void drm_fb_helper_fill_info(struct fb_info *info,
253 struct drm_fb_helper *fb_helper,
254 struct drm_fb_helper_surface_size *sizes);
255
256void drm_fb_helper_damage_range(struct fb_info *info, off_t off, size_t len);
257void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
258
259#ifdef CONFIG_FB_DEFERRED_IO
260void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);
261#endif
262
263void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, bool suspend);
264void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper,
265 bool suspend);
266
267int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
268
269int drm_fb_helper_ioctl(struct fb_info *info, unsigned int cmd,
270 unsigned long arg);
271
272int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
273int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper);
274bool drm_fb_helper_gem_is_fb(const struct drm_fb_helper *fb_helper,
275 const struct drm_gem_object *obj);
276#else
277static inline bool drm_fb_helper_gem_is_fb(const struct drm_fb_helper *fb_helper,
278 const struct drm_gem_object *obj)
279{
280 return false;
281}
282#endif
283
284#endif
unsigned off_t
Definition types.h:37
#define container_of(ptr, type, member)
Definition container_of.h:19
size_t size_t const struct drm_bridge_funcs * funcs
Definition drm_bridge.h:1300
const struct device * dev
Definition drm_print.h:519
i32 clip(i32 x, i32 y, i32 z)
size_t len
Definition initial.c:23
int spinlock_t
Definition kernel.h:44
uint32_t u32
Definition kernel.h:16
Definition drm_client.h:172
Definition drm_client.h:101
Definition drm.h:78
Definition drm_device.h:75
Definition drm_fb_helper.h:71
int(* fb_dirty)(struct drm_fb_helper *helper, struct drm_clip_rect *clip)
Definition drm_fb_helper.h:84
void(* fb_set_suspend)(struct drm_fb_helper *helper, bool suspend)
Definition drm_fb_helper.h:111
void(* fb_restore)(struct drm_fb_helper *helper)
Definition drm_fb_helper.h:97
Definition drm_fb_helper.h:57
u32 fb_height
Definition drm_fb_helper.h:59
u32 surface_bpp
Definition drm_fb_helper.h:62
u32 fb_width
Definition drm_fb_helper.h:58
u32 surface_depth
Definition drm_fb_helper.h:63
u32 surface_height
Definition drm_fb_helper.h:61
u32 surface_width
Definition drm_fb_helper.h:60
Definition drm_fb_helper.h:132
struct drm_device * dev
Definition drm_fb_helper.h:148
struct drm_clip_rect damage_clip
Definition drm_fb_helper.h:152
struct work_struct resume_work
Definition drm_fb_helper.h:155
struct drm_client_buffer * buffer
Definition drm_fb_helper.h:145
bool delayed_hotplug
Definition drm_fb_helper.h:176
struct drm_framebuffer * fb
Definition drm_fb_helper.h:147
struct fb_info * info
Definition drm_fb_helper.h:150
struct work_struct damage_work
Definition drm_fb_helper.h:154
spinlock_t damage_lock
Definition drm_fb_helper.h:153
const struct drm_fb_helper_funcs * funcs
Definition drm_fb_helper.h:149
u32 pseudo_palette[17]
Definition drm_fb_helper.h:151
struct mutex lock
Definition drm_fb_helper.h:167
struct drm_client_dev client
Definition drm_fb_helper.h:138
bool deferred_setup
Definition drm_fb_helper.h:188
int preferred_bpp
Definition drm_fb_helper.h:199
Definition drm_framebuffer.h:120
Definition drm_gem.h:277
Definition list.h:11
Definition mutex.h:59
Definition workqueue.h:44