changeset 1332:2c334e9015ab

Add 32 bit (0/8/8/8) pixel support
author gthomas
date Fri, 24 Oct 2003 19:06:12 +0000
parents 22c47e969126
children 0e2485da1dbc
files packages/net/vnc_server/current/ChangeLog packages/net/vnc_server/current/cdl/vnc-server.cdl packages/net/vnc_server/current/include/vnc-server.h packages/net/vnc_server/current/src/vnc-server.c packages/net/vnc_server/current/tests/vnc-test.c packages/services/gfx/mw/current/ChangeLog packages/services/gfx/mw/current/src/drivers/scr_vnc_ecos.c
diffstat 7 files changed, 105 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/vnc_server/current/ChangeLog
+++ b/packages/net/vnc_server/current/ChangeLog
@@ -1,19 +1,25 @@
+2003-10-24  Gary Thomas  <gary@mlbassoc.com>
+
+	* tests/vnc-test.c: 
+	* src/vnc-server.c: 
+	* include/vnc-server.h: 
+	* cdl/vnc-server.cdl: Add support for 32 bit framebufer (0/8/8/8)
+
 2003-09-16  Chris Garry  <cgarry@sweeneydesign.co.uk>
 
-    * doc/vnc-server.html:
-    * src/vnc-server.c:
-    * include/vnc-server.h:
-    Added new function VncCopyBuffer2RectMask().
+	* doc/vnc-server.html:
+	* src/vnc-server.c:
+	* include/vnc-server.h:
+	Added new function VncCopyBuffer2RectMask().
 
-    * tests/vnc-test.c:
-    Modifed to include a cursor.
+	* tests/vnc-test.c:
+	Modifed to include a cursor.
 
 2003-09-02  Chris Garry  <cgarry@sweeneydesign.co.uk>
 
-    * tests/vnc-test.c:
-    * doc/vnc-server.html:
-    Modified for new BGR233 mode.
-
+	* tests/vnc-test.c:
+	* doc/vnc-server.html:
+	Modified for new BGR233 mode.
 
 2003-09-01  Gary Thomas  <gary@mlbassoc.com>
 
@@ -24,20 +30,20 @@ 2003-09-01  Gary Thomas  <gary@mlbassoc.
 
 2003-08-31  Chris Garry  <cgarry@sweeneydesign.co.uk>
 
-    * src/vnc-server.c:
-    Always send colour data to client in big endian format.
-    When doing frame updates, do not call send command until there
-    if 1460 bytes of data unless the data is all that is left for the
-    cuurent frame update (huge improvement with lwIP stack).
-    Fixed bug where VncPrintf() did not handle characters not defined
-    for the selected font.
-    VncPrintf() does not mark tiles for update when do_print argument
-    is not set.
-    
-    * tests/vnc-test.c:
-    Modifed the test to use select() function.  Added more examples
-    of using the VNC server API.
-    
+	* src/vnc-server.c:
+	Always send colour data to client in big endian format.
+	When doing frame updates, do not call send command until there
+	if 1460 bytes of data unless the data is all that is left for the
+	cuurent frame update (huge improvement with lwIP stack).
+	Fixed bug where VncPrintf() did not handle characters not defined
+	for the selected font.
+	VncPrintf() does not mark tiles for update when do_print argument
+	is not set.
+	
+	* tests/vnc-test.c:
+	Modifed the test to use select() function.  Added more examples
+	of using the VNC server API.
+	
 2003-08-22  Chris Garry  <cgarry@sweeneydesign.co.uk>
 
 	* tests/vnc-test.c: 
--- a/packages/net/vnc_server/current/cdl/vnc-server.cdl
+++ b/packages/net/vnc_server/current/cdl/vnc-server.cdl
@@ -196,6 +196,14 @@ cdl_package CYGPKG_VNC_SERVER {
             implements CYGNUM_VNC_SERVER_PIXEL_SELECTED
             description "This selects 16-bit, RGB565 pixel format."
         }
