92 case FBIOGET_FSCREENINFO:
96 case FBIOGET_VSCREENINFO:
100 case FBIOPUT_VSCREENINFO: {
107 if (copyin(
new, argp,
sizeof(*
new)))
110 if (new->xres != var->xres || new->yres != var->yres ||
111 new->xres_virtual > var->xres_virtual ||
112 new->yres_virtual > var->yres_virtual ||
113 (new->bits_per_pixel && new->bits_per_pixel != var->bits_per_pixel) ||
114 new->xoffset || new->yoffset)
117 return copyout(argp, var,
sizeof(
struct fb_var_screeninfo));
119 case FBIOPAN_DISPLAY: {
121 struct fb_var_screeninfo new;
123 if (copyin(&
new, argp,
sizeof(
new)))
126 return new.xoffset ||
new.yoffset ? -EINVAL : 0;
183 .can_write = __vfs_can_always,
184 .can_read = __vfs_can_never,
185 .eof = __vfs_eof_never,
static ssize_t fbdev_write(struct devid *dd, off_t offset, struct iobuf *io)
Writes to a framebuffer, through its driver.
static int fbdev_map(struct devid *dd, struct vm_space *vm_space, struct vm_entry *vm_entry)
Maps a framebuffer into a process's address space, through its driver.
int fbdev_probe()
Sets up the registered framebuffers with their drivers, and registers the framebuffer devices.
static struct fbdev * fbdev_get(struct devid *dd)
Returns the framebuffer of a device number, or NULL if there's none.
static int fbdev_ioctl(struct devid *dd, int request, void *argp)
Handles Linux's framebuffer ioctl()s: the screen information, which can be read but not changed,...
struct fbdev * fbdev_primary(void)
Returns the first framebuffer, once it is set up, for the virtual terminals.
static struct fbdev registered_fbs[MAX_FBDEV]
int fbdev_register(int type, void *data)
Registers a framebuffer, which fbdev_probe() sets up with its driver.
void kdev_chrdev_register(devid_t major, struct dev *dev)
Registers a driver as the character device of a major number.
off_t posix_file_lseek(struct file *file, off_t offset, int whence)
Moves an open file's offset: to offset (SEEK_SET), by offset from where it is (SEEK_CUR),...
#define MODULE_INIT(name, i, f)
int posix_file_open(struct file *file)
Finishes opening a file: with O_TRUNC, a regular file is truncated to 0 bytes.
int posix_file_ioctl(struct file *file, int request, void *argp)
Passes an ioctl() request on to the file's vnode (a device's, or its filesystem's).
ssize_t posix_file_write(struct file *file, struct iobuf *io)
Writes to an open file at its offset, and moves the offset past what was written.
A device driver: its operations, any of which may be NULL.
Which device: its kind (S_IFCHR or S_IFBLK) and numbers.
The boot loader's VBE framebuffer: what VBE said about the card and the mode (dev/fb/vesa/).
A framebuffer: its driver, its screen's information, its operations.
ssize_t(*) write(struct fbdev *fb, off_t offset, struct iobuf *io)
struct fb_var_screeninfo * var_screeninfo
struct fb_fix_screeninfo * fix_screeninfo
int(*) map(struct fbdev *fb, struct vm_space *vm_space, struct vm_entry *vm_entry)
A mapping (map entry): a range of an address space, its permissions, and where its pages come from.
An address space: its mappings, and its page tables.