graphics/traveler: No longer supports single user graphics mode.

This commit is contained in:
Gregory Nutt 2017-10-14 11:51:58 -06:00
parent 5f7fa0350f
commit fda6713854
6 changed files with 15 additions and 179 deletions

View File

@ -727,26 +727,6 @@ examples/json
on 2011-10-10 so I presume that the code is stable and there is no risk
of maintaining duplicate logic in the NuttX repository.
examples/lcdrw
^^^^^^^^^^^^^^
This example may be used to verify if you can or cannot read data
correctly from an LCD interface. At present, this supports only LCDs
with RGB565 color format.
* CONFIG_EXAMPLES_LDCRW_DEVNO
LCD device number. Default: 0
* CONFIG_EXAMPLES_LDCRW_XRES
LCD X resolution. Default: 240
* CONFIG_EXAMPLES_LDCRW_YRES
LCD Y resolution. Default: 320
NOTE: This test exercises internal lcd driver interfaces. As such, it
relies on internal OS interfaces that are not normally available to a
user-space program. As a result, this example cannot be used if a
NuttX is built as a protected, supervisor kernel (CONFIG_BUILD_PROTECTED
or CONFIG_BUILD_KERNEL).
examples/leds
^^^^^^^^^^^^
This is a simple test of the board LED driver at nuttx/drivers/leds/userled_*.c.

View File

@ -7,14 +7,13 @@ config GRAPHICS_TRAVELER
bool "Traveler game"
default n
select FSUTILS_INIFILE
depends on NX_MULTIUSER
---help---
Enable or disable the graphic Traveler game
if GRAPHICS_TRAVELER
if NX_MULTIUSER
comment "Multi-User Configuration Options"
comment "NX Server Configuration Options"
config GRAPHICS_TRAVELER_STACKSIZE
int "Listener Stack Size"
@ -34,8 +33,6 @@ config GRAPHICS_TRAVELER_CLIENTPRIO
---help---
The client priority. Default: 100
endif # NX_MULTIUSER
comment "Color configuration"
choice

View File

@ -68,10 +68,7 @@ endif
MAINSRC = trv_main.c
ifeq ($(CONFIG_NX),y)
CSRCS += trv_nxbkgd.c
ifeq ($(CONFIG_NX_MULTIUSER),y)
CSRCS += trv_nxlistener.c
endif
CSRCS += trv_nxbkgd.c trv_nxlistener.c
endif
AOBJS = $(ASRCS:.S=$(OBJEXT))

View File

