Video Driver Interface Definitions.
Video drivers extend the common driver interface tpl_drv_common.h and must support _at least_ the IOCtl numbers defined in this file to be compatable with Acess.
As said, a compatable driver must implement these calls correctly, but they may choose not to allow direct user access to the framebuffer.
Writes to the driver's file while in component colour modes must correspond to a change of the contents of the screen. The framebuffer must start at offset 0 in the file. Reading from the screen must either return zero, or read from the framebuffer.
All video drivers must support at least one text mode (Mode #0) For each graphics mode the driver exposes, there must be a corresponding text mode with the same resolution, this mode will be used when the user switches to a text Virtual Terminal while in graphics mode.
Go to the source code of this file.
Data Structures | |
struct | tVideo_IOCtl_Mode |
Mode Structure used in IOCtl Calls. More... | |
struct | tVideo_IOCtl_Pos |
Describes a position in the video framebuffer. More... | |
struct | tVT_Char |
Virtual Terminal Representation of a character. More... | |
struct | tDrvUtil_Video_2DHandlers |
Handlers for eTplVideo_2DCommands. More... | |
Defines | |
#define | DRV_VIDEO_IOCTLNAMES "getset_mode", "find+mode", "mode_info", "set_buf_format", "set_cursor", "request_framebuffer" |
Basic builtin colour definitions | |
#define | VT_COL_BLACK 0x0000 |
#define | VT_COL_GREY 0x0888 |
#define | VT_COL_LTGREY 0x0CCC |
#define | VT_COL_WHITE 0x0FFF |
Enumerations | |
enum | eTplVideo_IOCtl { VIDEO_IOCTL_GETSETMODE = 4, VIDEO_IOCTL_FINDMODE, VIDEO_IOCTL_MODEINFO, VIDEO_IOCTL_SETBUFFORMAT, VIDEO_IOCTL_SETCURSOR, VIDEO_IOCTL_REQLFB } |
Common Video IOCtl Calls. More... | |
enum | eTplVideo_BufFormats { VIDEO_BUFFMT_TEXT, VIDEO_BUFFMT_FRAMEBUFFER, VIDEO_BUFFMT_2DSTREAM, VIDEO_BUFFMT_3DSTREAM } |
Buffer Format Codes. More... | |
enum | eTplVideo_2DCommands { VIDEO_2DOP_NOP, VIDEO_2DOP_FILL, VIDEO_2DOP_BLIT, VIDEO_2DOP_BLITBUF, VIDEO_2DOP_BLITSCALEBUF, NUM_VIDEO_2DOPS } |
2D Accellerated Video Commands More... | |
Functions | |
void | VT_Font_Render (Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC) |
Driver helper that renders a character to a buffer. | |
Uint32 | VT_Colour12to24 (Uint16 Col12) |
Converts a colour from 12bpp to 32bpp. | |
Uint64 | DrvUtil_Video_2DStream (void *Ent, void *Buffer, int Length, tDrvUtil_Video_2DHandlers *Handlers, int SizeofHandlers) |
Handle a 2D operation stream for a driver. | |
Variables | |
int | giVT_CharWidth |
Defines the width of a rendered character. | |
int | giVT_CharHeight |
Defines the height of a rendered character. |
enum eTplVideo_2DCommands |
2D Accellerated Video Commands
Commands passed in the command stream for VIDEO_BUFFMT_2DSTREAM
enum eTplVideo_BufFormats |
Buffer Format Codes.
VIDEO_BUFFMT_TEXT |
Text Mode. The device file presents itself as an array of tVT_Char each describing a character cell on the screen. These cells are each giVT_CharWidth pixels wide and giVT_CharHeight high. |
VIDEO_BUFFMT_FRAMEBUFFER |
Framebuffer Mode. The device file presents as an array of 32-bpp pixels describing the entire screen. The format of a single pixel is in xRGB format (top 8 bits ignored, next 8 bits red, next 8 bits green and the bottom 8 bits blue) |
VIDEO_BUFFMT_2DSTREAM |
2D Accelerated Mode The device file acts as a character device, accepting a stream of commands described in eTplVideo_2DCommands when written to. |
VIDEO_BUFFMT_3DSTREAM |
3D Accelerated Mode The device file acts as a character device, accepting a stream of commands described in eTplVideo_3DCommands when written to. |
enum eTplVideo_IOCtl |
Common Video IOCtl Calls.
VIDEO_IOCTL_GETSETMODE |
Get/Set Mode. ioctl(..., int *mode)
If mode is non-NULL, the current video mode is set to *mode. This updated ID is then returned to the user. | |||
VIDEO_IOCTL_FINDMODE |
Find a matching mode. ioctl(..., tVideo_IOCtl_Mode *info)
Using avaliable modes matching the bpp and flags fields set the id field to the mode id of the mode with the closest width and height. | |||
VIDEO_IOCTL_MODEINFO |
Get mode info. ioctl(..., tVideo_IOCtl_Mode *info)
Set info's fields to the mode specified by the id field. | |||
VIDEO_IOCTL_SETBUFFORMAT |
Switches between Text, Framebuffer and 3D modes. ioctl(..., int *NewFormat)
Enabes and disables the video text mode, changing the behavior of writes to the device file. | |||
VIDEO_IOCTL_SETCURSOR |
Sets the cursor position. ioctl(..., tVideo_IOCtl_Pos *pos)
Set the text mode cursor position (if it is supported) If the pos is set to (-1,-1) the cursor is hidden, otherwise pos MUST be within the current screen size (as given by the current mode's tVideo_IOCtl_Mode.width and tVideo_IOCtl_Mode.height fields). | |||
VIDEO_IOCTL_REQLFB |
Request access to Framebuffer. ioctl(..., tVAddr MapTo)
Requests the driver to allow the user direct access to the framebuffer by mapping it to the supplied address. If the driver does not allow this boolean FALSE (0) is returned, else if the call succeeds (and the framebuffer ends up mapped) boolean TRUE (1) is returned. |
Uint64 DrvUtil_Video_2DStream | ( | void * | Ent, | |
void * | Buffer, | |||
int | Length, | |||
tDrvUtil_Video_2DHandlers * | Handlers, | |||
int | SizeofHandlers | |||
) |
Handle a 2D operation stream for a driver.
Ent | Value to pass to handlers | |
Buffer | Stream buffer | |
Length | Length of stream | |
Handlers | Handlers to use for the stream | |
SizeofHandlers | Size of tDrvUtil_Video_2DHandlers according to the driver. Used as version control and error avoidence. |
Converts a colour from 12bpp to 32bpp.
Col12 | 12-bpp input colour |
Driver helper that renders a character to a buffer.
Codepoint | Unicode character to render | |
Buffer | Buffer to render to (32-bpp) | |
Pitch | Number of DWords per line | |
BGC | 32-bit Background Colour | |
FGC | 32-bit Foreground Colour |
This function is provided to help video drivers to support a simple text mode by keeping the character rendering abstracted from the driver, easing the driver development and reducing code duplication.