jcs's openbsd hax
openbsd
1/* Public domain. */
2
3#ifndef _LINUX_FB_H
4#define _LINUX_FB_H
5
6#include <sys/types.h>
7#include <linux/slab.h>
8#include <linux/notifier.h>
9#include <linux/backlight.h>
10#include <linux/kgdb.h>
11#include <linux/fs.h>
12#include <linux/i2c.h> /* via uapi/linux/fb.h */
13
14struct fb_cmap;
15struct fb_fillrect;
16struct fb_copyarea;
17struct fb_image;
18struct fb_info;
19
20struct apertures_struct;
21
22struct fb_var_screeninfo {
23 int pixclock;
24 uint32_t xres;
25 uint32_t yres;
26 uint32_t width;
27 uint32_t height;
28};
29
30struct fb_ops {
31 int (*fb_set_par)(struct fb_info *);
32};
33
34struct fb_fix_screeninfo {
35 paddr_t smem_start;
36 psize_t smem_len;
37};
38
39struct fb_info {
40 struct fb_var_screeninfo var;
41 struct fb_fix_screeninfo fix;
42 const struct fb_ops *fbops;
43 char *screen_buffer;
44 char *screen_base;
45 bus_size_t screen_size;
46 void *par;
47 int fbcon_rotate_hint;
48 bool skip_vt_switch;
49 bool skip_panic;
50 int flags;
51};
52
53#define KHZ2PICOS(a) (1000000000UL/(a))
54
55#define FB_BLANK_UNBLANK 0
56#define FB_BLANK_NORMAL 1
57#define FB_BLANK_HSYNC_SUSPEND 2
58#define FB_BLANK_VSYNC_SUSPEND 3
59#define FB_BLANK_POWERDOWN 4
60
61#define FBINFO_STATE_RUNNING 0
62#define FBINFO_STATE_SUSPENDED 1
63
64#define FBINFO_VIRTFB 0x0001
65#define FBINFO_READS_FAST 0x0002
66#define FBINFO_HIDE_SMEM_START 0x0004
67
68#define FB_ROTATE_UR 0
69#define FB_ROTATE_CW 1
70#define FB_ROTATE_UD 2
71#define FB_ROTATE_CCW 3
72
73#define FB_GEN_DEFAULT_DEFERRED_IOMEM_OPS(a, b, c)
74#define FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS(a, b, c)
75#define FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(a, b, c)
76
77static inline struct fb_info *
78framebuffer_alloc(size_t size, void *dev)
79{
80 return kzalloc(sizeof(struct fb_info) + size, GFP_KERNEL);
81}
82
83static inline void
84fb_set_suspend(struct fb_info *fbi, int s)
85{
86}
87
88static inline void
89framebuffer_release(struct fb_info *fbi)
90{
91 kfree(fbi);
92}
93
94static inline int
95fb_get_options(const char *name, char **opt)
96{
97 return 0;
98}
99
100static inline int
101register_framebuffer(struct fb_info *fbi)
102{
103 if (fbi->fbops && fbi->fbops->fb_set_par)
104 fbi->fbops->fb_set_par(fbi);
105 return 0;
106}
107
108static inline void
109unregister_framebuffer(struct fb_info *fbi)
110{
111}
112
113static inline void
114fb_deferred_io_cleanup(struct fb_info *fbi)
115{
116}
117
118#endif