14be47400SFrançois Tigeot /* 24be47400SFrançois Tigeot * Copyright (c) 2016 Imre Vadász <imre@vdsz.com> 34be47400SFrançois Tigeot * All rights reserved. 44be47400SFrançois Tigeot * 54be47400SFrançois Tigeot * Redistribution and use in source and binary forms, with or without 64be47400SFrançois Tigeot * modification, are permitted provided that the following conditions 74be47400SFrançois Tigeot * are met: 84be47400SFrançois Tigeot * 1. Redistributions of source code must retain the above copyright 94be47400SFrançois Tigeot * notice unmodified, this list of conditions, and the following 104be47400SFrançois Tigeot * disclaimer. 114be47400SFrançois Tigeot * 2. Redistributions in binary form must reproduce the above copyright 124be47400SFrançois Tigeot * notice, this list of conditions and the following disclaimer in the 134be47400SFrançois Tigeot * documentation and/or other materials provided with the distribution. 144be47400SFrançois Tigeot * 154be47400SFrançois Tigeot * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 164be47400SFrançois Tigeot * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 174be47400SFrançois Tigeot * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 184be47400SFrançois Tigeot * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 194be47400SFrançois Tigeot * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 204be47400SFrançois Tigeot * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 214be47400SFrançois Tigeot * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 224be47400SFrançois Tigeot * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 234be47400SFrançois Tigeot * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 244be47400SFrançois Tigeot * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 254be47400SFrançois Tigeot */ 264be47400SFrançois Tigeot 27233d54adSImre Vadász #ifndef _MACHINE_FRAMEBUFFER_H_ 28233d54adSImre Vadász #define _MACHINE_FRAMEBUFFER_H_ 29233d54adSImre Vadász 30233d54adSImre Vadász #ifdef _KERNEL 31233d54adSImre Vadász 325d302545SFrançois Tigeot #include <sys/bus.h> 335d302545SFrançois Tigeot 34ba409a88SImre Vadász struct fb_info; 354be47400SFrançois Tigeot struct fb_var_screeninfo; 364be47400SFrançois Tigeot struct fb_cmap; 37ba409a88SImre Vadász 38ba409a88SImre Vadász struct fb_ops { 394be47400SFrançois Tigeot int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); 40ba409a88SImre Vadász int (*fb_set_par)(struct fb_info *); 414be47400SFrançois Tigeot int (*fb_setcmap)(struct fb_cmap *cmap, struct fb_info *info); 42ba409a88SImre Vadász int (*fb_blank)(int, struct fb_info *); 434be47400SFrançois Tigeot int (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); 44ba409a88SImre Vadász int (*fb_debug_enter)(struct fb_info *); 454be47400SFrançois Tigeot int (*fb_debug_leave)(struct fb_info *info); 46*a85cb24fSFrançois Tigeot int (*fb_ioctl)(struct fb_info *info, unsigned int cmd, 47*a85cb24fSFrançois Tigeot unsigned long arg); 48ba409a88SImre Vadász }; 49ba409a88SImre Vadász 50233d54adSImre Vadász struct fb_info { 51233d54adSImre Vadász vm_offset_t vaddr; 52233d54adSImre Vadász vm_paddr_t paddr; 53233d54adSImre Vadász uint16_t width; 54233d54adSImre Vadász uint16_t height; 55233d54adSImre Vadász uint16_t stride; 56233d54adSImre Vadász uint16_t depth; 57233d54adSImre Vadász int is_vga_boot_display; 58f25fc9b7SImre Vadász void *par; 59ba409a88SImre Vadász struct fb_ops fbops; 605d302545SFrançois Tigeot device_t device; 61233d54adSImre Vadász }; 62233d54adSImre Vadász 63233d54adSImre Vadász int probe_efi_fb(int early); 64233d54adSImre Vadász 65233d54adSImre Vadász int register_framebuffer(struct fb_info *fb_info); 66ba409a88SImre Vadász void unregister_framebuffer(struct fb_info *fb_info); 67233d54adSImre Vadász 68233d54adSImre Vadász extern struct fb_info efi_fb_info; 69233d54adSImre Vadász 70233d54adSImre Vadász #endif /* _KERNEL */ 71233d54adSImre Vadász 72233d54adSImre Vadász #endif /* !_MACHINE_FRAMEBUFFER_H_ */ 73