mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
video/vnc: add vnc_fb_register
To optimize the initialization of vnc, change it to vnc_fb_register. Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
This commit is contained in:
parent
82acf6e6a7
commit
62a4799409
8 changed files with 225 additions and 184 deletions
|
|
@ -41,6 +41,10 @@
|
|||
|
||||
#include "nxmu.h"
|
||||
|
||||
#ifdef CONFIG_VNCSERVER
|
||||
# include <nuttx/video/vnc.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
|
@ -108,6 +112,22 @@ static int nx_server(int argc, char *argv[])
|
|||
dev->setpower(dev, ((3 * CONFIG_LCD_MAXPOWER + 3) / 4));
|
||||
|
||||
#else /* CONFIG_NX_LCDDRIVER */
|
||||
# ifdef CONFIG_VNCSERVER
|
||||
/* Initialize the VNC server */
|
||||
int display;
|
||||
|
||||
/* Get display parameters from the command line */
|
||||
|
||||
display = atoi(argv[1]);
|
||||
|
||||
ret = vnc_fb_register(display);
|
||||
if (ret < 0)
|
||||
{
|
||||
gerr("ERROR: vnc_fb_register() failed: %d\n", ret);
|
||||
}
|
||||
|
||||
# else /* CONFIG_VNCSERVER */
|
||||
|
||||
/* Initialize the frame buffer device. */
|
||||
|
||||
int display;
|
||||
|
|
@ -132,6 +152,7 @@ static int nx_server(int argc, char *argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
# endif /* CONFIG_VNCSERVER */
|
||||
#endif /* CONFIG_NX_LCDDRIVER */
|
||||
|
||||
/* Then start the server (nx_run does not normally return) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue