Merged nuttx/nuttx into master

This commit is contained in:
ziggurat29 2016-04-17 21:23:50 -05:00
commit 655d51c346
22 changed files with 278 additions and 128 deletions

View File

@ -1013,6 +1013,7 @@ static int dm320_getvid0planeinfo(FAR struct fb_vtable_s *vtable, int planeno,
pinfo->fbmem = g_vid0base;
pinfo->fblen = DM320_VID0_FBLEN;
pinfo->stride = DM320_VID0_STRIDE;
pinfo->display = 0;
pinfo->bpp = DM320_VID0_BPP;
return OK;
}
@ -1059,6 +1060,7 @@ static int dm320_getvid1planeinfo(FAR struct fb_vtable_s *vtable, int planeno,
pinfo->fbmem = g_vid1base;
pinfo->fblen = DM320_VID1_FBLEN;
pinfo->stride = DM320_VID1_STRIDE;
pinfo->display = 1;
pinfo->bpp = DM320_VID1_BPP;
return OK;
}
@ -1109,6 +1111,7 @@ static int dm320_getosd0planeinfo(FAR struct fb_vtable_s *vtable, int planeno,
pinfo->fbmem = g_osd0base;
pinfo->fblen = DM320_OSD0_FBLEN;
pinfo->stride = DM320_OSD0_STRIDE;
pinfo->display = 2;
pinfo->bpp = DM320_OSD0_BPP;
return OK;
}
@ -1159,6 +1162,7 @@ static int dm320_getosd1planeinfo(FAR struct fb_vtable_s *vtable, int planeno,
pinfo->fbmem = g_osd1base;
pinfo->fblen = DM320_OSD1_FBLEN;
pinfo->stride = DM320_OSD1_STRIDE;
pinfo->display = 3;
pinfo->bpp = DM320_OSD1_BPP;
return OK;
}

View File

@ -153,6 +153,7 @@ static const struct fb_planeinfo_s g_planeinfo =
.fbmem = (FAR void *)CONFIG_LPC17_LCD_VRAMBASE,
.fblen = LPC17_FBSIZE,
.stride = LPC17_STRIDE,
.display = 0,
.bpp = LPC17_BPP,
};

View File

@ -1124,7 +1124,8 @@ static int sam_base_getplaneinfo(struct fb_vtable_s *vtable, int planeno,
{
pinfo->fbmem = (void *)LAYER_BASE.framebuffer;
pinfo->fblen = SAMA5_BASE_FBSIZE;
pinfo->stride = SAMA5_BASE_STRIDE,
pinfo->stride = SAMA5_BASE_STRIDE;
pinfo->display = 0;
pinfo->bpp = LAYER_BASE.bpp;
return OK;
}

View File

@ -2057,6 +2057,7 @@ FAR struct dma2d_layer_s *up_dma2dcreatelayer(fb_coord_t width,
pinfo->fbmem = fbmem;
pinfo->fblen = fblen;
pinfo->stride = stride;
pinfo->display = 0;
pinfo->bpp = bpp;
/* Bind the layer to the identifier */

View File

@ -735,6 +735,7 @@ static struct stm32_ltdcdev_s g_ltdc =
.fbmem = (uint8_t *)STM32_LTDC_BUFFER_L1,
.fblen = STM32_L1_FBSIZE,
.stride = STM32_L1_STRIDE,
.display = 0,
.bpp = STM32_LTDC_L1_BPP
},
.vinfo =
@ -761,6 +762,7 @@ static struct stm32_ltdcdev_s g_ltdc =
.fbmem = (uint8_t *)STM32_LTDC_BUFFER_L2,
.fblen = STM32_L2_FBSIZE,
.stride = STM32_L2_STRIDE,
.display = 1,
.bpp = STM32_LTDC_L2_BPP
},
.vinfo =

View File

@ -209,6 +209,7 @@ static const struct lcd_planeinfo_s g_planeinfo =
.putrun = sim_putrun, /* Put a run into LCD memory */
.getrun = sim_getrun, /* Get a run from LCD memory */
.buffer = (FAR uint8_t *)g_runbuffer, /* Run scratch buffer */
.display = 0, /* Display number */
.bpp = CONFIG_SIM_FBBPP, /* Bits-per-pixel */
};

