The Pedigree Project 0.1
fb.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef PEDIGREE_FB_H
21#define PEDIGREE_FB_H
22
23#include <stddef.h>
24#include <stdint.h>
25
27enum FbCommands {
28 PEDIGREE_FB_CMD_MIN = 0x5000,
29 PEDIGREE_FB_SETMODE = 0x5000,
30 PEDIGREE_FB_GETMODE = 0x5001,
31 PEDIGREE_FB_REDRAW = 0x5002,
32 PEDIGREE_FB_CMD_MAX = 0x5002,
33};
34
35// Numeric values are part of the framebuffer ioctl ABI.
36enum FbPixelFormat {
37 PEDIGREE_FB_FORMAT_ARGB32 = 0,
38 PEDIGREE_FB_FORMAT_RGBA32 = 1,
39 PEDIGREE_FB_FORMAT_RGB32 = 2,
40 PEDIGREE_FB_FORMAT_BGR32 = 3,
41 PEDIGREE_FB_FORMAT_RGB24 = 4,
42 PEDIGREE_FB_FORMAT_BGR24 = 5,
43 PEDIGREE_FB_FORMAT_ARGB16 = 6,
44 PEDIGREE_FB_FORMAT_RGB565 = 7,
45 PEDIGREE_FB_FORMAT_RGB555 = 8,
46 PEDIGREE_FB_FORMAT_INDEXED8 = 9,
47 PEDIGREE_FB_FORMAT_RGB332 = 10,
48};
49
51typedef struct {
52 size_t width;
53 size_t height;
54 size_t depth;
56
57typedef struct {
58 size_t width;
59 size_t height;
60 size_t depth;
61 size_t bytes_per_pixel;
62 uint32_t format;
63 // Bytes between the starts of consecutive scanlines. GOP framebuffers may
64 // include padding after the visible pixels in each scanline.
65 size_t bytes_per_line;
67
68typedef struct {
69 size_t x;
70 size_t y;
71 size_t w;
72 size_t h;
74
75#endif
All zeroes = 'revert to text mode'.
Definition fb.h:51