@ -109,10 +109,8 @@ struct trv_graphics_info_s
extern FAR const struct nx_callback_s *g_trv_nxcallback;
extern sem_t g_trv_nxevent;
extern volatile bool g_trv_nxresolution;
#ifdef CONFIG_NX_MULTIUSER
extern volatile bool g_trv_nxrconnected;
#endif
#endif
/****************************************************************************
* Public Function Prototypes
@ -123,9 +121,6 @@ void trv_graphics_terminate(FAR struct trv_graphics_info_s *ginfo);
trv_pixel_t trv_graphics_index2pixel(int index);
void trv_display_update(struct trv_graphics_info_s *fb);
trv_pixel_t *trv_get_renderbuffer(uint16_t width, uint16_t height);
#ifdef CONFIG_NX_MULTIUSER
FAR void *trv_nxlistener(FAR void *arg);
#endif
#endif /* __APPS_GRAPHICS_TRAVELER_INCLUDE_TRV_GRAPHICS_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/graphics/traveler/src/trv_graphics.c
*
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -45,12 +45,9 @@
#include "trv_debug.h"
#include "trv_graphics.h"
#include <sys/boardctl.h>
#include <string.h>
#ifdef CONFIG_NX_MULTIUSER
# include <sys/boardctl.h>
# include <semaphore.h>
#endif
#include <semaphore.h>
#ifdef CONFIG_VNCSERVER
# include <nuttx/video/vnc.h>
@ -64,98 +61,13 @@
FAR const struct nx_callback_s *g_trv_nxcallback;
sem_t g_trv_nxevent = SEM_INITIZIALIZER(0);
bool g_trv_nxresolution = false;
#ifdef CONFIG_NX_MULTIUSER
bool g_trv_nxrconnected = false;
#endif
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: trv_get_fbdev
*
* Description:
* Get the system framebuffer device
*
****************************************************************************/
#ifndef CONFIG_NX_MULTIUSER
static FAR struct fb_vtable_s *trv_get_fbdev(void)
{
FAR struct fb_vtable_s *fbdev;
int ret;
/* Initialize the frame buffer device */
ret = up_fbinitialize(0);
if (ret < 0)
{
trv_abort("ERROR: up_fbinitialize() failed: %d\n", -ret);
}
/* Set up to use video plane 0. There is no support for anything but
* video plane 0.
*/
fbdev = up_fbgetvplane(0,0);
if (!fbdev)
{
trv_abort("ERROR: up_fbgetvplane() failed\n");
}
return fbdev;
}
#endif
/****************************************************************************
* Name: trv_fb_initialize
*
* Description:
* Get the system framebuffer device
*
****************************************************************************/
#if !defined(CONFIG_NX_MULTIUSER) && !defined(CONFIG_NX)
static void trv_fb_initialize(FAR struct trv_graphics_info_s *ginfo)
{
struct fb_videoinfo_s vinfo;
struct fb_planeinfo_s pinfo;
FAR struct fb_vtable_s *fbdev;
int ret;
/* Get the framebuffer device */
fbdev = trv_get_fbdev();
/* Get information about video plane 0 */
ret = fbdev->getvideoinfo(fbdev, &vinfo);
if (ret < 0)
{
trv_abort("ERROR: getvideoinfo() failed\n");
}
ginfo->xres = vinfo.xres;
ginfo->yres = vinfo.yres;
ret = fbdev->getplaneinfo(fbdev, 0, &pinfo);
if (ret < 0)
{
trv_abort("ERROR: getplaneinfo() failed\n");
}
ginfo->stride = pinfo.stride;
ginfo->hwbuffer = pinfo.fbmem;
if (vinfo.fmt != TRV_COLOR_FMT || pinfo.bpp != TRV_BPP)
{
trv_abort("ERROR: Bad color format(%d)/bpp(%d)\n", vinfo.fmt, pinfo.bpp);
}
}
#endif
/****************************************************************************
* Name: trv_use_bgwindow
*
@ -187,50 +99,11 @@ static void trv_use_bgwindow(FAR struct trv_graphics_info_s *ginfo)
#endif
/****************************************************************************
* Name: trv_nxsu_initialize
* Name: trv_nx_initialize
****************************************************************************/
#if defined(CONFIG_NX) && !defined(CONFIG_NX_MULTIUSER)
static inline int trv_nxsu_initialize(FAR struct trv_graphics_info_s *ginfo)
{
FAR struct fb_vtable_s *fbdev;
int ret;
/* Get the framebuffer device */
fbdev = trv_get_fbdev();
/* Open NX */
ginfo->hnx = nx_open(fbdev);
if (!ginfo->hnx)
{
trv_abort("trv_nxsu_initialize: nx_open failed: %d\n", errno);
}
#ifdef CONFIG_VNCSERVER
/* Setup the VNC server to support keyboard/mouse inputs */
ret = vnc_default_fbinitialize(0, ginfo->hnx);
if (ret < 0)
{
nx_close(ginfo->hnx);
trv_abort("vnc_default_fbinitialize failed: %d\n", ret);
}
#endif
/* And use the background window */
trv_use_bgwindow(ginfo);
}
#endif
/****************************************************************************
* Name: trv_nxmu_initialize
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
static inline int trv_nxmu_initialize(FAR struct trv_graphics_info_s *ginfo)
#ifdef CONFIG_NX
static inline int trv_nx_initialize(FAR struct trv_graphics_info_s *ginfo)
{
struct sched_param param;
pthread_t thread;
@ -242,16 +115,16 @@ static inline int trv_nxmu_initialize(FAR struct trv_graphics_info_s *ginfo)
ret = sched_setparam(0, &param);
if (ret < 0)
{
trv_abort("trv_nxmu_initialize: sched_setparam failed: %d\n" , ret);
trv_abort("trv_nx_initialize: sched_setparam failed: %d\n" , ret);
}
/* Start the NX server kernel thread */
printf("trv_nxmu_initialize: Starting NX server\n");
printf("trv_nx_initialize: Starting NX server\n");
ret = boardctl(BOARDIOC_NX_START, 0);
if (ret < 0)
{
trv_abort("trv_nxmu_initialize: Failed to start the NX server: %d\n",
trv_abort("trv_nx_initialize: Failed to start the NX server: %d\n",
errno);
}
@ -312,7 +185,7 @@ static inline int trv_nxmu_initialize(FAR struct trv_graphics_info_s *ginfo)
trv_use_bgwindow(ginfo);
}
#endif
#endif /* CONFIG_NX */
/****************************************************************************
* Name: trv_row_update
@ -386,10 +259,8 @@ int trv_graphics_initialize(FAR struct trv_graphics_info_s *ginfo)
#if !defined(CONFIG_NX)
trv_fb_initialize(ginfo);
#elif defined(CONFIG_NX_MULTIUSER)
trv_nxmu_initialize(ginfo);
#else
trv_nxsu_initialize(ginfo);
trv_nx_initialize(ginfo);
#endif
/* Check the size of the display */

View File

@ -2,7 +2,7 @@
* apps/graphics/traveler/trv_nxlistener.c
* NX listener logic
*
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -46,8 +46,6 @@
#include <nuttx/nx/nx.h>
#ifdef CONFIG_NX_MULTIUSER
/****************************************************************************
* Public Functions
****************************************************************************/
@ -92,5 +90,3 @@ FAR void *trv_nxlistener(FAR void *arg)
}
}
}
#endif /* CONFIG_NX_MULTIUSER */