Modules/SB16 - Stub driver, nowhere near complete
[tpg/acess2.git] / Kernel / include / tpl_drv_video.h
index ce575bb..f518e74 100644 (file)
@@ -15,8 +15,6 @@
  * Writes to the driver's file while in component colour modes\r
  * must correspond to a change of the contents of the screen. The framebuffer\r
  * must start at offset 0 in the file.\r
- * In pallete colour modes the LFB is preceded by a 1024 byte pallete (allowing\r
- * room for 256 entries of 32-bits each)\r
  * Reading from the screen must either return zero, or read from the\r
  * framebuffer.\r
  * \r
@@ -92,18 +90,15 @@ enum eTplVideo_IOCtl {
        VIDEO_IOCTL_SETCURSOR,\r
        \r
        /**\r
-        * ioctl(..., tVAddr MapTo)\r
-        * \brief Request access to Framebuffer\r
-        * \return Boolean Success\r
-        * \r
-        * Requests the driver to allow the user direct access to the\r
-        * framebuffer by mapping it to the supplied address.\r
-        * If the driver does not allow this boolean FALSE (0) is returned,\r
-        * else if the call succeeds (and the framebuffer ends up mapped) boolean\r
-        * TRUE (1) is returned.\r
+        * ioctl(..., tVideo_IOCtl_Bitmap *Image)\r
+        * \brief Sets the cursor image\r
+        * \return Boolean success\r
+        *\r
+        * Sets the graphics mode cursor image\r
         */\r
-       VIDEO_IOCTL_REQLFB\r
+       VIDEO_IOCTL_SETCURSORBITMAP\r
 };\r
+#define DRV_VIDEO_IOCTLNAMES   "getset_mode", "find+mode", "mode_info", "set_buf_format", "set_cursor", "set_cursor_bitmap"\r
 \r
 /**\r
  * \brief Mode Structure used in IOCtl Calls\r
@@ -159,6 +154,51 @@ enum eTplVideo_BufFormats
        VIDEO_BUFFMT_3DSTREAM\r
 };\r
 \r
+/**\r
+ * \brief 2D Accellerated Video Commands\r
+ * \r
+ * Commands passed in the command stream for ::VIDEO_BUFFMT_2DSTREAM\r
+ */\r
+enum eTplVideo_2DCommands\r
+{\r
+       /**\r
+        * \brief No Operation\r
+        */\r
+       VIDEO_2DOP_NOP,\r
+       /**\r
+        * \brief Fill a region\r
+        * \param X     Uint16 - Leftmost pixels of the region\r
+        * \param Y     Uint16 - Topmost pixels of the region\r
+        * \param W     Uint16 - Width of the region\r
+        * \param H     Uint16 - Height of the region\r
+        * \param Colour        Uint32 - Value to fill with\r
+        */\r
+       VIDEO_2DOP_FILL,\r
+       /**\r
+        * \brief Copy a region from one part of the framebuffer to another\r
+        * \param DestX Uint16 - Leftmost pixels of the destination\r
+        * \param DestY Uint16 - Topmost pixels of the destination\r
+        * \param SrcX  Uint16 - Leftmost pixels of the source\r
+        * \param SrcY  Uint16 - Topmost pixels of the source\r
+        * \param Width Uint16 - Width of the region\r
+        * \param Height        Uint16 - Height of the region\r
+        */\r
+       VIDEO_2DOP_BLIT,\r
+\r
+\r
+       /**\r
+        * \brief Copy a region from video memory to the framebuffer\r
+        */\r
+       VIDEO_2DOP_BLITBUF,\r
+\r
+       /**\r
+        * \brief Copy and scale a region from video memory to the framebuffer\r
+        */\r
+       VIDEO_2DOP_BLITSCALEBUF,\r
+\r
+       NUM_VIDEO_2DOPS\r
+};\r
+\r
 /**\r
  * \brief Describes a position in the video framebuffer\r
  */\r
@@ -168,6 +208,18 @@ typedef struct sVideo_IOCtl_Pos
        Sint16  y;      //!< Y Coordinate\r
 }      tVideo_IOCtl_Pos;\r
 \r
+/**\r
+ * \brief Bitmap object (out of band image)\r
+ */\r
+typedef struct sVideo_IOCtl_Bitmap\r
+{\r
+       Sint16  W;      //!< Width of image\r
+       Sint16  H;      //!< Height of image\r
+       Sint16  XOfs;   //!< X Offset of center\r
+       Sint16  YOfs;   //!< Y Offset of center\r
+       Uint32  Data[]; //!< Image data (ARGB array)\r
+}      tVideo_IOCtl_Bitmap;\r
+\r
 /**\r
  * \brief Virtual Terminal Representation of a character\r
  */\r
