aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_fb.txt
blob: 0f688a8255df7a3fe64b3bf3c9b3375a8335760f (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
# Copyright 2019 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

include <uapi/asm/ioctl.h>
include <uapi/linux/fcntl.h>
include <uapi/linux/fb.h>
include <uapi/linux/videodev2.h>

resource fd_fb[fd]

openat$fb0(fd const[AT_FDCWD], file ptr[in, string["/dev/fb0"]], flags flags[open_flags], mode const[0]) fd_fb
openat$fb1(fd const[AT_FDCWD], file ptr[in, string["/dev/fb1"]], flags flags[open_flags], mode const[0]) fd_fb

write$fb(fd fd_fb, data ptr[in, array[int8]], len bytesize[data])
read$fb(fd fd_fb, data ptr[out, array[int8]], len bytesize[data])
mmap$fb(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_fb, off intptr[0:0x100000, 0x1000])

ioctl$FBIOGET_VSCREENINFO(fd fd_fb, cmd const[FBIOGET_VSCREENINFO], arg ptr[out, array[int8, FB_VAR_SCREENINFO_SIZE]])
ioctl$FBIOPUT_VSCREENINFO(fd fd_fb, cmd const[FBIOPUT_VSCREENINFO], arg ptr[in, fb_var_screeninfo])
ioctl$FBIOGET_FSCREENINFO(fd fd_fb, cmd const[FBIOGET_FSCREENINFO], arg ptr[out, array[int8, FB_FIX_SCREENINFO_SIZE]])
ioctl$FBIOPUTCMAP(fd fd_fb, cmd const[FBIOPUTCMAP], arg ptr[in, fb_cmap_user[in]])
ioctl$FBIOGETCMAP(fd fd_fb, cmd const[FBIOGETCMAP], arg ptr[in, fb_cmap_user[out]])
ioctl$FBIOPAN_DISPLAY(fd fd_fb, cmd const[FBIOPAN_DISPLAY], arg ptr[in, fb_var_screeninfo])
ioctl$FBIOGET_CON2FBMAP(fd fd_fb, cmd const[FBIOGET_CON2FBMAP], arg ptr[in, fb_con2fbmap])
ioctl$FBIOPUT_CON2FBMAP(fd fd_fb, cmd const[FBIOPUT_CON2FBMAP], arg ptr[in, fb_con2fbmap])
ioctl$FBIOBLANK(fd fd_fb, cmd const[FBIOBLANK], arg intptr[FB_BLANK_UNBLANK:FB_BLANK_POWERDOWN])
ioctl$FBIO_WAITFORVSYNC(fd fd_fb, cmd const[FBIO_WAITFORVSYNC], arg const[0])

fb_var_screeninfo {
	xres		flags[fb_xres, int32]
	yres		flags[fb_yres, int32]
	xres_virtual	flags[fb_xres, int32]
	yres_virtual	flags[fb_yres, int32]
	xoffset		int32
	yoffset		int32
	bits_per_pixel	flags[fb_bpp, int32]
	grayscale	int32[0:2]
	red		fb_bitfield
	green		fb_bitfield
	blue		fb_bitfield
	transp		fb_bitfield
	nonstd		flags[fb_nonstd, int32]
	activate	flags[fb_activate, int32]
	height		int32
	width		int32
	accel_flags	flags[fb_accel_flags, int32]
	pixclock	int32
	left_margin	int32
	right_margin	int32
	upper_margin	int32
	lower_margin	int32
	hsync_len	int32
	vsync_len	int32
	sync		flags[fb_sync, int32]
	vmode		flags[fb_mode, int32]
	rotate		flags[fb_rotate, int32]
	colorspace	flags[v4l2_colorspace, int32]
	reserved	array[const[0, int32], 4]
}

fb_activate = FB_ACTIVATE_NOW, FB_ACTIVATE_NXTOPEN, FB_ACTIVATE_TEST, FB_ACTIVATE_VBL, FB_ACTIVATE_ALL, FB_ACTIVATE_FORCE, FB_ACTIVATE_INV_MODE
fb_mode = FB_VMODE_NONINTERLACED, FB_VMODE_INTERLACED, FB_VMODE_DOUBLE, FB_VMODE_ODD_FLD_FIRST, FB_VMODE_YWRAP, FB_VMODE_SMOOTH_XPAN, FB_VMODE_CONUPDATE
fb_bpp = 0, 1, 2, 4, 8, 15, 16, 24, 32
fb_nonstd = FB_NONSTD_HAM, FB_NONSTD_REV_PIX_IN_B
fb_sync = FB_SYNC_HOR_HIGH_ACT, FB_SYNC_VERT_HIGH_ACT, FB_SYNC_EXT, FB_SYNC_COMP_HIGH_ACT, FB_SYNC_BROADCAST, FB_SYNC_ON_GREEN
fb_rotate = FB_ROTATE_UR, FB_ROTATE_CW, FB_ROTATE_UD, FB_ROTATE_CCW
fb_accel_flags = FB_ACCELF_TEXT
fb_xres = 16, 32, 48, 64, 96, 128, 160, 240, 320, 400, 480, 640, 768, 800, 854, 960, 1024, 1280, 1360, 1366, 1400, 1600, 1680, 1920, 2048, 2560, 3200, 3840, 4096, 8192, 15360
fb_yres = 16, 32, 48, 64, 128, 120, 160, 240, 320, 480, 576, 600, 640, 768, 800, 864, 900, 1024, 1152, 1200, 1536, 1600, 2048, 2400, 4096, 8192

type fb_cmap_user[DIR] {
	start	int32
	len	len[red, int32]
# NEED:	these should be parallel arrays of the same size.
	red	ptr[DIR, array[int16]]
	green	ptr[DIR, array[int16]]
	blue	ptr[DIR, array[int16]]
	transp	ptr[DIR, array[int16]]
}

fb_bitfield {
	offset		int32
	length		int32
	msb_right	bool32
}

fb_con2fbmap {
	console		int32[0:63]
	framebuffer	int32[0:2]
}

define FB_VAR_SCREENINFO_SIZE	sizeof(struct fb_var_screeninfo)
define FB_FIX_SCREENINFO_SIZE	sizeof(struct fb_fix_screeninfo)
_ = __NR_mmap2