[PATCH] Add RTEMS port of Linux FB user-space API

Kevin Kirspel kevin-kirspel at idexx.com
Wed May 24 12:31:19 UTC 2017


---
 cpukit/dev/include/linux/fb.h | 1188 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 1188 insertions(+)
 create mode 100644 cpukit/dev/include/linux/fb.h

diff --git a/cpukit/dev/include/linux/fb.h b/cpukit/dev/include/linux/fb.h
new file mode 100644
index 0000000..eebe1d4
--- /dev/null
+++ b/cpukit/dev/include/linux/fb.h
@@ -0,0 +1,1188 @@
+/**
+ * @file
+ *
+ * @brief RTEMS Port of Linux FB API
+ *
+ * @ingroup FBLinux
+ */
+
+/*
+ * Copyright (c) 2017 Kevin Kirspel.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _UAPI_LINUX_FB_H
+#define _UAPI_LINUX_FB_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup FBLinux Linux FB User-Space API
+ *
+ * @ingroup FB
+ *
+ * @brief RTEMS port of Linux FB user-space API.
+ *
+ * Additional documentation is available through the Linux sources, see
+ *
+ * - /usr/src/linux/include/uapi/linux/fb.h,
+ * - /usr/src/linux/Documentation/fb.
+ *
+ * @{
+ */
+
+/**
+ * @name FB Definitions
+ *
+ * @{
+ */
+
+/**
+ * @brief The maximum number of framebuffer devices.
+ */
+#define FB_MAX 32
+
+/** @} */
+
+/**
+ * @name FB Ioctls
+ *
+ * @{
+ */
+
+/**
+ * @brief Gets the variable screen information.
+ *
+ * @see fb_var_screeninfo.
+ */
+#define FBIOGET_VSCREENINFO     0x4600
+
+/**
+ * @brief Sets the variable screen information.
+ *
+ * Will return -1 if kernel is unable to activate the settings
+ *
+ * @see fb_var_screeninfo.
+ */
+#define FBIOPUT_VSCREENINFO     0x4601
+
+/**
+ * @brief Gets the fix screen information.
+ *
+ * @see fb_fix_screeninfo.
+ */
+#define FBIOGET_FSCREENINFO     0x4602
+
+/**
+ * @brief Gets the color map.
+ *
+ * @see fb_cmap.
+ */
+#define FBIOGETCMAP             0x4604
+
+/**
+ * @brief Sets the color map.
+ *
+ * @see fb_cmap.
+ */
+#define FBIOPUTCMAP             0x4605
+
+/**
+ * @brief Move physical display within the virtual.
+ */
+#define FBIOPAN_DISPLAY         0x4606
+
+/**
+ * @brief Controls cursor attributes.
+ *
+ * @see fb_cursor.
+ */
+#define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor)
+
+/**
+ * @brief Gets content of console.
+ */
+#define FBIOGET_CON2FBMAP       0x460F
+
+/**
+ * @brief Sets content of console.
+ */
+#define FBIOPUT_CON2FBMAP       0x4610
+
+/**
+ * @brief Delete contents of console.
+ */
+#define FBIOBLANK               0x4611
+
+/**
+ * @brief Gets the current raster beam position.
+ */
+#define FBIOGET_VBLANK          _IOR('F', 0x12, struct fb_vblank)
+
+/**
+ * @brief Allocates graphics memory for own purposes.
+ */
+#define FBIO_ALLOC              0x4613
+
+/**
+ * @brief Frees allocated graphics memory.
+ */
+#define FBIO_FREE               0x4614
+
+/**
+ * @brief Gets font glyph.
+ */
+#define FBIOGET_GLYPH           0x4615
+
+/**
+ * @brief Gets hardware cursor information.
+ */
+#define FBIOGET_HWCINFO         0x4616
+
+/**
+ * @brief Sets the video mode information.
+ */
+#define FBIOPUT_MODEINFO        0x4617
+
+/**
+ * @brief Gets display information.
+ */
+#define FBIOGET_DISPINFO        0x4618
+
+/**
+ * @brief Waits for vertical sync to occur.
+ */
+#define FBIO_WAITFORVSYNC       _IOW('F', 0x20, uint32_t)
+
+/** @} */
+
+/**
+ * @name FB type settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB type packed pixels.
+ */
+#define FB_TYPE_PACKED_PIXELS           0
+
+/**
+ * @brief FB type non interleaved planes.
+ */
+#define FB_TYPE_PLANES                  1
+
+/**
+ * @brief FB type interleaved planes.
+ */
+#define FB_TYPE_INTERLEAVED_PLANES      2
+
+/**
+ * @brief FB type text.
+ */
+#define FB_TYPE_TEXT                    3
+
+/**
+ * @brief FB type vga planes.
+ */
+#define FB_TYPE_VGA_PLANES              4
+
+/**
+ * @brief FB type identified by a V4L2 FOURCC.
+ */
+#define FB_TYPE_FOURCC                  5
+
+/** @} */
+
+/**
+ * @name FB AUX text settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB AUX text Monochrome text.
+ */
+#define FB_AUX_TEXT_MDA         0
+
+/**
+ * @brief FB AUX text CGA/EGA/VGA Color text.
+ */
+#define FB_AUX_TEXT_CGA         1
+
+/**
+ * @brief FB AUX text S3 MMIO fasttext.
+ */
+#define FB_AUX_TEXT_S3_MMIO     2
+
+/**
+ * @brief FB AUX text MGA Millenium I: text, attr, 14 reserved bytes.
+ */
+#define FB_AUX_TEXT_MGA_STEP16  3
+
+/**
+ * @brief FB AUX text other MGAs: text, attr,  6 reserved bytes.
+ */
+#define FB_AUX_TEXT_MGA_STEP8   4
+
+/**
+ * @brief FB AUX text 8-15: SVGA tileblit compatible modes.
+ */
+#define FB_AUX_TEXT_SVGA_GROUP  8
+
+/**
+ * @brief FB AUX text lower three bits says step.
+ */
+#define FB_AUX_TEXT_SVGA_MASK   7
+
+/**
+ * @brief FB AUX text SVGA text mode:  text, attr.
+ */
+#define FB_AUX_TEXT_SVGA_STEP2  8
+
+/**
+ * @brief FB AUX text SVGA text mode: text, attr,  2 reserved bytes.
+ */
+#define FB_AUX_TEXT_SVGA_STEP4  9
+
+/**
+ * @brief FB AUX text SVGA text mode: text, attr,  6 reserved bytes.
+ */
+#define FB_AUX_TEXT_SVGA_STEP8  10
+
+/**
+ * @brief FB AUX text SVGA text mode: text, attr, 14 reserved bytes.
+ */
+#define FB_AUX_TEXT_SVGA_STEP16 11
+
+/**
+ * @brief FB AUX text SVGA reserved up to 15.
+ */
+#define FB_AUX_TEXT_SVGA_LAST   15
+
+/** @} */
+
+/**
+ * @name FB AUX VGA settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB AUX VGA 16 color planes (EGA/VGA)
+ */
+#define FB_AUX_VGA_PLANES_VGA4          0
+
+/**
+ * @brief FB AUX VGA CFB4 in planes (VGA)
+ */
+#define FB_AUX_VGA_PLANES_CFB4          1
+
+/**
+ * @brief FB AUX VGA CFB8 in planes (VGA)
+ */
+#define FB_AUX_VGA_PLANES_CFB8          2
+
+/** @} */
+
+/**
+ * @name FB visual settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB visual Monochr. 1=Black 0=White.
+ */
+#define FB_VISUAL_MONO01                0
+
+/**
+ * @brief FB visual Monochr. 1=White 0=Black.
+ */
+#define FB_VISUAL_MONO10                1
+
+/**
+ * @brief FB visual True color.
+ */
+#define FB_VISUAL_TRUECOLOR             2
+
+/**
+ * @brief FB visual Pseudo color (like atari).
+ */
+#define FB_VISUAL_PSEUDOCOLOR           3
+
+/**
+ * @brief FB visual Direct color.
+ */
+#define FB_VISUAL_DIRECTCOLOR           4
+
+/**
+ * @brief FB visual Pseudo color readonly.
+ */
+#define FB_VISUAL_STATIC_PSEUDOCOLOR    5
+
+/**
+ * @brief FB visual identified by a V4L2 FOURCC.
+ */
+#define FB_VISUAL_FOURCC                6
+
+/** @} */
+
+/**
+ * @name FB HW acceleration settings
+ *
+ * @{
+ */
+
+#define FB_ACCEL_NONE           0
+#define FB_ACCEL_ATARIBLITT     1
+#define FB_ACCEL_AMIGABLITT     2
+#define FB_ACCEL_S3_TRIO64      3
+#define FB_ACCEL_NCR_77C32BLT   4
+#define FB_ACCEL_S3_VIRGE       5
+#define FB_ACCEL_ATI_MACH64GX   6
+#define FB_ACCEL_DEC_TGA        7
+#define FB_ACCEL_ATI_MACH64CT   8
+#define FB_ACCEL_ATI_MACH64VT   9
+#define FB_ACCEL_ATI_MACH64GT   10
+#define FB_ACCEL_SUN_CREATOR    11
+#define FB_ACCEL_SUN_CGSIX      12
+#define FB_ACCEL_SUN_LEO        13
+#define FB_ACCEL_IMS_TWINTURBO  14
+#define FB_ACCEL_3DLABS_PERMEDIA2 15
+#define FB_ACCEL_MATROX_MGA2064W 16
+#define FB_ACCEL_MATROX_MGA1064SG 17
+#define FB_ACCEL_MATROX_MGA2164W 18
+#define FB_ACCEL_MATROX_MGA2164W_AGP 19
+#define FB_ACCEL_MATROX_MGAG100 20
+#define FB_ACCEL_MATROX_MGAG200 21
+#define FB_ACCEL_SUN_CG14       22
+#define FB_ACCEL_SUN_BWTWO      23
+#define FB_ACCEL_SUN_CGTHREE    24
+#define FB_ACCEL_SUN_TCX        25
+#define FB_ACCEL_MATROX_MGAG400 26
+#define FB_ACCEL_NV3            27
+#define FB_ACCEL_NV4            28
+#define FB_ACCEL_NV5            29
+#define FB_ACCEL_CT_6555x       30
+#define FB_ACCEL_3DFX_BANSHEE   31
+#define FB_ACCEL_ATI_RAGE128    32
+#define FB_ACCEL_IGS_CYBER2000  33
+#define FB_ACCEL_IGS_CYBER2010  34
+#define FB_ACCEL_IGS_CYBER5000  35
+#define FB_ACCEL_SIS_GLAMOUR    36
+#define FB_ACCEL_3DLABS_PERMEDIA3 37
+#define FB_ACCEL_ATI_RADEON     38
+#define FB_ACCEL_I810           39
+#define FB_ACCEL_SIS_GLAMOUR_2  40
+#define FB_ACCEL_SIS_XABRE      41
+#define FB_ACCEL_I830           42
+#define FB_ACCEL_NV_10          43
+#define FB_ACCEL_NV_20          44
+#define FB_ACCEL_NV_30          45
+#define FB_ACCEL_NV_40          46
+#define FB_ACCEL_XGI_VOLARI_V   47
+#define FB_ACCEL_XGI_VOLARI_Z   48
+#define FB_ACCEL_OMAP1610       49
+#define FB_ACCEL_TRIDENT_TGUI   50
+#define FB_ACCEL_TRIDENT_3DIMAGE 51
+#define FB_ACCEL_TRIDENT_BLADE3D 52
+#define FB_ACCEL_TRIDENT_BLADEXP 53
+#define FB_ACCEL_CIRRUS_ALPINE   53
+#define FB_ACCEL_NEOMAGIC_NM2070 90
+#define FB_ACCEL_NEOMAGIC_NM2090 91
+#define FB_ACCEL_NEOMAGIC_NM2093 92
+#define FB_ACCEL_NEOMAGIC_NM2097 93
+#define FB_ACCEL_NEOMAGIC_NM2160 94
+#define FB_ACCEL_NEOMAGIC_NM2200 95
+#define FB_ACCEL_NEOMAGIC_NM2230 96
+#define FB_ACCEL_NEOMAGIC_NM2360 97
+#define FB_ACCEL_NEOMAGIC_NM2380 98
+#define FB_ACCEL_PXA3XX          99
+
+#define FB_ACCEL_SAVAGE4        0x80
+#define FB_ACCEL_SAVAGE3D       0x81
+#define FB_ACCEL_SAVAGE3D_MV    0x82
+#define FB_ACCEL_SAVAGE2000     0x83
+#define FB_ACCEL_SAVAGE_MX_MV   0x84
+#define FB_ACCEL_SAVAGE_MX      0x85
+#define FB_ACCEL_SAVAGE_IX_MV   0x86
+#define FB_ACCEL_SAVAGE_IX      0x87
+#define FB_ACCEL_PROSAVAGE_PM   0x88
+#define FB_ACCEL_PROSAVAGE_KM   0x89
+#define FB_ACCEL_S3TWISTER_P    0x8a
+#define FB_ACCEL_S3TWISTER_K    0x8b
+#define FB_ACCEL_SUPERSAVAGE    0x8c
+#define FB_ACCEL_PROSAVAGE_DDR  0x8d
+#define FB_ACCEL_PROSAVAGE_DDRK 0x8e
+
+#define FB_ACCEL_PUV3_UNIGFX    0xa0
+
+/** @} */
+
+/**
+ * @name FB capability settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB Device supports FOURCC-based formats.
+ */
+#define FB_CAP_FOURCC           1
+
+/** @} */
+
+/**
+ * @brief FB fix screen information.
+ */
+struct fb_fix_screeninfo {
+  /**
+   * @brief identification string eg "TT Builtin"
+   */
+  char id[16];
+
+  /**
+   * @brief Start of frame buffer mem (physical address)
+   */
+  unsigned long smem_start;
+
+  /**
+   * @brief Length of frame buffer mem
+   */
+  uint32_t smem_len;
+
+  /**
+   * @brief see FB_TYPE_*
+   */
+  uint32_t type;
+
+  /**
+   * @brief Interleave for interleaved Planes
+   */
+  uint32_t type_aux;
+
+  /**
+   * @brief see FB_VISUAL_*
+   */
+  uint32_t visual;
+
+  /**
+   * @brief zero if no hardware panning
+   */
+  uint16_t xpanstep;
+
+  /**
+   * @brief zero if no hardware panning
+   */
+  uint16_t ypanstep;
+
+  /**
+   * @brief zero if no hardware ywrap
+   */
+  uint16_t ywrapstep;
+
+  /**
+   * @brief length of a line in bytes
+   */
+  uint32_t line_length;
+
+  /**
+   * @brief Start of Memory Mapped I/O (physical address)
+   */
+  unsigned long mmio_start;
+
+  /**
+   * @brief Length of Memory Mapped I/O
+   */
+  uint32_t mmio_len;
+
+  /**
+   * @brief Indicate to driver which specific chip/card we have
+   */
+  uint32_t accel;
+
+  /**
+   * @brief see FB_CAP_*
+   */
+  uint16_t capabilities;
+
+  /**
+   * @brief Reserved for future compatibility
+   */
+  uint16_t reserved[2];
+};
+
+/**
+ * @name FB color bit field data
+ *
+ * Interpretation of offset for color fields: All offsets are from the right,
+ * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
+ * can use the offset as right argument to <<). A pixel afterwards is a bit
+ * stream and is written to video memory as that unmodified.
+ *
+ * For pseudocolor: offset and length should be the same for all color
+ * components. Offset specifies the position of the least significant bit
+ * of the pallette index in a pixel value. Length indicates the number
+ * of available palette entries (i.e. # of entries = 1 << length).
+ *
+ * @{
+ */
+
+/**
+ * @brief FB bit field.
+ */
+struct fb_bitfield {
+
+  /**
+   * @brief beginning of bitfield
+   */
+  uint32_t offset;
+
+  /**
+   * @brief length of bitfield
+   */
+  uint32_t length;
+
+  /**
+   * @brief != 0 : Most significant bit is right
+   */
+  uint32_t msb_right;
+};
+
+/** @} */
+
+/**
+ * @name FB non-standard settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB non-standard Hold-And-Modify (HAM).
+ */
+#define FB_NONSTD_HAM           1
+
+/**
+ * @brief FB non-standard order of pixels in each byte is reversed.
+ */
+#define FB_NONSTD_REV_PIX_IN_B  2
+
+/** @} */
+
+/**
+ * @name FB activate settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB activate set values immediately (or vbl)
+ */
+#define FB_ACTIVATE_NOW         0
+
+/**
+ * @brief FB activate activate on next open
+ */
+#define FB_ACTIVATE_NXTOPEN     1
+
+/**
+ * @brief FB activate don't set, round up impossible
+ */
+#define FB_ACTIVATE_TEST        2
+
+/**
+ * @brief FB activate values mask
+ */
+#define FB_ACTIVATE_MASK       15
+
+/**
+ * @brief FB activate values on next vbl
+ */
+#define FB_ACTIVATE_VBL        16
+
+/**
+ * @brief FB activate change colormap on vbl
+ */
+#define FB_CHANGE_CMAP_VBL     32
+
+/**
+ * @brief FB activate change all VCs on this fb
+ */
+#define FB_ACTIVATE_ALL        64
+
+/**
+ * @brief FB activate force apply even when no change
+ */
+#define FB_ACTIVATE_FORCE     128
+
+/**
+ * @brief FB activate invalidate videomode
+ */
+#define FB_ACTIVATE_INV_MODE  256
+
+/** @} */
+
+#define FB_ACCELF_TEXT          1
+
+/**
+ * @name FB activate settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB horizontal sync high active
+ */
+#define FB_SYNC_HOR_HIGH_ACT    1
+
+/**
+ * @brief FB vertical sync high active
+ */
+#define FB_SYNC_VERT_HIGH_ACT   2
+
+/**
+ * @brief FB external sync
+ */
+#define FB_SYNC_EXT             4
+
+/**
+ * @brief FB composite sync high active
+ */
+#define FB_SYNC_COMP_HIGH_ACT   8
+
+/**
+ * @brief FB broadcast video timings
+ */
+#define FB_SYNC_BROADCAST       16
+
+/**
+ * @brief FB sync on green
+ */
+#define FB_SYNC_ON_GREEN        32
+
+/** @} */
+
+/**
+ * @name FB vmode settings
+ *
+ * @{
+ */
+
+/**
+ * @brief FB vmode non interlaced
+ */
+#define FB_VMODE_NONINTERLACED  0
+
+/**
+ * @brief FB vmode interlaced
+ */
+#define FB_VMODE_INTERLACED     1
+
+/**
+ * @brief FB vmode double scan
+ */
+#define FB_VMODE_DOUBLE         2
+
+/**
+ * @brief FB vmode interlaced: top line first
+ */
+#define FB_VMODE_ODD_FLD_FIRST  4
+
+/**
+ * @brief FB vmode mask
+ */
+#define FB_VMODE_MASK           255
+
+/**
+ * @brief FB vmode ywrap instead of panning
+ */
+#define FB_VMODE_YWRAP          256
+
+/**
+ * @brief FB vmode smooth xpan possible (internally used)
+ */
+#define FB_VMODE_SMOOTH_XPAN    512
+
+/**
+ * @brief FB vmode don't update x/yoffset
+ */
+#define FB_VMODE_CONUPDATE      512
+
+/** @} */
+
+/**
+ * @name FB Display rotation support
+ *
+ * @{
+ */
+
+#define FB_ROTATE_UR      0
+#define FB_ROTATE_CW      1
+#define FB_ROTATE_UD      2
+#define FB_ROTATE_CCW     3
+
+/** @} */
+
+#define PICOS2KHZ(a) (1000000000UL/(a))
+#define KHZ2PICOS(a) (1000000000UL/(a))
+
+/**
+ * @brief FB var screen information.
+ */
+struct fb_var_screeninfo {
+  /**
+   * @brief visible x resolution
+   */
+  uint32_t xres;
+
+  /**
+   * @brief visible x resolution
+   */
+  uint32_t yres;
+
+  /**
+   * @brief virtual x resolution
+   */
+  uint32_t xres_virtual;
+
+  /**
+   * @brief virtual x resolution
+   */
+  uint32_t yres_virtual;
+
+  /**
+   * @brief x offset from virtual to visible
+   */
+  uint32_t xoffset;
+
+  /**
+   * @brief x offset from virtual to visible
+   */
+  uint32_t yoffset;
+
+
+  /**
+   * @brief bit per pixel
+   */
+  uint32_t bits_per_pixel;
+
+  /**
+   * @brief 0 = color, 1 = grayscale, >1 = FOURCC
+   */
+  uint32_t grayscale;
+
+  /**
+   * @brief bitfield in fb mem if true color, else only length is significant
+   */
+  struct fb_bitfield red;
+  struct fb_bitfield green;
+  struct fb_bitfield blue;
+
+  /**
+   * @brief transparency
+   */
+  struct fb_bitfield transp;
+
+
+  /**
+   * @brief != 0 Non standard pixel format
+   */
+  uint32_t nonstd;
+
+
+  /**
+   * @brief see FB_ACTIVATE_*
+   */
+  uint32_t activate;
+
+
+  /**
+   * @brief height of picture in mm
+   */
+  uint32_t height;
+
+  /**
+   * @brief width of picture in mm
+   */
+  uint32_t width;
+
+
+  /**
+   * @brief (OBSOLETE) see fb_info.flags
+   */
+  uint32_t accel_flags;
+
+  /**
+   * @brief pixel clock in ps (pico seconds)
+   */
+  uint32_t pixclock;
+
+  /**
+   * @brief time from sync to picture (in pixclocks)
+   */
+  uint32_t left_margin;
+
+  /**
+   * @brief time from picture to sync (in pixclocks)
+   */
+  uint32_t right_margin;
+
+  /**
+   * @brief time from sync to picture (in pixclocks)
+   */
+  uint32_t upper_margin;
+
+  /**
+   * @brief time from picture to sync (in pixclocks)
+   */
+  uint32_t lower_margin;
+
+  /**
+   * @brief length of horizontal sync
+   */
+  uint32_t hsync_len;
+
+  /**
+   * @brief length of vertical sync
+   */
+  uint32_t vsync_len;
+
+  /**
+   * @brief see FB_SYNC_*
+   */
+  uint32_t sync;
+
+  /**
+   * @brief see FB_VMODE_*
+   */
+  uint32_t vmode;
+
+  /**
+   * @brief angle we rotate counter clockwise
+   */
+  uint32_t rotate;
+
+  /**
+   * @brief colorspace for FOURCC-based modes
+   */
+  uint32_t colorspace;
+
+  /**
+   * @brief Reserved for future compatibility
+   */
+  uint32_t reserved[4];
+};
+
+/**
+ * @brief FB cmap.
+ */
+struct fb_cmap {
+  /**
+   * @brief First entry
+   */
+  uint32_t start;
+
+  /**
+   * @brief Number of entries
+   */
+  uint32_t len;
+
+  /**
+   * @brief Red values
+   */
+  uint16_t *red;
+
+  /**
+   * @brief Green values
+   */
+  uint16_t *green;
+
+  /**
+   * @brief Blue values
+   */
+  uint16_t *blue;
+
+  /**
+   * @brief transparency, can be NULL
+   */
+  uint16_t *transp;
+};
+
+/**
+ * @brief FB con2fbmap.
+ */
+struct fb_con2fbmap {
+  uint32_t console;
+  uint32_t framebuffer;
+};
+
+/**
+ * @name FB VESA Blanking Levels
+ *
+ * @{
+ */
+#define VESA_NO_BLANKING        0
+#define VESA_VSYNC_SUSPEND      1
+#define VESA_HSYNC_SUSPEND      2
+#define VESA_POWERDOWN          3
+
+/** @} */
+
+/**
+ * @name FB Blanking Settings
+ *
+ * @{
+ */
+enum {
+  /**
+   * @brief screen: unblanked, hsync: on,  vsync: on
+   */
+  FB_BLANK_UNBLANK       = VESA_NO_BLANKING,
+
+  /**
+   * @brief screen: blanked,   hsync: on,  vsync: on
+   */
+  FB_BLANK_NORMAL        = VESA_NO_BLANKING + 1,
+
+  /**
+   * @brief screen: blanked,   hsync: on,  vsync: off
+   */
+  FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
+
+  /**
+   * @brief screen: blanked,   hsync: off, vsync: on
+   */
+  FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
+
+  /**
+   * @brief screen: blanked,   hsync: off, vsync: off
+   */
+  FB_BLANK_POWERDOWN     = VESA_POWERDOWN + 1
+};
+
+/** @} */
+
+/**
+ * @name FB Vertical Blanking Flags
+ *
+ * @{
+ */
+
+/**
+ * @brief FB currently in a vertical blank
+ */
+#define FB_VBLANK_VBLANKING     0x001
+
+/**
+ * @brief FB currently in a horizontal blank
+ */
+#define FB_VBLANK_HBLANKING     0x002
+
+/**
+ * @brief FB vertical blanks can be detected
+ */
+#define FB_VBLANK_HAVE_VBLANK   0x004
+
+/**
+ * @brief FB horizontal blanks can be detected
+ */
+#define FB_VBLANK_HAVE_HBLANK   0x008
+
+/**
+ * @brief FB global retrace counter is available
+ */
+#define FB_VBLANK_HAVE_COUNT    0x010
+
+/**
+ * @brief FB the vcount field is valid
+ */
+#define FB_VBLANK_HAVE_VCOUNT   0x020
+
+/**
+ * @brief FB the hcount field is valid
+ */
+#define FB_VBLANK_HAVE_HCOUNT   0x040
+
+/**
+ * @brief FB currently in a vsync
+ */
+#define FB_VBLANK_VSYNCING      0x080
+
+/**
+ * @brief FB verical syncs can be detected
+ */
+#define FB_VBLANK_HAVE_VSYNC    0x100
+
+/** @} */
+
+/**
+ * @brief FB var screen information.
+ */
+struct fb_vblank {
+  /**
+   * @brief FB_VBLANK flags
+   */
+  uint32_t flags;
+
+  /**
+   * @brief counter of retraces since boot
+   */
+  uint32_t count;
+
+  /**
+   * @brief current scanline position
+   */
+  uint32_t vcount;
+
+  /**
+   * @brief current scandot position
+   */
+  uint32_t hcount;
+
+  /**
+   * @brief reserved for future compatibility
+   */
+  uint32_t reserved[4];
+};
+
+#define ROP_COPY 0
+#define ROP_XOR  1
+
+/**
+ * @brief FB copy area.
+ */
+struct fb_copyarea {
+  uint32_t dx;
+  uint32_t dy;
+  uint32_t width;
+  uint32_t height;
+  uint32_t sx;
+  uint32_t sy;
+};
+
+/**
+ * @brief FB fill rectangle.
+ */
+struct fb_fillrect {
+  uint32_t dx;
+  uint32_t dy;
+  uint32_t width;
+  uint32_t height;
+  uint32_t color;
+  uint32_t rop;
+};
+
+/**
+ * @brief FB place image.
+ */
+struct fb_image {
+  /**
+   * @brief Where to place image
+   */
+  uint32_t dx;
+  uint32_t dy;
+
+  /**
+   * @brief Size of image
+   */
+  uint32_t width;
+  uint32_t height;
+
+  /**
+   * @brief Only used when a mono bitmap
+   */
+  uint32_t fg_color;
+  uint32_t bg_color;
+
+  /**
+   * @brief Depth of the image
+   */
+  uint8_t  depth;
+
+  /**
+   * @brief Pointer to image data
+   */
+  const char *data;
+
+  /**
+   * @brief color map info
+   */
+  struct fb_cmap cmap;
+};
+
+/**
+ * @name FB hardware cursor control
+ *
+ * @{
+ */
+
+#define FB_CUR_SETIMAGE 0x01
+#define FB_CUR_SETPOS   0x02
+#define FB_CUR_SETHOT   0x04
+#define FB_CUR_SETCMAP  0x08
+#define FB_CUR_SETSHAPE 0x10
+#define FB_CUR_SETSIZE  0x20
+#define FB_CUR_SETALL   0xFF
+
+/** @} */
+
+/**
+ * @brief FB cursor position.
+ */
+struct fbcurpos {
+  uint16_t x, y;
+};
+
+/**
+ * @brief FB curose.
+ */
+struct fb_cursor {
+  /**
+   * @brief what to set
+   */
+  uint16_t set;
+
+  /**
+   * @brief cursor on/off
+   */
+  uint16_t enable;
+
+  /**
+   * @brief bitop operation
+   */
+  uint16_t rop;
+
+  /**
+   * @brief cursor mask bits
+   */
+  const char *mask;
+
+  /**
+   * @brief cursor hot spot
+   */
+  struct fbcurpos hot;
+
+  /**
+   * @brief Cursor image
+   */
+  struct fb_image image;
+};
+
+/**
+ * @name FB Settings for the generic backlight code
+ *
+ * @{
+ */
+
+#define FB_BACKLIGHT_LEVELS     128
+#define FB_BACKLIGHT_MAX        0xFF
+
+/** @} */
+
+/** @} */
+
+#endif /* _UAPI_LINUX_FB_H */
--
1.9.1



More information about the devel mailing list