configs/open1788/pwfb: Add an example for testing per-window frame buffers. arch/arm/src/lpc17xx: Add a configuration option to skip over the framebuffer when adding DRAM to the heap. graphics: Early fixes from testing per-window framebuffer. Still lots of problems.

This commit is contained in:
Gregory Nutt 2019-03-16 12:31:29 -06:00
parent e5c0084804
commit 56c7b65094
7 changed files with 122 additions and 10 deletions

View File

@ -451,6 +451,18 @@ config LPC17_EXTDRAMHEAP
---help---
Add the external SDRAM into the heap.
config LPC17_EXTDRAMHEAP_OFFSET
int "DRAM heap offset"
default 0
depends on LPC17_EXTDRAMHEAP
---help---
Memory may be reserved at the beginning of DRAM for other purposes
(for example for video framebuffers). Memory can similar be
reserved at the end of DRAM using LPC17_EXTDRAMSIZE. The amount to
be added to the heap will be from DRAM_BASE + LPC17_EXTDRAMHEAP_OFFSET
through DRAM_BASE + LPC17_EXTDRAMSIZE where (DRAM_BASE is the base
address of CS0).
endif
config LPC17_EXTSRAM0

View File

@ -381,6 +381,14 @@ void up_addregion(void)
#if CONFIG_MM_REGIONS >= 3
#if defined(CONFIG_LPC17_EXTDRAM) && defined(CONFIG_LPC17_EXTDRAMHEAP)
{
/* Memory may be reserved at the beginning of DRAM for other purposes
* (for example for video framebuffers). Memory can similar be
* reserved at the end of DRAM using LPC17_EXTDRAMSIZE. The amount to
* be added to the heap will be from DRAM_BASE + LPC17_EXTDRAMHEAP_OFFSET
* through DRAM_BASE + LPC17_EXTDRAMSIZE where (DRAM_BASE is the base
* address of CS0).
*/
uintptr_t dram_end = LPC17_EXTDRAM_CS0 + CONFIG_LPC17_EXTDRAMSIZE;
uintptr_t dram_start;
uintptr_t heap_size;
@ -398,9 +406,11 @@ void up_addregion(void)
}
else
{
/* Use the entire SDRAM for heap */
/* Use the entire SDRAM for heap (possible reserving a portion at
* the beginning of DRAM.
*/
dram_start = LPC17_EXTDRAM_CS0;
dram_start = LPC17_EXTDRAM_CS0 + CONFIG_LPC17_EXTDRAMHEAP_OFFSET;
}
heap_size = dram_end - dram_start;

View File

@ -572,3 +572,12 @@ Configuration Directories
has been verified that the pdcurses demos that require menu
interactions work well with the discrete joystick.
pwfb:
-----
This configuration uses the test at apps/examples/pwfb to verify the
operation of the per-window framebuffers.
STATUS:
2019-03-16: The test does not succeed. There are still numerou
problems to be overcome.

View File

@ -0,0 +1,66 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_EXAMPLES_PWFB_DEFAULT_COLORS is not set
# CONFIG_EXAMPLES_PWFB_DEFAULT_FONT is not set
# CONFIG_NXFONTS_DISABLE_16BPP is not set
# CONFIG_NX_DISABLE_16BPP is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="open1788"
CONFIG_ARCH_BOARD_OPEN1788=y
CONFIG_ARCH_CHIP_LPC1788=y
CONFIG_ARCH_CHIP_LPC17XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARM_MPU=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=11934
CONFIG_EXAMPLES_PWFB=y
CONFIG_EXAMPLES_PWFB_BGCOLOR=0x7b5d
CONFIG_EXAMPLES_PWFB_BPP=16
CONFIG_EXAMPLES_PWFB_COLOR1=0xe73f
CONFIG_EXAMPLES_PWFB_COLOR2=0xdefb
CONFIG_EXAMPLES_PWFB_COLOR3=0xff76
CONFIG_EXAMPLES_PWFB_FONTCOLOR=0x0000
CONFIG_EXAMPLES_PWFB_FONTID=1
CONFIG_EXPERIMENTAL=y
CONFIG_INTELHEX_BINARY=y
CONFIG_LPC17_EXTDRAM=y
CONFIG_LPC17_EXTDRAMHEAP_OFFSET=393216
CONFIG_LPC17_EXTDRAMSIZE=67108864
CONFIG_LPC17_GPDMA=y
CONFIG_LPC17_LCD=y
CONFIG_LPC17_LCD_BPP16=y
CONFIG_LPC17_UART0=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MM_REGIONS=3
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LIBRARY=y
CONFIG_NSH_READLINE=y
CONFIG_NX=y
CONFIG_NXFONT_SANS23X27=y
CONFIG_NX_BLOCKING=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=4
CONFIG_RAM_SIZE=65536
CONFIG_RAM_START=0x10000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=16
CONFIG_START_MONTH=3
CONFIG_START_YEAR=2019
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_USER_ENTRYPOINT="pwfb_main"
CONFIG_WDOG_INTRESERVE=0

