diff --git a/Documentation/NXGraphicsSubsystem.html b/Documentation/NXGraphicsSubsystem.html index ecace15d0c5..38baf54ee17 100644 --- a/Documentation/NXGraphicsSubsystem.html +++ b/Documentation/NXGraphicsSubsystem.html @@ -3368,13 +3368,25 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
CONFIG_NXCONSOLE_FONTCACHE:
- CONFIG_NXCONSOLE_CACHESIZE.
- Default: No font caching.
CONFIG_NXCONSOLE_CACHESIZE:
- CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size of the font cache (in number of glyphs). Default: 16.
+ CONFIG_NXCONSOLE_CACHESIZE setting will control the size of the font cache (in number of glyphs).
+ Only that number of the most recently used glyphs will be retained.
+ Default: 16.
+ + NOTE: There can still be a race condition between the NxConsole driver and the + NX task. If you every see character corruption (especially when printing + a lot of data or scrolling), then increasing the value ofCONFIG_NXCONSOLE_CACHESIZE+ is something that you should try. + Alternatively, you can reduce the size ofCONFIG_MQ_MAXMSGSIZEwhich will force NxConsole task to pace the server task. +CONFIG_NXCONSOLE_CACHESIZEshould be larger thanCONFIG_MQ_MAXMSGSIZEin any event. +
CONFIG_NXCONSOLE_LINESEPARATION:
CONFIG_NXCONSOLE_NOWRAP:
diff --git a/configs/sim/nx/defconfig b/configs/sim/nx/defconfig
index f8139b32caf..e34dadcd87b 100644
--- a/configs/sim/nx/defconfig
+++ b/configs/sim/nx/defconfig
@@ -438,15 +438,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -458,7 +459,6 @@ CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=8
# CONFIG_NXCONSOLE_NOGETRUN
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
# CONFIG_NXCONSOLE_CACHESIZE
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/configs/sim/nx11/defconfig b/configs/sim/nx11/defconfig
index d8b1d6019ef..7866cc1b2a6 100644
--- a/configs/sim/nx11/defconfig
+++ b/configs/sim/nx11/defconfig
@@ -439,15 +439,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -459,7 +460,6 @@ CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=32
# CONFIG_NXCONSOLE_NOGETRUN
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
# CONFIG_NXCONSOLE_CACHESIZE
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig
index 228abf2309e..9fbbcce88ce 100644
--- a/configs/stm3210e-eval/nsh2/defconfig
+++ b/configs/stm3210e-eval/nsh2/defconfig
@@ -1057,15 +1057,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -1075,10 +1076,9 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-# CONFIG_NXCONSOLE_NOGETRUN
+CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
-# CONFIG_NXCONSOLE_CACHESIZE
+CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig
index 02cafd33d7b..1df6b454d5c 100644
--- a/configs/stm3210e-eval/nx/defconfig
+++ b/configs/stm3210e-eval/nx/defconfig
@@ -907,15 +907,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -925,10 +926,9 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-# CONFIG_NXCONSOLE_NOGETRUN
+CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
-# CONFIG_NXCONSOLE_CACHESIZE
+CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/configs/stm3210e-eval/nxconsole/defconfig b/configs/stm3210e-eval/nxconsole/defconfig
index 5945bb64266..b3bc9e3cc96 100644
--- a/configs/stm3210e-eval/nxconsole/defconfig
+++ b/configs/stm3210e-eval/nxconsole/defconfig
@@ -915,15 +915,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -933,10 +934,9 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=y
CONFIG_NXCONSOLE_BPP=16
-# CONFIG_NXCONSOLE_NOGETRUN
+CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
-# CONFIG_NXCONSOLE_CACHESIZE
+CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/configs/stm3210e-eval/nxlines/defconfig b/configs/stm3210e-eval/nxlines/defconfig
index fa067ae41cd..76dc411c96d 100644
--- a/configs/stm3210e-eval/nxlines/defconfig
+++ b/configs/stm3210e-eval/nxlines/defconfig
@@ -906,15 +906,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -924,10 +925,9 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-# CONFIG_NXCONSOLE_NOGETRUN
+CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
-# CONFIG_NXCONSOLE_CACHESIZE
+CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/configs/stm3210e-eval/nxtext/defconfig b/configs/stm3210e-eval/nxtext/defconfig
index 753b69190d0..434635faece 100644
--- a/configs/stm3210e-eval/nxtext/defconfig
+++ b/configs/stm3210e-eval/nxtext/defconfig
@@ -906,15 +906,16 @@ CONFIG_NX_MXCLIENTMSGS=16
# NxConsole needs to remember every character written to the console so
# that it can redraw the window. This setting determines the size of some
# internal memory allocations used to hold the character data. Default: 128.
-# CONFIG_NXCONSOLE_FONTCACHE
-# If this setting is defined, then caching of fonts will be supported by
-# NxConsole. Each font must be rendered from the tiny font storage format
-# to the full display size and pixel depth. If this setting is defined, then
-# the more recently used font glyphs will be retained in a cache of size
-# CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
# CONFIG_NXCONSOLE_CACHESIZE
-# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
-# of the font cache (in number of glyphs). Default: 16.
+# NxConsole supports caching of rendered fonts. This font caching is required
+# for two reasons: (1) First, it improves text performance, but more
+# importantly (2) it preserves the font memory. Since the NX server runs on
+# a separate server thread, it requires that the rendered font memory persist
+# until the server has a chance to render the font. (NOTE: There is still
+# inherently a race condition in this!). Unfortunately, the font cache would
+# be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE setting
+# will control the size of the font cache (in number of glyphs). Only that
+# number of the most recently used glyphs will be retained. Default: 16.
# CONFIG_NXCONSOLE_LINESEPARATION
# This the space (in rows) between each row of test. Default: 2
# CONFIG_NXCONSOLE_NOWRAP
@@ -924,10 +925,9 @@ CONFIG_NX_MXCLIENTMSGS=16
#
CONFIG_NXCONSOLE=n
CONFIG_NXCONSOLE_BPP=16
-# CONFIG_NXCONSOLE_NOGETRUN
+CONFIG_NXCONSOLE_NOGETRUN=y
CONFIG_NXCONSOLE_MXCHARS=256
-# CONFIG_NXCONSOLE_FONTCACHE
-# CONFIG_NXCONSOLE_CACHESIZE
+CONFIG_NXCONSOLE_CACHESIZE=32
# CONFIG_NXCONSOLE_LINESEPARATION
# CONFIG_NXCONSOLE_NOWRAP
diff --git a/graphics/README.txt b/graphics/README.txt
index 935df9140c5..a816cdb584f 100644
--- a/graphics/README.txt
+++ b/graphics/README.txt
@@ -336,15 +336,21 @@ CONFIG_NXCONSOLE_MXCHARS
NxConsole needs to remember every character written to the console so
that it can redraw the window. This setting determines the size of some
internal memory allocations used to hold the character data. Default: 128.
-CONFIG_NXCONSOLE_FONTCACHE
- If this setting is defined, then caching of fonts will be supported by
- NxConsole. Each font must be rendered from the tiny font storage format
- to the full display size and pixel depth. If this setting is defined, then
- the more recently used font glyphs will be retained in a cache of size
- CONFIG_NXCONSOLE_CACHESIZE. Default: No font caching.
CONFIG_NXCONSOLE_CACHESIZE
- If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
- of the font cache (in number of glyphs). Default: 16.
+ NxConsole supports caching of rendered fonts. This font caching is required
+ for two reasons: (1) First, it improves text performance, but more
+ importantly (2) it preserves the font memory. Since the NX server runs on
+ a separate server thread, it requires that the rendered font memory persist
+ until the server has a chance to render the font. Unfortunately, the font
+ cache would be quite large if all fonts were saved. The CONFIG_NXCONSOLE_CACHESIZE
+ setting will control the size of the font cache (in number of glyphs). Only that
+ number of the most recently used glyphs will be retained. Default: 16.
+ NOTE: There can still be a race condition between the NxConsole driver and the
+ NX task. If you every see character corruption (especially when printing
+ a lot of data or scrolling), then increasing the value of CONFIG_NXCONSOLE_CACHESIZE
+ is something that you should try. Alternatively, you can reduce the size of
+ CONFIG_MQ_MAXMSGSIZE which will force NxConsole task to pace the server task.
+ CONFIG_NXCONSOLE_CACHESIZE should be larger than ONFIG_MQ_MAXMSGSIZE in any event.
CONFIG_NXCONSOLE_LINESEPARATION
This the space (in rows) between each row of test. Default: 0
CONFIG_NXCONSOLE_NOWRAP
diff --git a/graphics/nxconsole/nxcon_font.c b/graphics/nxconsole/nxcon_font.c
index cb5320d2573..2677b9c1587 100644
--- a/graphics/nxconsole/nxcon_font.c
+++ b/graphics/nxconsole/nxcon_font.c
@@ -39,9 +39,12 @@
#include