@@ -200,11 +252,11 @@ extern int        giVT_CharWidth;
 //! \brief Defines the height of a rendered character\r
 extern int     giVT_CharHeight;\r
 /**\r
- * \fn void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC)\r
  * \brief Driver helper that renders a character to a buffer\r
  * \param Codepoint    Unicode character to render\r
- * \param Buffer       Buffer to render to (32-bpp)\r
- * \param Pitch        Number of DWords per line\r
+ * \param Buffer       Buffer to render to\r
+ * \param Depth        Bit depth of the destination buffer\r
+ * \param Pitch        Number of bytes per line\r
  * \param BGC  32-bit Background Colour\r
  * \param FGC  32-bit Foreground Colour\r
  * \r
@@ -212,13 +264,77 @@ extern int        giVT_CharHeight;
  * text mode by keeping the character rendering abstracted from the driver,\r
  * easing the driver development and reducing code duplication.\r
  */\r
-extern void    VT_Font_Render(Uint32 Codepoint, void *Buffer, int Pitch, Uint32 BGC, Uint32 FGC);\r
+extern void    VT_Font_Render(Uint32 Codepoint, void *Buffer, int Depth, int Pitch, Uint32 BGC, Uint32 FGC);\r
 /**\r
  * \fn Uint32 VT_Colour12to24(Uint16 Col12)\r
- * \brief Converts a colour from 12bpp to 32bpp\r
+ * \brief Converts a colour from 12bpp to 24bpp\r
  * \param Col12        12-bpp input colour\r
  * \return Expanded 32-bpp (24-bit colour) version of \a Col12\r
  */\r
 extern Uint32  VT_Colour12to24(Uint16 Col12);\r
+/**\r
+ * \brief Converts a colour from 12bpp to 14bpp\r
+ * \param Col12        12-bpp input colour\r
+ * \return 15 bits per pixel value\r
+ */\r
+extern Uint16  VT_Colour12to15(Uint16 Col12);\r
+/**\r
+ * \brief Converts a colour from 12bpp to 32bpp\r
+ * \param Col12        12-bpp input colour\r
+ * \param Depth        Desired bit depth\r
+ * \return \a Depth bit number, denoting Col12\r
+ * \r
+ * Expands the source colour into a \a Depth bits per pixel representation.\r
+ * The colours are expanded with preference to Green, Blue and Red in that order\r
+ * (so, green gets the first spare pixel, blue gets the next, and red never gets\r
+ * the spare). \n\r
+ * The final bit of each component is used to fill the lower bits of the output.\r
+ */\r
+extern Uint32  VT_Colour12toN(Uint16 Col12, int Depth);\r
+\r
+/**\r
+ * \brief Handlers for eTplVideo_2DCommands\r
+ */\r
+typedef struct sDrvUtil_Video_2DHandlers\r
+{\r
+       /**\r
+        * \brief No Operation, Ignored\r
+        * \see VIDEO_2DOP_NOP\r
+        */\r
+       void    *Nop;\r
+       /**\r
+        * \brief Fill a buffer region\r
+        * \param X     Lefthand edge\r
+        * \param Y     Top edge\r
+        * \param W     Width\r
+        * \param H     Height\r
+        * \param Colour        Colour to fill with\r
+        * \see VIDEO_2DOP_FILL\r
+        */\r
+       void    (*Fill)(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colour);\r
+       /**\r
+        * \brief Fill a buffer region\r
+        * \param DestX Lefthand edge of destination\r
+        * \param DestY Top edge of destination\r
+        * \param SrcX  Lefthand edge of source\r
+        * \param SrcY  Top edge of source\r
+        * \param W     Width\r
+        * \param H     Height\r
+        * \see VIDEO_2DOP_BLIT\r
+        */\r
+       void    (*Blit)(void *Ent, Uint16 DestX, Uint16 DestY, Uint16 SrcX, Uint16 SrcY, Uint16 W, Uint16 H);\r
+}      tDrvUtil_Video_2DHandlers;\r
+\r
+/**\r
+ * \brief Handle a 2D operation stream for a driver\r
+ * \param Ent  Value to pass to handlers\r
+ * \param Buffer       Stream buffer\r
+ * \param Length       Length of stream\r
+ * \param Handlers     Handlers to use for the stream\r
+ * \param SizeofHandlers       Size of \a tDrvUtil_Video_2DHandlers according\r
+ *        to the driver. Used as version control and error avoidence.\r
+ */\r
+extern Uint64  DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,\r
+       tDrvUtil_Video_2DHandlers *Handlers, int SizeofHandlers);\r
 \r
 #endif\r

UCC git Repository :: git.ucc.asn.au