configs/same70-xplained/twm4nx/defconfig: Switch to 8BPP. That is the negotiated size requested by the VNC client anyway. graphics/vnc/server/vnc_color.c: Fix an error in color conversion.

This commit is contained in:
Gregory Nutt
2019-05-03 17:06:30 -06:00
parent cacf18fa7b
commit 8130038fb0
5 changed files with 30 additions and 21 deletions
+5 -15
View File
@@ -8,8 +8,7 @@
# CONFIG_ARCH_RAMFUNCS is not set
# CONFIG_MMCSD_MMCSUPPORT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_NXTK_DEFAULT_BORDERCOLORS is not set
# CONFIG_NX_DISABLE_16BPP is not set
# CONFIG_NX_DISABLE_8BPP is not set
# CONFIG_SAMV7_UART0 is not set
# CONFIG_SAMV7_UART2 is not set
# CONFIG_SAMV7_UART4 is not set
@@ -60,7 +59,7 @@ CONFIG_NETDEV_STATISTICS=y
CONFIG_NETUTILS_TELNETD=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_PKTSIZE=1514
CONFIG_NET_ETH_PKTSIZE=870
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_SOCKOPTS=y
@@ -79,17 +78,7 @@ CONFIG_NXTERM_CACHESIZE=32
CONFIG_NXTERM_CURSORCHAR=95
CONFIG_NXTERM_MXCHARS=325
CONFIG_NXTERM_NXKBDIN=y
CONFIG_NXTK_BORDERCOLOR1=0x5cb7
CONFIG_NXTK_BORDERCOLOR2=0x21c9
CONFIG_NXTK_BORDERCOLOR3=0xffdf
CONFIG_NXWIDGETS_BPP=16
CONFIG_NXWIDGETS_CUSTOM_EDGECOLORS=y
CONFIG_NXWIDGETS_CUSTOM_FILLCOLORS=y
CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR=0x9dfb
CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR=0xc618
CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR=0xd73e
CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR=0x21e9
CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR=0xffdf
CONFIG_NXWIDGETS_BPP=8
CONFIG_NXWIDGETS_SIZEOFCHAR=1
CONFIG_NX_BLOCKING=y
CONFIG_NX_KBD=y
@@ -132,8 +121,9 @@ CONFIG_TWM4NX_ARCHINIT=y
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USER_ENTRYPOINT="twm4nx_main"
CONFIG_VNCSERVER=y
CONFIG_VNCSERVER_COLORFMT_RGB8=y
CONFIG_VNCSERVER_PRIO=120
CONFIG_VNCSERVER_SCREENHEIGHT=600
CONFIG_VNCSERVER_SCREENWIDTH=800
CONFIG_VNCSERVER_UPDATER_PRIO=120
CONFIG_VNCSERVER_UPDATE_BUFSIZE=2048
CONFIG_VNCSERVER_UPDATE_BUFSIZE=800
+19 -2
View File
@@ -112,8 +112,25 @@ config VNCSERVER_UPDATE_BUFSIZE
example, an update buffers of 32 pixels at 8-bits per pixel and
32-rows would yield a buffer size of 1024!
Ideally, this buffer should fit in one network packet to avoid
accessive re-assembly of partial TCP packets.
There is a very strong interaction with this setting and the network MTU.
Ideally, this buffer should fit in one network packet to avoid accessive
re-assembly of partial TCP packets.
REVISIT: In fact, if the buffer does not fit in one network packet,
then there appears to be reliability issues in the connection. I am
not sure why that is; TCP is a stream so it should not matter how
many packets are in a transfer.
Example: Negotiated pixel depth = 8 BPP, window width = 800 pixels.
CONFIG_VNCSERVER_UPDATE_BUFSIZE needs to be the payload size (MSS)
of the transfer or 800 bytes. The MTU is then:
MSS = MTU - sizeof(IP Header) - sizeof(VNC FramebufferUpdate Header)
For IPv4, the IP Header is 20 bytes; 40 bytes for IPv6. The
FramebufferUpdate header is 16 bytes so. The desired MSS is 800 bytes
so MTU = 836 or 856. For Ethernet, this is a total packet size of 870
bytes.
config VNCSERVER_KBDENCODE
bool "Encode keyboard input"
+1 -1
View File
@@ -155,7 +155,7 @@ uint8_t vnc_convert_rgb8_332(lfb_color_t rgb)
* RRRGGGBB
*/
return (uint8_t)(((rgb >> 8) & 0x0070) |
return (uint8_t)(((rgb >> 8) & 0x00e0) |
((rgb >> 6) & 0x001c) |
((rgb >> 3) & 0x0003));
}
+4 -2
View File
@@ -164,7 +164,8 @@ static size_t vnc_copy16(FAR struct vnc_session_s *session,
/* Source rectangle start address (left/top)*/
srcleft = (FAR lfb_color_t *)(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
srcleft = (FAR lfb_color_t *)
(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
/* Transfer each row from the source buffer into the update buffer */
@@ -235,7 +236,8 @@ static size_t vnc_copy32(FAR struct vnc_session_s *session,
/* Source rectangle start address (left/top)*/
srcleft = (FAR lfb_color_t *)(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
srcleft = (FAR lfb_color_t *)
(session->fb + RFB_STRIDE * row + RFB_BYTESPERPIXEL * col);
/* Transfer each row from the source buffer into the update buffer */