1 /* 2 * Copyright (c) 2013 Corey Tabaka 3 * 4 * Use of this source code is governed by a MIT-style 5 * license that can be found in the LICENSE file or at 6 * https://opensource.org/licenses/MIT 7 */ 8 #pragma once 9 10 #include <lk/compiler.h> 11 #include <dev/driver.h> 12 13 struct fb_info { 14 void *addr; 15 size_t line_width; 16 size_t width; 17 size_t height; 18 size_t bpp; 19 }; 20 21 /* fb interface */ 22 struct fb_ops { 23 struct driver_ops std; 24 25 status_t (*set_mode)(struct device *dev, size_t width, size_t height, size_t bpp); 26 status_t (*get_info)(struct device *dev, struct fb_info *info); 27 status_t (*update)(struct device *dev); 28 status_t (*update_region)(struct device *dev, size_t x, size_t y, size_t width, size_t height); 29 }; 30 31 __BEGIN_CDECLS 32 33 status_t class_fb_set_mode(struct device *dev, size_t width, size_t height, size_t bpp); 34 status_t class_fb_get_info(struct device *dev, struct fb_info *info); 35 status_t class_fb_update(struct device *dev); 36 status_t class_fb_update_region(struct device *dev, size_t x, size_t y, size_t width, size_t height); 37 38 __END_CDECLS 39 40