github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/dev_fb.txt (about)

     1  # Copyright 2019 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/asm/ioctl.h>
     5  include <uapi/linux/fcntl.h>
     6  include <uapi/linux/fb.h>
     7  include <uapi/linux/videodev2.h>
     8  
     9  resource fd_fb[fd]
    10  
    11  openat$fb0(fd const[AT_FDCWD], file ptr[in, string["/dev/fb0"]], flags flags[open_flags], mode const[0]) fd_fb
    12  openat$fb1(fd const[AT_FDCWD], file ptr[in, string["/dev/fb1"]], flags flags[open_flags], mode const[0]) fd_fb
    13  
    14  write$fb(fd fd_fb, data ptr[in, array[int8]], len bytesize[data])
    15  read$fb(fd fd_fb, data ptr[out, array[int8]], len bytesize[data])
    16  mmap$fb(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_fb, off intptr[0:0x100000, 0x1000])
    17  
    18  ioctl$FBIOGET_VSCREENINFO(fd fd_fb, cmd const[FBIOGET_VSCREENINFO], arg ptr[out, array[int8, FB_VAR_SCREENINFO_SIZE]])
    19  ioctl$FBIOPUT_VSCREENINFO(fd fd_fb, cmd const[FBIOPUT_VSCREENINFO], arg ptr[in, fb_var_screeninfo])
    20  ioctl$FBIOGET_FSCREENINFO(fd fd_fb, cmd const[FBIOGET_FSCREENINFO], arg ptr[out, array[int8, FB_FIX_SCREENINFO_SIZE]])
    21  ioctl$FBIOPUTCMAP(fd fd_fb, cmd const[FBIOPUTCMAP], arg ptr[in, fb_cmap_user[in]])
    22  ioctl$FBIOGETCMAP(fd fd_fb, cmd const[FBIOGETCMAP], arg ptr[in, fb_cmap_user[out]])
    23  ioctl$FBIOPAN_DISPLAY(fd fd_fb, cmd const[FBIOPAN_DISPLAY], arg ptr[in, fb_var_screeninfo])
    24  ioctl$FBIOGET_CON2FBMAP(fd fd_fb, cmd const[FBIOGET_CON2FBMAP], arg ptr[in, fb_con2fbmap])
    25  ioctl$FBIOPUT_CON2FBMAP(fd fd_fb, cmd const[FBIOPUT_CON2FBMAP], arg ptr[in, fb_con2fbmap])
    26  ioctl$FBIOBLANK(fd fd_fb, cmd const[FBIOBLANK], arg intptr[FB_BLANK_UNBLANK:FB_BLANK_POWERDOWN])
    27  ioctl$FBIO_WAITFORVSYNC(fd fd_fb, cmd const[FBIO_WAITFORVSYNC], arg const[0])
    28  
    29  fb_var_screeninfo {
    30  	xres		flags[fb_xres, int32]
    31  	yres		flags[fb_yres, int32]
    32  	xres_virtual	flags[fb_xres, int32]
    33  	yres_virtual	flags[fb_yres, int32]
    34  	xoffset		int32
    35  	yoffset		int32
    36  	bits_per_pixel	flags[fb_bpp, int32]
    37  	grayscale	int32[0:2]
    38  	red		fb_bitfield
    39  	green		fb_bitfield
    40  	blue		fb_bitfield
    41  	transp		fb_bitfield
    42  	nonstd		flags[fb_nonstd, int32]
    43  	activate	flags[fb_activate, int32]
    44  	height		int32
    45  	width		int32
    46  	accel_flags	flags[fb_accel_flags, int32]
    47  	pixclock	int32
    48  	left_margin	int32
    49  	right_margin	int32
    50  	upper_margin	int32
    51  	lower_margin	int32
    52  	hsync_len	int32
    53  	vsync_len	int32
    54  	sync		flags[fb_sync, int32]
    55  	vmode		flags[fb_mode, int32]
    56  	rotate		flags[fb_rotate, int32]
    57  	colorspace	flags[v4l2_colorspace, int32]
    58  	reserved	array[const[0, int32], 4]
    59  }
    60  
    61  fb_activate = FB_ACTIVATE_NOW, FB_ACTIVATE_NXTOPEN, FB_ACTIVATE_TEST, FB_ACTIVATE_VBL, FB_ACTIVATE_ALL, FB_ACTIVATE_FORCE, FB_ACTIVATE_INV_MODE
    62  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
    63  fb_bpp = 0, 1, 2, 4, 8, 15, 16, 24, 32
    64  fb_nonstd = FB_NONSTD_HAM, FB_NONSTD_REV_PIX_IN_B
    65  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
    66  fb_rotate = FB_ROTATE_UR, FB_ROTATE_CW, FB_ROTATE_UD, FB_ROTATE_CCW
    67  fb_accel_flags = FB_ACCELF_TEXT
    68  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
    69  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
    70  
    71  type fb_cmap_user[DIR] {
    72  	start	int32
    73  	len	len[red, int32]
    74  # NEED:	these should be parallel arrays of the same size.
    75  	red	ptr[DIR, array[int16]]
    76  	green	ptr[DIR, array[int16]]
    77  	blue	ptr[DIR, array[int16]]
    78  	transp	ptr[DIR, array[int16]]
    79  }
    80  
    81  fb_bitfield {
    82  	offset		int32
    83  	length		int32
    84  	msb_right	bool32
    85  }
    86  
    87  fb_con2fbmap {
    88  	console		int32[0:63]
    89  	framebuffer	int32[0:2]
    90  }
    91  
    92  define FB_VAR_SCREENINFO_SIZE	sizeof(struct fb_var_screeninfo)
    93  define FB_FIX_SCREENINFO_SIZE	sizeof(struct fb_fix_screeninfo)
    94  _ = __NR_mmap2