+
+        cdl_option CYGNUM_VNC_SERVER_PIXEL_TRUECOLOR0888 {
+            display     "True Color pixel format (32-bit)"
+            flavor bool
+            default_value 0
+            implements CYGNUM_VNC_SERVER_PIXEL_SELECTED
+            description "This selects 32-bit, TRUECOLOR0888 pixel format."
+        }
         
         cdl_option CYGNUM_VNC_SERVER_INCLUDE_VNC_PRINTF {
             display "Include VncPrintf() function"
--- a/packages/net/vnc_server/current/include/vnc-server.h
+++ b/packages/net/vnc_server/current/include/vnc-server.h
@@ -64,6 +64,7 @@ typedef struct
     bool       rgb555;
     bool       rgb565;
     bool       bgr233;
+    bool       truecolor0888;
 } vnc_frame_format_t;
 
 
@@ -101,6 +102,9 @@ typedef cyg_uint8 vnc_colour_t;
 #elif defined(CYGNUM_VNC_SERVER_PIXEL_RGB555) || defined(CYGNUM_VNC_SERVER_PIXEL_RGB565)
 typedef cyg_uint16 vnc_color_t;
 typedef cyg_uint16 vnc_colour_t;
+#elif defined(CYGNUM_VNC_SERVER_PIXEL_TRUECOLOR0888)
+typedef cyg_uint32 vnc_color_t;
+typedef cyg_uint32 vnc_colour_t;
 #else
 #error "Unsupported color model"
 #endif
@@ -148,6 +152,11 @@ vnc_printf_return_t VncPrintf(MWCFONT* f
                                        |((((cyg_uint8)g)&0xFC) << 3)  \
                                        |((((cyg_uint8)b)&0xF8) >> 3))
 #endif
+#ifdef CYGNUM_VNC_SERVER_PIXEL_TRUECOLOR0888
+#define VNC_RGB2COL(r,g,b) (vnc_colour_t)(((((cyg_uint8)r)&0xFF) << 16)  \
+                                       |((((cyg_uint8)g)&0xFF) << 8)  \
+                                       |((((cyg_uint8)b)&0xFF) << 0))
+#endif
 
 
 /* 16 defined colours for application use */
--- a/packages/net/vnc_server/current/src/vnc-server.c
+++ b/packages/net/vnc_server/current/src/vnc-server.c
@@ -127,6 +127,17 @@ void lwip_init(void);
 #define BLUE_SHIFT          0
 #endif
 
+#ifdef CYGNUM_VNC_SERVER_PIXEL_TRUECOLOR0888
+#define BITS_PER_PIXEL      32     /* Bits per pixel */
+#define PIXEL_DEPTH         24     /* Usefull bits per pixel */
+#define RED_MAX             255
+#define GREEN_MAX           255
+#define BLUE_MAX            255
+#define RED_SHIFT           16
+#define GREEN_SHIFT         8
+#define BLUE_SHIFT          0
+#endif
+
 /* Client to Server message types */
 #define SET_PIXEL_FORMAT         0
 #define FIX_COLOUR_MAP_ENTRIES   1
@@ -242,10 +253,16 @@ vnc_frame_format_t frame_format = {CYGNU
                                    0,
 #endif
 #ifdef CYGNUM_VNC_SERVER_PIXEL_BGR233
-                                   1};
+                                   1,
 #else
-                                   0};
+                                   0,
 #endif
+#ifdef CYGNUM_VNC_SERVER_PIXEL_TRUECOLOR0888
+                                   1,
+#else
+                                   0,
+#endif
+};
 
 
 /* Structure to hold the encoding type details */
--- a/packages/net/vnc_server/current/tests/vnc-test.c
+++ b/packages/net/vnc_server/current/tests/vnc-test.c
@@ -152,6 +152,10 @@ int main()
     {
         VncPrintf(0, 1, VNC_BLACK, 1, 345, "Pixel format: BGR233");
     }
