summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/include/linux/fb.h
blob: 4205f1de13d7ce624dc0722d5692e6eb394638e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* Public domain. */

#ifndef _LINUX_FB_H
#define _LINUX_FB_H

#include <sys/types.h>
#include <linux/slab.h>
#include <linux/notifier.h>
#include <linux/backlight.h>
#include <linux/kgdb.h>
#include <linux/fs.h>

struct fb_cmap;
struct fb_fillrect;
struct fb_copyarea;
struct fb_image;
struct fb_info;

struct apertures_struct;

struct fb_var_screeninfo {
	int pixclock;
	uint32_t width;
	uint32_t height;
};

struct fb_ops {
	int (*fb_set_par)(struct fb_info *);
};

struct fb_info {
	struct fb_var_screeninfo var;
	const struct fb_ops *fbops;
	char *screen_buffer;
	void *par;
	int fbcon_rotate_hint;
	bool skip_vt_switch;
	int flags;
};

#define KHZ2PICOS(a)	(1000000000UL/(a))

#define FB_BLANK_UNBLANK	0
#define FB_BLANK_NORMAL		1
#define FB_BLANK_HSYNC_SUSPEND	2
#define FB_BLANK_VSYNC_SUSPEND	3
#define FB_BLANK_POWERDOWN	4

#define FBINFO_STATE_RUNNING	0
#define FBINFO_STATE_SUSPENDED	1

#define FBINFO_HIDE_SMEM_START	0

#define FB_ROTATE_UR		0
#define FB_ROTATE_CW		1
#define FB_ROTATE_UD		2
#define FB_ROTATE_CCW		3

static inline struct fb_info *
framebuffer_alloc(size_t size, void *dev)
{
	return kzalloc(sizeof(struct fb_info) + size, GFP_KERNEL);
}

static inline void
fb_set_suspend(struct fb_info *fbi, int s)
{
}

static inline void
framebuffer_release(struct fb_info *fbi)
{
	kfree(fbi);
}

static inline int
fb_get_options(const char *name, char **opt)
{
	return 0;
}

static inline int
register_framebuffer(struct fb_info *fbi)
{
	if (fbi->fbops && fbi->fbops->fb_set_par)
		fbi->fbops->fb_set_par(fbi);
	return 0;
}

static inline void
unregister_framebuffer(struct fb_info *fbi)
{
}

#endif