View File

@ -117,7 +117,7 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd,
newidth = wnd->bounds.pt2.x - wnd->bounds.pt1.x + 1;
newheight = wnd->bounds.pt2.y - wnd->bounds.pt1.y + 1;
bpp = wnd->be->plane[0].pinfo.bpp;
newstride = (bpp * newidth + 7) >> 8;
newstride = (bpp * newidth + 7) >> 3;
newfbsize = newstride * newheight;
#ifdef CONFIG_BUILD_KERNEL
@ -134,7 +134,9 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd,
{
/* Fall back to no RAM back up */
gerr("ERROR: mm_pgalloc() failed\n");
gerr("ERROR: mm_pgalloc() failed for fbsize=%lu, npages=%u\n",
(unsigned long)newfbsize, npages);
mm_pgfree(wnd->fbmem, wnd->npages);
wnd->stride = 0;
wnd->npages = 0;
@ -150,7 +152,9 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd,
{
/* Fall back to no RAM back up */
gerr("ERROR: mm_pgalloc() failed\n");
gerr("ERROR: kumm_malloc() failed for fbsize=%lu\n",
(unsigned long)newfbsize);
kumm_free(wnd->fbmem);
wnd->stride = 0;
wnd->fbmem = NULL;

View File

@ -106,7 +106,7 @@ void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd)
width = wnd->bounds.pt2.x - wnd->bounds.pt1.x + 1;
height = wnd->bounds.pt2.y - wnd->bounds.pt1.y + 1;
bpp = wnd->be->plane[0].pinfo.bpp;
wnd->stride = (bpp * width + 7) >> 8;
wnd->stride = (bpp * width + 7) >> 3;
fbsize = wnd->stride * height;
#ifdef CONFIG_BUILD_KERNEL
@ -129,7 +129,9 @@ void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd)
{
/* Fall back to no RAM back up */
gerr("ERROR: mm_pgalloc() failed\n");
gerr("ERROR: mm_pgalloc() failed for fbsize=%lu, npages=%u\n",
(unsigned long)fbsize, wnd->npages);
wnd->stride = 0;
wnd->npages = 0;
NXBE_CLRRAMBACKED(wnd);
@ -148,7 +150,9 @@ void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd)
{
/* Fall back to no RAM back up */
gerr("ERROR: mm_pgalloc() failed\n");
gerr("ERROR: kumm_malloc() failed for fbsize=%lu\n",
(unsigned long)fbsize);
wnd->stride = 0;
NXBE_CLRRAMBACKED(wnd);
}

View File

@ -69,6 +69,7 @@ void nxmu_redrawreq(FAR struct nxbe_window_s *wnd,
if (NXBE_ISRAMBACKED(wnd))
{
struct nxgl_rect_s wndrect;
FAR const void *src[CONFIG_NX_NPLANES] =
{
(FAR const void *)wnd->fbmem
@ -78,7 +79,14 @@ void nxmu_redrawreq(FAR struct nxbe_window_s *wnd,
0, 0
};
nxbe_bitmap_dev(wnd, rect, src, &origin, wnd->stride);
/* Put the rectangle back relative to the window */
nxgl_rectoffset(&wndrect, rect,
-wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
/* And render the bitmap */
nxbe_bitmap_dev(wnd, &wndrect, src, &origin, wnd->stride);
}
else
#endif
@ -97,4 +105,3 @@ void nxmu_redrawreq(FAR struct nxbe_window_s *wnd,
sizeof(struct nxclimsg_redraw_s));
}
}