View File

@ -137,6 +137,7 @@ static const struct fb_planeinfo_s g_planeinfo =
.fbmem = (FAR void *)&g_fb,
.fblen = FB_SIZE,
.stride = FB_WIDTH,
.display = 0,
.bpp = CONFIG_SIM_FBBPP,
};
#else

View File

@ -371,6 +371,7 @@ static int vga_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
pinfo->putrun = vga_putrun; /* Put a run into LCD memory */
pinfo->getrun = vga_getrun; /* Get a run from LCD memory */
pinfo->buffer = g_runbuffer; /* Run scratch buffer */
pinfo->display = 0;
pinfo->bpp = VGA_BPP; /* Bits-per-pixel */
return OK;
}

View File

@ -148,7 +148,8 @@ static uint16_t g_runbuffer[LCD_XRES];
/* This structure describes the overall LCD video controller */
static const struct fb_videoinfo_s g_videoinfo =
{ .fmt = LCD_COLORFMT, /* Color format: RGB16-565: RRRR RGGG GGGB BBBB */
{
.fmt = LCD_COLORFMT, /* Color format: RGB16-565: RRRR RGGG GGGB BBBB */
.xres = LCD_XRES, /* Horizontal resolution in pixel columns */
.yres = LCD_YRES, /* Vertical resolutiSend a command list to the LCD panelon in pixel rows */
.nplanes = 1, /* Number of color planes supported */
@ -157,7 +158,8 @@ static const struct fb_videoinfo_s g_videoinfo =
/* This is the standard, NuttX Plane information object */
static const struct lcd_planeinfo_s g_planeinfo =
{ .putrun = lcd_putrun, /* Put a run into LCD memory */
{
.putrun = lcd_putrun, /* Put a run into LCD memory */
// .getrun = lcd_getrun, /* Get a run from LCD memory */
.buffer = (uint8_t*) g_runbuffer, /* Run scratch buffer */
.bpp = LCD_BPP, /* Bits-per-pixel */
@ -166,7 +168,8 @@ static const struct lcd_planeinfo_s g_planeinfo =
/* This is the standard, NuttX LCD driver object */
static struct ssd1783_dev_s g_lcddev =
{ .dev =
{
.dev =
{
/* LCD Configuration */

View File

@ -266,7 +266,7 @@ config RAMMTD_FLASHSIM
RAMMTD_FLASHSIM will add some extra logic to improve the level of
FLASH simulation.
endif
endif # RAMMTD
config FILEMTD
bool "File-based MTD driver"
@ -288,7 +288,7 @@ config FILEMTD_ERASESTATE
hex "Simulated erase state"
default 0xff
endif
endif # FILEMTD
config MTD_AT24XX
bool "I2C-based AT24xx eeprom"
@ -357,7 +357,7 @@ config AT24XX_FREQUENCY
must represent a valid I2C speed (normally less than 400.000) or the driver
might fail.
endif
endif # MTD_AT24XX
config MTD_AT25
bool "SPI-based AT25 FLASH"
@ -374,7 +374,7 @@ config AT25_SPIFREQUENCY
int "AT25 SPI Frequency"
default 20000000
endif
endif # MTD_AT25
config MTD_AT45DB
bool "SPI-based AT45DB flash"
@ -395,7 +395,7 @@ config AT45DB_PWRSAVE
bool "Enable power save"
default n
endif
endif # MTD_AT45DB
config MTD_M25P
bool "SPI-based M25P FLASH"
@ -437,7 +437,7 @@ config M25P_SUBSECTOR_ERASE
size (4K vs 64K). This option enables support for sub-sector erase.
The SMART file system can take advantage of this option if it is enabled.
endif
endif # MTD_M25P
config MTD_S25FL1
bool "QuadSPI-based S25FL1 FLASH"
@ -489,7 +489,7 @@ config S25FL1_SCRAMBLE_KEY
default 0x0baddead
depends on S25FL1_SCRAMBLE
endif
endif # MTD_S25FL1
config MTD_N25QXXX
bool "QuadSPI-based Micron N25QXXX family FLASH"
@ -519,7 +519,7 @@ config N25QXXX_SECTOR512
bool "Simulate 512 byte Erase Blocks"
default n
endif
endif # MTD_N25QXXX
config MTD_SMART
bool "Sector Mapped Allocation for Really Tiny (SMART) Flash support"
@ -583,7 +583,7 @@ config MTD_SMART_CONVERT_WEAR_FORMAT
CRC versions use a different header format and require a mksmartfs on the
device even if an existing format is there.
endif
endif # MTD_SMART_WEAR_LEVEL && !SMART_CRC_16
config MTD_SMART_ENABLE_CRC
bool "Enable Sector CRC error detection"
@ -618,7 +618,7 @@ config SMART_CRC_8
config SMART_CRC_16
bool "CRC-16"
endchoice
endchoice # CRC level selection
config MTD_SMART_MINIMIZE_RAM
bool "Minimize SMART RAM usage using logical sector cache"
@ -706,7 +706,7 @@ config RAMTRON_SETSPEED
Select an option to provide an ioctl, MTDIOC_SETSPEED call that
supports dynamic selection of the RAMTRON bus speed.
endif
endif # MTD_RAMTRON
config MTD_SST25
bool "SPI-based SST25 FLASH"
@ -745,7 +745,7 @@ config SST25_SLOWREAD
bool
default n
endif
endif # MTD_SST25
config MTD_SST25XX
bool "SPI-based SST25XX FLASH (64-MBit and larger)"
@ -781,7 +781,7 @@ config SST25XX_MEMORY_TYPE
The memory type for SST25VF065 series is 0x25, but this can be modified if needed
to support compatible devices from different manufacturers.
endif
endif # MTD_SST25XX
config MTD_SST39FV
bool "SST39FV NOR FLASH"
@ -800,7 +800,7 @@ config SST39VF_BASE_ADDRESS
---help---
This is the address where the SST29VF FLASH can be found in memory.
endif
endif # MTD_SST39FV
config MTD_W25
bool "SPI-based W25 FLASH"
@ -829,4 +829,4 @@ config W25_SLOWREAD
bool
default n
endif
endif # MTD_W25

View File

@ -3,7 +3,7 @@
# These driver supports various Memory Technology Devices (MTD) using the
# NuttX MTD interface.
#
# Copyright (C) 2009-2013, 2015 Gregory Nutt. All rights reserved.
# Copyright (C) 2009-2013, 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without

View File

@ -2,7 +2,7 @@
* drivers/mtd/n25qxxx.c
* Driver for QuadSPI-based N25QxxxA
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: dev@ziggurat29.com
*
* Redistribution and use in source and binary forms, with or without
@ -59,6 +59,7 @@
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Configuration ********************************************************************/
/* QuadSPI Mode. Per data sheet, either Mode 0 or Mode 3 may be used. */
@ -66,23 +67,22 @@
# define CONFIG_N25QXXX_QSPIMODE QSPIDEV_MODE0
#endif
/* QuadSPI Frequency per data sheet::
*
/* QuadSPI Frequency per data sheet:
*
* In this implementation, only "Quad" reads are performed.
*/
#ifndef CONFIG_N25QXXX_QSPI_FREQUENCY
/* if you haven't specified frequency, default to 40 MHz which will work with all
commands.
/* If you haven't specified frequency, default to 40 MHz which will work with all
* commands.
*/
# define CONFIG_N25QXXX_QSPI_FREQUENCY 40000000
#endif
#ifndef CONFIG_N25QXXX_DUMMIES
/* if you haven't specified the number of dummy cycles for quad reads, provide a
reasonable default. The actual number of dummies needed is clock and IO command
dependent.
/* If you haven't specified the number of dummy cycles for quad reads, provide a
* reasonable default. The actual number of dummies needed is clock and IO command
* dependent.
*/
# define CONFIG_N25QXXX_DUMMIES 6
#endif
@ -175,10 +175,11 @@
/* Chip Geometries ******************************************************************/
/* All members of the family support uniform 4K-byte 'sub sectors'; they also support
64k (and sometimes 32k) 'sectors' proper, but we won't be using those here.
* 64k (and sometimes 32k) 'sectors' proper, but we won't be using those here.
*/
/* N25Q016 (2 MB) memory capacity */
#define N25Q016_SECTOR_SIZE (4*1024)
#define N25Q016_SECTOR_SHIFT (12)
#define N25Q016_SECTOR_COUNT (512)
@ -186,6 +187,7 @@
#define N25Q016_PAGE_SHIFT (8)
/* N25Q032 (4 MB) memory capacity */
#define N25Q032_SECTOR_SIZE (4*1024)
#define N25Q032_SECTOR_SHIFT (12)
#define N25Q032_SECTOR_COUNT (1024)
@ -193,6 +195,7 @@
#define N25Q032_PAGE_SHIFT (8)
/* N25Q064 (8 MB) memory capacity */
#define N25Q064_SECTOR_SIZE (4*1024)
#define N25Q064_SECTOR_SHIFT (12)
#define N25Q064_SECTOR_COUNT (2048)
@ -200,6 +203,7 @@
#define N25Q064_PAGE_SHIFT (8)
/* N25Q128 (16 MB) memory capacity */
#define N25Q128_SECTOR_SIZE (4*1024)
#define N25Q128_SECTOR_SHIFT (12)
#define N25Q128_SECTOR_COUNT (4096)
@ -207,6 +211,7 @@
#define N25Q128_PAGE_SHIFT (8)
/* N25Q256 (32 MB) memory capacity */
#define N25Q256_SECTOR_SIZE (4*1024)
#define N25Q256_SECTOR_SHIFT (12)
#define N25Q256_SECTOR_COUNT (8196)
@ -214,6 +219,7 @@
#define N25Q256_PAGE_SHIFT (8)
/* N25Q512 (64 MB) memory capacity */
#define N25Q512_SECTOR_SIZE (4*1024)
#define N25Q512_SECTOR_SHIFT (12)
#define N25Q512_SECTOR_COUNT (16384)
@ -221,6 +227,7 @@
#define N25Q512_PAGE_SHIFT (8)
/* N25Q00 (128 MB) memory capacity */
#define N25Q00_SECTOR_SIZE (4*1024)
#define N25Q00_SECTOR_SHIFT (12)
#define N25Q00_SECTOR_COUNT (32768)
@ -335,10 +342,6 @@ static ssize_t n25qxxx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
FAR uint8_t *buffer);
static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg);
/************************************************************************************
* Private Data
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
@ -354,15 +357,16 @@ static void n25qxxx_lock(FAR struct qspi_dev_s *qspi)
* transfers. The bus should be locked before the chip is selected.
*
* This is a blocking call and will not return until we have exclusive access to
* the QuadSPI buss. We will retain that exclusive access until the bus is unlocked.
* the QuadSPI buss. We will retain that exclusive access until the bus is
* unlocked.
*/
(void)QSPI_LOCK(qspi, true);
/* After locking the QuadSPI bus, the we also need call the setfrequency, setbits, and
* setmode methods to make sure that the QuadSPI is properly configured for the device.
* If the QuadSPI buss is being shared, then it may have been left in an incompatible
* state.
/* After locking the QuadSPI bus, the we also need call the setfrequency, setbits,
* and setmode methods to make sure that the QuadSPI is properly configured for
* the device. If the QuadSPI buss is being shared, then it may have been left in
* an incompatible state.
*/
QSPI_SETMODE(qspi, CONFIG_N25QXXX_QSPIMODE);
@ -584,31 +588,37 @@ static inline int n25qxxx_readid(struct n25qxxx_dev_s *priv)
priv->pageshift = N25Q016_PAGE_SHIFT;
priv->nsectors = N25Q016_SECTOR_COUNT;
break;
case N25Q032_JEDEC_CAPACITY:
priv->sectorshift = N25Q032_SECTOR_SHIFT;
priv->pageshift = N25Q032_PAGE_SHIFT;
priv->nsectors = N25Q032_SECTOR_COUNT;
break;
case N25Q064_JEDEC_CAPACITY:
priv->sectorshift = N25Q064_SECTOR_SHIFT;
priv->pageshift = N25Q064_PAGE_SHIFT;
priv->nsectors = N25Q064_SECTOR_COUNT;
break;
case N25Q128_JEDEC_CAPACITY:
priv->sectorshift = N25Q128_SECTOR_SHIFT;
priv->pageshift = N25Q128_PAGE_SHIFT;
priv->nsectors = N25Q128_SECTOR_COUNT;
break;
case N25Q256_JEDEC_CAPACITY:
priv->sectorshift = N25Q256_SECTOR_SHIFT;
priv->pageshift = N25Q256_PAGE_SHIFT;
priv->nsectors = N25Q256_SECTOR_COUNT;
break;
case N25Q512_JEDEC_CAPACITY:
priv->sectorshift = N25Q512_SECTOR_SHIFT;
priv->pageshift = N25Q512_PAGE_SHIFT;
priv->nsectors = N25Q512_SECTOR_COUNT;
break;
case N25Q00_JEDEC_CAPACITY:
priv->sectorshift = N25Q00_SECTOR_SHIFT;
priv->pageshift = N25Q00_PAGE_SHIFT;
@ -664,7 +674,8 @@ static int n25qxxx_protect(FAR struct n25qxxx_dev_s *priv,
/* Check the new status */
priv->cmdbuf[0] = n25qxxx_read_status(priv);
if ((priv->cmdbuf[0] & (STATUS_BP3_MASK|STATUS_BP_MASK)) != (STATUS_BP3_MASK|STATUS_BP_MASK))
if ((priv->cmdbuf[0] & (STATUS_BP3_MASK | STATUS_BP_MASK)) !=
(STATUS_BP3_MASK | STATUS_BP_MASK))
{
return -EACCES;
}
@ -695,8 +706,9 @@ static int n25qxxx_unprotect(FAR struct n25qxxx_dev_s *priv,
if ((priv->cmdbuf[0] & STATUS_SRP0_MASK) == STATUS_SRP0_LOCKED)
{
/* the SRP bit is one time programmable; if it's set, there's nothing that
you can do to unset it.
* you can do to unset it.
*/
return -EACCES;
}
@ -740,7 +752,7 @@ static bool n25qxxx_isprotected(FAR struct n25qxxx_dev_s *priv, uint8_t status,
}
/* the BP field is essentially the power-of-two of the number of 64k sectors,
saturated to the device size.
* saturated to the device size.
*/
if ( 0 == bp )
@ -1215,8 +1227,6 @@ static ssize_t n25qxxx_bread(FAR struct mtd_dev_s *dev, off_t startblock,
#endif
return nbytes;
return 0;
}
/************************************************************************************
@ -1254,8 +1264,6 @@ static ssize_t n25qxxx_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
n25qxxx_unlock(priv->qspi);
return ret < 0 ? ret : nblocks;
return 0;
}
/************************************************************************************
@ -1284,8 +1292,6 @@ static ssize_t n25qxxx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
fvdbg("return nbytes: %d\n", (int)nbytes);
return (ssize_t)nbytes;
return 0;
}
/************************************************************************************
@ -1448,7 +1454,9 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro
goto errout_with_readbuf;
}
/* specify the number of dummy cycles via the 'volatile configuration register' */
/* Specify the number of dummy cycles via the 'volatile configuration
* register'
*/
priv->cmdbuf[0] = n25qxxx_read_volcfg(priv);
priv->cmdbuf[0] &= 0x0f;

View File

@ -56,6 +56,30 @@ config NX_WRITEONLY
Automatically defined if NX_LCDDRIVER and LCD_NOGETRUN are
defined.
config NX_UPDATE
bool "Display update hooks"
default n
---help---
Enable a callout to inform some external module that the display has
been updated. This would be useful in a couple for cases.
- When a serial LCD is used, but a framebuffer is used to access the
LCD. In this case, the update callout can be used to refresh the
affected region of the display.
- When VNC is enabled. This is case, this callout is necessary to
update the remote frame buffer to match the local framebuffer.
When this feature is enabled, some external logic must provide this
interface:
void nx_notify_rectangle(FAR NX_PLANEINFOTYPE *pinfo,
FAR const struct nxgl_rect_s *rect);
That is the function that will handle the notification. It
receives the rectangular region that was updated in the provided
plane.
menu "Supported Pixel Depths"
config NX_DISABLE_1BPP

View File

@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_bitmap.c
*
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -75,8 +75,17 @@ static void nxs_clipcopy(FAR struct nxbe_clipops_s *cops,
FAR const struct nxgl_rect_s *rect)
{
struct nx_bitmap_s *bminfo = (struct nx_bitmap_s *)cops;
/* Copy the rectangular region */
plane->copyrectangle(&plane->pinfo, rect, bminfo->src,
&bminfo->origin, bminfo->stride);
#ifdef CONFIG_NX_UPDATE
/* Notify external logic that the display has been updated */
nx_notify_rectangle(&plane->pinfo, rect);
#endif
}
/****************************************************************************
@ -153,6 +162,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
nxgl_rectintersect(&remaining, &bounds, &wnd->bounds);
nxgl_rectintersect(&remaining, &remaining, &wnd->be->bkgd.bounds);
if (nxgl_nullrect(&remaining))
{
return;
@ -177,4 +187,3 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
&info.cops, &wnd->be->plane[i]);
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_fill.c
*
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <nuttx/nx/nxglib.h>
#include <nuttx/nx/nx.h>
#include "nxbe.h"
@ -71,7 +72,16 @@ static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
FAR const struct nxgl_rect_s *rect)
{
struct nxbe_fill_s *fillinfo = (struct nxbe_fill_s *)cops;
/* Draw the rectangle */
plane->fillrectangle(&plane->pinfo, rect, fillinfo->color);
#ifdef CONFIG_NX_UPDATE
/* Notify external logic that the display has been updated */
nx_notify_rectangle(&plane->pinfo, rect);
#endif
}
/****************************************************************************

View File

@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_filltrapezoid.c
*
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -44,6 +44,18 @@
#include "nxbe.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
/****************************************************************************
* Private Types
****************************************************************************/
@ -73,7 +85,26 @@ static void nxbe_clipfilltrapezoid(FAR struct nxbe_clipops_s *cops,
FAR const struct nxgl_rect_s *rect)
{
struct nxbe_filltrap_s *fillinfo = (struct nxbe_filltrap_s *)cops;
#ifdef CONFIG_NX_UPDATE
struct nxgl_rect_s update;
#endif
/* Draw the trapezond */
plane->filltrapezoid(&plane->pinfo, &fillinfo->trap, rect, fillinfo->color);
#ifdef CONFIG_NX_UPDATE
/* Notify external logic that the display has been updated */
update.pt1.x = MIN(MAX(fillinfo->trap.top.x1, rect->pt1.x),
MAX(fillinfo->trap.bot.x1, rect->pt1.x));
update.pt1.y = MAX(fillinfo->trap.top.y, rect->pt1.y);
update.pt2.x = MAX(MIN(fillinfo->trap.top.x2, rect->pt2.x),
MIN(fillinfo->trap.bot.x2, rect->pt2.x));
update.pt2.y = MIN(fillinfo->trap.bot.y, rect->pt2.y);
nx_notify_rectangle(&plane->pinfo, &update);
#endif
}
/****************************************************************************

View File

@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_move.c
*
* Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -78,6 +78,9 @@ static void nxbe_clipmovesrc(FAR struct nxbe_clipops_s *cops,
{
struct nxbe_move_s *info = (struct nxbe_move_s *)cops;
struct nxgl_point_s offset;
#ifdef CONFIG_NX_UPDATE
struct nxgl_rect_s update;
#endif
if (info->offset.x != 0 || info->offset.y != 0)
{
@ -86,7 +89,20 @@ static void nxbe_clipmovesrc(FAR struct nxbe_clipops_s *cops,
offset.x = rect->pt1.x + info->offset.x;
offset.y = rect->pt1.y + info->offset.y;
/* Move the source rectangle to the destination position */
plane->moverectangle(&plane->pinfo, rect, &offset);
#ifdef CONFIG_NX_UPDATE
/* Notify external logic that the display has been updated */
update.pt1.x = offset.x;
update.pt1.y = offset.y;
update.pt2.x = rect->pt2.x + info->offset.x;
update.pt2.y = rect->pt2.y + info->offset.y;
nx_notify_rectangle(&plane->pinfo, &update);
#endif
}
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxbe/nxbe_setpixel.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <nuttx/nx/nxglib.h>
#include <nuttx/nx/nx.h>
#include "nxbe.h"
@ -71,7 +72,16 @@ static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
FAR const struct nxgl_rect_s *rect)
{
struct nxbe_setpixel_s *fillinfo = (struct nxbe_setpixel_s *)cops;
/* Set the pixel */
plane->setpixel(&plane->pinfo, &rect->pt1, fillinfo->color);
#ifdef CONFIG_NX_UPDATE
/* Notify external logic that the display has been updated */
nx_notify_rectangle(&plane->pinfo, rect);
#endif
}
/****************************************************************************
@ -79,7 +89,7 @@ static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
****************************************************************************/
/****************************************************************************
* Name: nxbe_fill
* Name: nxbe_setpixel
*
* Description:
* Fill the specified rectangle in the window with the specified color

View File

@ -901,6 +901,32 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin, unsigned int stride);
/****************************************************************************
* Name: nx_notify_rectangle
*
* Description:
* When CONFIG_NX_UPDATE=y, then the graphics system will callout to
* inform some external module that the display has been updated. This
* would be useful in a couple for cases.
*
* - When a serial LCD is used, but a framebuffer is used to access the
* LCD. In this case, the update callout can be used to refresh the
* affected region of the display.
*
* - When VNC is enabled. This is case, this callout is necessary to
* update the remote frame buffer to match the local framebuffer.
*
* When this feature is enabled, some external logic must provide this
* interface. This is the function that will handle the notification. It
* receives the rectangular region that was updated on the provided plane.
*
****************************************************************************/
#ifdef CONFIG_NX_UPDATE
void nx_notify_rectangle(FAR NX_PLANEINFOTYPE *pinfo,
FAR const struct nxgl_rect_s *rect);
#endif
/****************************************************************************
* Name: nx_kbdin
*

View File

@ -218,6 +218,7 @@ struct fb_planeinfo_s
FAR void *fbmem; /* Start of frame buffer memory */
uint32_t fblen; /* Length of frame buffer memory in bytes */
fb_coord_t stride; /* Length of a line in bytes */
uint8_t display; /* Display number */
uint8_t bpp; /* Bits per pixel */
};

View File

@ -512,7 +512,7 @@ struct rfb_clientcuttext_s
{
uint8_t msgtype; /* U8 Message type */
uint8_t padding[3];
uint8_t length[2]; /* U8 Length */
uint8_t length[4]; /* U32 Length */
uint8_t text[1]; /* U8 Text, actual length is Length */
};
@ -547,7 +547,7 @@ struct rfb_rectangle_s
uint8_t data[1]; /* Pixel data, actual size varies */
};
#define SIZEOF_RFB_RECTANGES(n,d) \
#define SIZEOF_RFB_RECTANGES(d) \
(sizeof(struct rfb_framebufferupdate_s) + (d) - 1)
struct rfb_framebufferupdate_s
@ -558,8 +558,8 @@ struct rfb_framebufferupdate_s
struct rfb_rectangle_s rect[1]; /* Actual number is nrect */
};
#define SIZEOF_RFB_FRAMEBUFFERUPDATE_S(n,r) \
(sizeof(struct rfb_framebufferupdate_s) + (r) - sizeof(rfb_rectangle_s))
#define SIZEOF_RFB_FRAMEBUFFERUPDATE_S(r) \
(sizeof(struct rfb_framebufferupdate_s) + (r) - sizeof(struct rfb_rectangle_s))
/* 6.5.2 SetColourMapEntries
*
@ -612,7 +612,7 @@ struct rfb_servercuttext_s
{
uint8_t msgtype; /* U8 Message type */
uint8_t padding[3];
uint8_t length[2]; /* U8 Length */
uint8_t length[4]; /* U32 Length */
uint8_t text[1]; /* U8 Text, actual length is Length */
};
@ -1010,7 +1010,7 @@ struct rfb_palettendx_s
* byte the most significant bit represents the leftmost pixel, with a
* 1-bit meaning the corresponding pixel in the cursor is valid."
*
* REVISIT: Also difficult to represent: A variable length pixel arry
* REVISIT: Also difficult to represent: A variable length pixel array
* followed by a variable length bit mask.
*/