X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Ftpl_drv_video.h;h=1be4f2b7a2f9f098be0c46e464b040f999e14f6e;hb=6e1cf1d50bca85f01b5f802b1a76f090e362bf05;hp=89bdbfd82988b2399cee59da237611c0982cf046;hpb=56f357ade393dc9e2c928971cfbd690dab72db18;p=tpg%2Facess2.git diff --git a/Kernel/include/tpl_drv_video.h b/Kernel/include/tpl_drv_video.h index 89bdbfd8..1be4f2b7 100644 --- a/Kernel/include/tpl_drv_video.h +++ b/Kernel/include/tpl_drv_video.h @@ -15,8 +15,6 @@ * 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. - * In pallete colour modes the LFB is preceded by a 1024 byte pallete (allowing - * room for 256 entries of 32-bits each) * Reading from the screen must either return zero, or read from the * framebuffer. * @@ -104,6 +102,7 @@ enum eTplVideo_IOCtl { */ VIDEO_IOCTL_REQLFB }; +#define DRV_VIDEO_IOCTLNAMES "getset_mode", "find+mode", "mode_info", "set_buf_format", "set_cursor", "request_framebuffer" /** * \brief Mode Structure used in IOCtl Calls @@ -160,7 +159,9 @@ enum eTplVideo_BufFormats }; /** - * \brief + * \brief 2D Accellerated Video Commands + * + * Commands passed in the command stream for ::VIDEO_BUFFMT_2DSTREAM */ enum eTplVideo_2DCommands { @@ -188,6 +189,17 @@ enum eTplVideo_2DCommands */ VIDEO_2DOP_BLIT, + + /** + * \brief Copy a region from video memory to the framebuffer + */ + VIDEO_2DOP_BLITBUF, + + /** + * \brief Copy and scale a region from video memory to the framebuffer + */ + VIDEO_2DOP_BLITSCALEBUF, + NUM_VIDEO_2DOPS }; @@ -232,11 +244,11 @@ extern int giVT_CharWidth; //! \brief Defines the height of a rendered character extern int giVT_CharHeight; /** - * \fn void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC) * \brief Driver helper that renders a character to a buffer * \param Codepoint Unicode character to render - * \param Buffer Buffer to render to (32-bpp) - * \param Pitch Number of DWords per line + * \param Buffer Buffer to render to + * \param Depth Bit depth of the destination buffer + * \param Pitch Number of bytes per line * \param BGC 32-bit Background Colour * \param FGC 32-bit Foreground Colour * @@ -244,27 +256,75 @@ extern int giVT_CharHeight; * text mode by keeping the character rendering abstracted from the driver, * easing the driver development and reducing code duplication. */ -extern void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC); +extern void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Depth, int Pitch, Uint32 BGC, Uint32 FGC); /** * \fn Uint32 VT_Colour12to24(Uint16 Col12) - * \brief Converts a colour from 12bpp to 32bpp + * \brief Converts a colour from 12bpp to 24bpp * \param Col12 12-bpp input colour * \return Expanded 32-bpp (24-bit colour) version of \a Col12 */ extern Uint32 VT_Colour12to24(Uint16 Col12); - /** + * \brief Converts a colour from 12bpp to 14bpp + * \param Col12 12-bpp input colour + * \return 15 bits per pixel value + */ +extern Uint16 VT_Colour12to15(Uint16 Col12); +/** + * \brief Converts a colour from 12bpp to 32bpp + * \param Col12 12-bpp input colour + * \param Depth Desired bit depth + * \return \a Depth bit number, denoting Col12 * + * Expands the source colour into a \a Depth bits per pixel representation. + * The colours are expanded with preference to Green, Blue and Red in that order + * (so, green gets the first spare pixel, blue gets the next, and red never gets + * the spare). \n + * The final bit of each component is used to fill the lower bits of the output. + */ +extern Uint32 VT_Colour12toN(Uint16 Col12, int Depth); + +/** + * \brief Handlers for eTplVideo_2DCommands */ typedef struct sDrvUtil_Video_2DHandlers { + /** + * \brief No Operation, Ignored + * \see VIDEO_2DOP_NOP + */ void *Nop; + /** + * \brief Fill a buffer region + * \param X Lefthand edge + * \param Y Top edge + * \param W Width + * \param H Height + * \param Colour Colour to fill with + * \see VIDEO_2DOP_FILL + */ void (*Fill)(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colour); + /** + * \brief Fill a buffer region + * \param DestX Lefthand edge of destination + * \param DestY Top edge of destination + * \param SrcX Lefthand edge of source + * \param SrcY Top edge of source + * \param W Width + * \param H Height + * \see VIDEO_2DOP_BLIT + */ void (*Blit)(void *Ent, Uint16 DestX, Uint16 DestY, Uint16 SrcX, Uint16 SrcY, Uint16 W, Uint16 H); } tDrvUtil_Video_2DHandlers; /** - * \brief + * \brief Handle a 2D operation stream for a driver + * \param Ent Value to pass to handlers + * \param Buffer Stream buffer + * \param Length Length of stream + * \param Handlers Handlers to use for the stream + * \param SizeofHandlers Size of \a tDrvUtil_Video_2DHandlers according + * to the driver. Used as version control and error avoidence. */ extern Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length, tDrvUtil_Video_2DHandlers *Handlers, int SizeofHandlers);