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
+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));
}
+1 -1
View File
@@ -651,4 +651,4 @@ void vnc_kbdout(FAR void *arg, uint8_t nch, FAR const uint8_t *ch)
(void)nx_kbdin((NXHANDLE)arg, nch, ch);
}
#endif /* CONFIG_NX_KBD */
#endif /* CONFIG_NX_KBD */
+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 */