+    else if (display_info->truecolor0888)
+    {
+        VncPrintf(0, 1, VNC_BLACK, 1, 345, "Pixel format: TrueColor0888");
+    }
     else
     {
         VncPrintf(0, 1, VNC_BLACK, 1, 345, "Pixel format: Unknown");
--- a/packages/services/gfx/mw/current/ChangeLog
+++ b/packages/services/gfx/mw/current/ChangeLog
@@ -1,5 +1,7 @@
 2003-10-24  Gary Thomas  <gary@mlbassoc.com>
 
+	* src/drivers/scr_vnc_ecos.c: Support true color (32 bit) 0888 format.
+
 	* src/demos/nanox/ntetris.c (main): Start with a good known
 	state (by zeroing) - otherwise, the results are unpredictable
 	and often crash.
@@ -15,10 +17,10 @@ 2003-09-03  Gary Thomas  <gary@mlbassoc.
 
 2003-09-01  Chris Garry <cgarry@sweeneydesign.co.uk>
 
-    * src/ecos/ecos_app.c:
-    * src/ecos/ecos_init.c:
-    Do not use ARM display hardware setup routines when VNC server
-    drivers are used.
+	* src/ecos/ecos_app.c:
+	* src/ecos/ecos_init.c:
+	Do not use ARM display hardware setup routines when VNC server
+	drivers are used.
 
 2003-09-01  Gary Thomas  <gary@mlbassoc.com>
 
@@ -55,27 +57,27 @@ 2003-08-30  Gary Thomas  <gary@mlbassoc.
 
 2003-08-22  Chris Garry <cgarry@sweeneydesign.co.uk>
 
-    * cdl/microwindows.cdl
-    Added support for VNC server.
-    
-    * src/include/device.h:
-    Remove COLOR2PIXEL555 hack for strongarm lcd when VNC server screen
-    driver is used.
-    
-    * src/nanox/clientfb.c:
-    Removed assumption that CYGPKG_HAL_ARM means target is a strongarm
-    lcd when VNC server is used.
-    
-    * src/drivers/kbd_vnc_ecos.c:
-    * src/drivers/mou_vnc_ecos.c:
-    * src/drivers/scr_vnc_ecos.c:
-    New keyboard, mouse and screen drivers for VNC server.
+	* cdl/microwindows.cdl
+	Added support for VNC server.
+	
+	* src/include/device.h:
+	Remove COLOR2PIXEL555 hack for strongarm lcd when VNC server screen
+	driver is used.
+	
+	* src/nanox/clientfb.c:
+	Removed assumption that CYGPKG_HAL_ARM means target is a strongarm
+	lcd when VNC server is used.
+	
+	* src/drivers/kbd_vnc_ecos.c:
+	* src/drivers/mou_vnc_ecos.c:
+	* src/drivers/scr_vnc_ecos.c:
+	New keyboard, mouse and screen drivers for VNC server.
 
 2003-07-21  Chris Garry <cgarry@sweeneydesign.co.uk>
 
-    * src/nanox/client.c
-    Set the length field in the sockaddr_in structure name before
-    trying to connect to the server.
+	* src/nanox/client.c
+	Set the length field in the sockaddr_in structure name before
+	trying to connect to the server.
 
 2003-06-13  Jonathan Larmour  <jifl@eCosCentric.com>
 
--- a/packages/services/gfx/mw/current/src/drivers/scr_vnc_ecos.c
+++ b/packages/services/gfx/mw/current/src/drivers/scr_vnc_ecos.c
@@ -183,6 +183,12 @@ static PSD vnc_open(PSD psd)
         psd->ncolors = 0xFF + 1;
         psd->pixtype = MWPF_TRUECOLOR233;
     }
+    else if (frame_format->truecolor0888)
+    {
+        psd->bpp = 32;
+        psd->ncolors = 0xFFFFFF + 1;
+        psd->pixtype = MWPF_TRUECOLOR0888;
+    }
     else
     {
         EPRINTF("Unsupported display type\n");
@@ -250,6 +256,11 @@ static void vnc_getscreeninfo(PSD psd,PM
         psi->gmask = 0x07e0;
         psi->bmask = 0x001f;
         break;
+    case MWPF_TRUECOLOR0888:
+        psi->rmask = 0xFF0000;
+        psi->gmask = 0x00FF00;
+        psi->bmask = 0x0000FF;
+        break;
     default:
         printf("%s - unsupported pixtype\n", __FUNCTION__);
         psi->rmask = 0xff;