mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
More fixes for NxConsole driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4543 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -3368,13 +3368,25 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
|
|||||||
<dd>NxConsole needs to remember every character written to the console so that it can redraw the window.
|
<dd>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.
|
This setting determines the size of some internal memory allocations used to hold the character data.
|
||||||
Default: 128.
|
Default: 128.
|
||||||
<dt><code>CONFIG_NXCONSOLE_FONTCACHE</code>:
|
|
||||||
<dd>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 <code>CONFIG_NXCONSOLE_CACHESIZE</code>.
|
|
||||||
Default: No font caching.
|
|
||||||
<dt><code>CONFIG_NXCONSOLE_CACHESIZE</code>:
|
<dt><code>CONFIG_NXCONSOLE_CACHESIZE</code>:
|
||||||
<dd>If <code>CONFIG_NXCONSOLE_FONTCACHE</code>, then this setting will control the size of the font cache (in number of glyphs). Default: 16.
|
<dd>
|
||||||
|
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 <code>CONFIG_NXCONSOLE_CACHESIZE</code> 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.
|
||||||
|
<blockquote>
|
||||||
|
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 <code>CONFIG_NXCONSOLE_CACHESIZE</code>
|
||||||
|
is something that you should try.
|
||||||
|
Alternatively, you can reduce the size of <code>CONFIG_MQ_MAXMSGSIZE</code> which will force NxConsole task to pace the server task.
|
||||||
|
<code>CONFIG_NXCONSOLE_CACHESIZE</code> should be larger than <code>CONFIG_MQ_MAXMSGSIZE</code> in any event.
|
||||||
|
</blockquote>
|
||||||
<dt><code>CONFIG_NXCONSOLE_LINESEPARATION</code>:
|
<dt><code>CONFIG_NXCONSOLE_LINESEPARATION</code>:
|
||||||
<dd>This the space (in rows) between each row of test. Default: 0
|
<dd>This the space (in rows) between each row of test. Default: 0
|
||||||
<dt><code>CONFIG_NXCONSOLE_NOWRAP</code>:
|
<dt><code>CONFIG_NXCONSOLE_NOWRAP</code>:
|
||||||
|
|||||||
@@ -438,15 +438,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -458,7 +459,6 @@ CONFIG_NXCONSOLE=n
|
|||||||
CONFIG_NXCONSOLE_BPP=8
|
CONFIG_NXCONSOLE_BPP=8
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
# CONFIG_NXCONSOLE_NOGETRUN
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|||||||
@@ -439,15 +439,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -459,7 +460,6 @@ CONFIG_NXCONSOLE=n
|
|||||||
CONFIG_NXCONSOLE_BPP=32
|
CONFIG_NXCONSOLE_BPP=32
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
# CONFIG_NXCONSOLE_NOGETRUN
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|||||||
@@ -1057,15 +1057,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -1075,10 +1076,9 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
#
|
#
|
||||||
CONFIG_NXCONSOLE=n
|
CONFIG_NXCONSOLE=n
|
||||||
CONFIG_NXCONSOLE_BPP=16
|
CONFIG_NXCONSOLE_BPP=16
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
CONFIG_NXCONSOLE_NOGETRUN=y
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
CONFIG_NXCONSOLE_CACHESIZE=32
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|
||||||
|
|||||||
@@ -907,15 +907,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -925,10 +926,9 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
#
|
#
|
||||||
CONFIG_NXCONSOLE=n
|
CONFIG_NXCONSOLE=n
|
||||||
CONFIG_NXCONSOLE_BPP=16
|
CONFIG_NXCONSOLE_BPP=16
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
CONFIG_NXCONSOLE_NOGETRUN=y
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
CONFIG_NXCONSOLE_CACHESIZE=32
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|
||||||
|
|||||||
@@ -915,15 +915,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -933,10 +934,9 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
#
|
#
|
||||||
CONFIG_NXCONSOLE=y
|
CONFIG_NXCONSOLE=y
|
||||||
CONFIG_NXCONSOLE_BPP=16
|
CONFIG_NXCONSOLE_BPP=16
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
CONFIG_NXCONSOLE_NOGETRUN=y
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
CONFIG_NXCONSOLE_CACHESIZE=32
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|
||||||
|
|||||||
@@ -906,15 +906,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -924,10 +925,9 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
#
|
#
|
||||||
CONFIG_NXCONSOLE=n
|
CONFIG_NXCONSOLE=n
|
||||||
CONFIG_NXCONSOLE_BPP=16
|
CONFIG_NXCONSOLE_BPP=16
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
CONFIG_NXCONSOLE_NOGETRUN=y
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
CONFIG_NXCONSOLE_CACHESIZE=32
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|
||||||
|
|||||||
@@ -906,15 +906,16 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
# NxConsole needs to remember every character written to the console so
|
# NxConsole needs to remember every character written to the console so
|
||||||
# that it can redraw the window. This setting determines the size of some
|
# that it can redraw the window. This setting determines the size of some
|
||||||
# internal memory allocations used to hold the character data. Default: 128.
|
# 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
|
# CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
# NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
# of the font cache (in number of glyphs). Default: 16.
|
# 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
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# This the space (in rows) between each row of test. Default: 2
|
# This the space (in rows) between each row of test. Default: 2
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -924,10 +925,9 @@ CONFIG_NX_MXCLIENTMSGS=16
|
|||||||
#
|
#
|
||||||
CONFIG_NXCONSOLE=n
|
CONFIG_NXCONSOLE=n
|
||||||
CONFIG_NXCONSOLE_BPP=16
|
CONFIG_NXCONSOLE_BPP=16
|
||||||
# CONFIG_NXCONSOLE_NOGETRUN
|
CONFIG_NXCONSOLE_NOGETRUN=y
|
||||||
CONFIG_NXCONSOLE_MXCHARS=256
|
CONFIG_NXCONSOLE_MXCHARS=256
|
||||||
# CONFIG_NXCONSOLE_FONTCACHE
|
CONFIG_NXCONSOLE_CACHESIZE=32
|
||||||
# CONFIG_NXCONSOLE_CACHESIZE
|
|
||||||
# CONFIG_NXCONSOLE_LINESEPARATION
|
# CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
# CONFIG_NXCONSOLE_NOWRAP
|
# CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|
||||||
|
|||||||
@@ -336,15 +336,21 @@ CONFIG_NXCONSOLE_MXCHARS
|
|||||||
NxConsole needs to remember every character written to the console so
|
NxConsole needs to remember every character written to the console so
|
||||||
that it can redraw the window. This setting determines the size of some
|
that it can redraw the window. This setting determines the size of some
|
||||||
internal memory allocations used to hold the character data. Default: 128.
|
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
|
CONFIG_NXCONSOLE_CACHESIZE
|
||||||
If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
of the font cache (in number of glyphs). Default: 16.
|
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
|
CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
This the space (in rows) between each row of test. Default: 0
|
This the space (in rows) between each row of test. Default: 0
|
||||||
CONFIG_NXCONSOLE_NOWRAP
|
CONFIG_NXCONSOLE_NOWRAP
|
||||||
|
|||||||
@@ -39,9 +39,12 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/kmalloc.h>
|
||||||
|
|
||||||
#include "nxcon_internal.h"
|
#include "nxcon_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -94,7 +97,6 @@
|
|||||||
* Name: nxcon_freeglyph
|
* Name: nxcon_freeglyph
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
static void nxcon_freeglyph(FAR struct nxcon_glyph_s *glyph)
|
static void nxcon_freeglyph(FAR struct nxcon_glyph_s *glyph)
|
||||||
{
|
{
|
||||||
if (glyph->bitmap)
|
if (glyph->bitmap)
|
||||||
@@ -103,7 +105,6 @@ static void nxcon_freeglyph(FAR struct nxcon_glyph_s *glyph)
|
|||||||
}
|
}
|
||||||
memset(glyph, 0, sizeof(struct nxcon_glyph_s));
|
memset(glyph, 0, sizeof(struct nxcon_glyph_s));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: nxcon_allocglyph
|
* Name: nxcon_allocglyph
|
||||||
@@ -112,7 +113,6 @@ static void nxcon_freeglyph(FAR struct nxcon_glyph_s *glyph)
|
|||||||
static inline FAR struct nxcon_glyph_s *
|
static inline FAR struct nxcon_glyph_s *
|
||||||
nxcon_allocglyph(FAR struct nxcon_state_s *priv)
|
nxcon_allocglyph(FAR struct nxcon_state_s *priv)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
FAR struct nxcon_glyph_s *glyph = NULL;
|
FAR struct nxcon_glyph_s *glyph = NULL;
|
||||||
FAR struct nxcon_glyph_s *luglyph = NULL;
|
FAR struct nxcon_glyph_s *luglyph = NULL;
|
||||||
uint8_t luusecnt;
|
uint8_t luusecnt;
|
||||||
@@ -175,16 +175,12 @@ nxcon_allocglyph(FAR struct nxcon_state_s *priv)
|
|||||||
|
|
||||||
luglyph->usecnt = 1;
|
luglyph->usecnt = 1;
|
||||||
return luglyph;
|
return luglyph;
|
||||||
#else
|
|
||||||
return &priv->glyph;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: nxcon_findglyph
|
* Name: nxcon_findglyph
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
static FAR struct nxcon_glyph_s *
|
static FAR struct nxcon_glyph_s *
|
||||||
nxcon_findglyph(FAR struct nxcon_state_s *priv, uint8_t ch)
|
nxcon_findglyph(FAR struct nxcon_state_s *priv, uint8_t ch)
|
||||||
{
|
{
|
||||||
@@ -211,7 +207,6 @@ nxcon_findglyph(FAR struct nxcon_state_s *priv, uint8_t ch)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: nxcon_renderglyph
|
* Name: nxcon_renderglyph
|
||||||
@@ -226,6 +221,7 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
|
|||||||
#if CONFIG_NXCONSOLE_BPP < 8
|
#if CONFIG_NXCONSOLE_BPP < 8
|
||||||
nxgl_mxpixel_t pixel;
|
nxgl_mxpixel_t pixel;
|
||||||
#endif
|
#endif
|
||||||
|
int bmsize;
|
||||||
int row;
|
int row;
|
||||||
int col;
|
int col;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -246,15 +242,8 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
|
|||||||
|
|
||||||
/* Allocate memory to hold the glyph with its offsets */
|
/* Allocate memory to hold the glyph with its offsets */
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
bmsize = glyph->stride * glyph->height;
|
||||||
{
|
glyph->bitmap = (FAR uint8_t *)kmalloc(bmsize);
|
||||||
DEBUGASSERT(glyph->bitmap == NULL);
|
|
||||||
int bmsize = glyph->stride * glyph->height;
|
|
||||||
glyph->bitmap = (FAR uint8_t *)kmalloc(bmsize);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
DEBUGASSERT(glyph->bitmap != NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (glyph->bitmap)
|
if (glyph->bitmap)
|
||||||
{
|
{
|
||||||
@@ -329,9 +318,7 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
|
|||||||
/* Actually, the RENDERER never returns a failure */
|
/* Actually, the RENDERER never returns a failure */
|
||||||
|
|
||||||
gdbg("nxcon_renderglyph: RENDERER failed\n");
|
gdbg("nxcon_renderglyph: RENDERER failed\n");
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
nxcon_freeglyph(glyph);
|
nxcon_freeglyph(glyph);
|
||||||
#endif
|
|
||||||
glyph = NULL;
|
glyph = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -374,7 +361,6 @@ nxcon_getglyph(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
|
|||||||
|
|
||||||
/* First, try to find the glyph in the cache of pre-rendered glyphs */
|
/* First, try to find the glyph in the cache of pre-rendered glyphs */
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
glyph = nxcon_findglyph(priv, ch);
|
glyph = nxcon_findglyph(priv, ch);
|
||||||
if (glyph)
|
if (glyph)
|
||||||
{
|
{
|
||||||
@@ -382,9 +368,6 @@ nxcon_getglyph(NXHANDLE hfont, FAR struct nxcon_state_s *priv, uint8_t ch)
|
|||||||
|
|
||||||
return glyph;
|
return glyph;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
glyph = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* No, it is not cached... Does the code map to a font? */
|
/* No, it is not cached... Does the code map to a font? */
|
||||||
|
|
||||||
|
|||||||
@@ -119,9 +119,7 @@ struct nxcon_glyph_s
|
|||||||
uint8_t height; /* Height of this glyph (in rows) */
|
uint8_t height; /* Height of this glyph (in rows) */
|
||||||
uint8_t width; /* Width of this glyph (in pixels) */
|
uint8_t width; /* Width of this glyph (in pixels) */
|
||||||
uint8_t stride; /* Width of the glyph row (in bytes) */
|
uint8_t stride; /* Width of the glyph row (in bytes) */
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
uint8_t usecnt; /* Use count */
|
uint8_t usecnt; /* Use count */
|
||||||
#endif
|
|
||||||
FAR uint8_t *bitmap; /* Allocated bitmap memory */
|
FAR uint8_t *bitmap; /* Allocated bitmap memory */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -155,9 +153,7 @@ struct nxcon_state_s
|
|||||||
uint8_t fheight; /* Max height of a font in pixels */
|
uint8_t fheight; /* Max height of a font in pixels */
|
||||||
uint8_t fwidth; /* Max width of a font in pixels */
|
uint8_t fwidth; /* Max width of a font in pixels */
|
||||||
uint8_t spwidth; /* The width of a space */
|
uint8_t spwidth; /* The width of a space */
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
uint8_t maxglyphs; /* Size of the glyph[] array */
|
uint8_t maxglyphs; /* Size of the glyph[] array */
|
||||||
#endif
|
|
||||||
|
|
||||||
/* VT100 escape sequence processing */
|
/* VT100 escape sequence processing */
|
||||||
|
|
||||||
@@ -170,13 +166,7 @@ struct nxcon_state_s
|
|||||||
|
|
||||||
/* Glyph cache data storage */
|
/* Glyph cache data storage */
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
struct nxcon_glyph_s glyph[CONFIG_NXCONSOLE_CACHESIZE];
|
struct nxcon_glyph_s glyph[CONFIG_NXCONSOLE_CACHESIZE];
|
||||||
#else
|
|
||||||
/* A glyph cache of size one -- all fonts will be re-rendered on each use */
|
|
||||||
|
|
||||||
struct nxcon_glyph_s glyph;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -124,27 +124,9 @@ FAR struct nxcon_state_s *
|
|||||||
|
|
||||||
priv->maxchars = CONFIG_NXCONSOLE_MXCHARS;
|
priv->maxchars = CONFIG_NXCONSOLE_MXCHARS;
|
||||||
|
|
||||||
/* Set up the font glyph bitmap cache (if enabled) */
|
/* Set up the font glyph bitmap cache */
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
priv->maxglyphs = CONFIG_NXCONSOLE_CACHESIZE;
|
priv->maxglyphs = CONFIG_NXCONSOLE_CACHESIZE;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Pre-allocate maximal sized glyph bitmap memory (only if we are not
|
|
||||||
* using the glyph cache.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CONFIG_NXCONSOLE_FONTCACHE
|
|
||||||
{
|
|
||||||
int allocsize = (priv->fheight * priv->fwidth * CONFIG_NXCONSOLE_BPP + 7) >> 3;
|
|
||||||
priv->glyph.bitmap = (FAR uint8_t *)kmalloc(allocsize);
|
|
||||||
if (!priv->glyph.bitmap)
|
|
||||||
{
|
|
||||||
gdbg("Failed to allocate glyph memory\n");
|
|
||||||
goto errout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set the initial display position */
|
/* Set the initial display position */
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
* only.
|
* only.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_NXCONSOLE_NOGETRUN
|
#ifdef CONFIG_NXCONSOLE_NOGETRUN
|
||||||
static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
|
static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
|
||||||
int bottom, int scrollheight)
|
int bottom, int scrollheight)
|
||||||
{
|
{
|
||||||
@@ -170,7 +170,7 @@ static inline void nxcon_movedisplay(FAR struct nxcon_state_s *priv,
|
|||||||
|
|
||||||
/* Move the source rectangle */
|
/* Move the source rectangle */
|
||||||
|
|
||||||
ret = priv->move(priv, &rect, &offset);
|
ret = priv->ops->move(priv, &rect, &offset);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
gdbg("move failed: %d\n", errno);
|
gdbg("move failed: %d\n", errno);
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ void nxcon_unregister(NXCONSOLE handle)
|
|||||||
{
|
{
|
||||||
FAR struct nxcon_state_s *priv;
|
FAR struct nxcon_state_s *priv;
|
||||||
char devname[NX_DEVNAME_SIZE];
|
char devname[NX_DEVNAME_SIZE];
|
||||||
|
int i;
|
||||||
|
|
||||||
DEBUGASSERT(handle);
|
DEBUGASSERT(handle);
|
||||||
|
|
||||||
@@ -97,11 +98,16 @@ void nxcon_unregister(NXCONSOLE handle)
|
|||||||
priv = (FAR struct nxcon_state_s *)handle;
|
priv = (FAR struct nxcon_state_s *)handle;
|
||||||
sem_destroy(&priv->exclsem);
|
sem_destroy(&priv->exclsem);
|
||||||
|
|
||||||
/* Free the pre-allocated glyph bitmap */
|
/* Free all allocated glyph bitmap */
|
||||||
|
|
||||||
#ifndef CONFIG_NXCONSOLE_FONTCACHE
|
for (i = 0; i < CONFIG_NXCONSOLE_CACHESIZE; i++)
|
||||||
kfree(priv->glyph.bitmap);
|
{
|
||||||
#endif
|
FAR struct nxcon_glyph_s *glyph = &priv->glyph[i];
|
||||||
|
if (glyph->bitmap)
|
||||||
|
{
|
||||||
|
kfree(glyph->bitmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Unregister the driver */
|
/* Unregister the driver */
|
||||||
|
|
||||||
|
|||||||
@@ -77,15 +77,16 @@
|
|||||||
* NxConsole needs to remember every character written to the console so
|
* NxConsole needs to remember every character written to the console so
|
||||||
* that it can redraw the window. This setting determines the size of some
|
* that it can redraw the window. This setting determines the size of some
|
||||||
* internal memory allocations used to hold the character data. Default: 128.
|
* 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
|
* CONFIG_NXCONSOLE_CACHESIZE
|
||||||
* If CONFIG_NXCONSOLE_FONTCACHE, then this setting will control the size
|
* NxConsole supports caching of rendered fonts. This font caching is required
|
||||||
* of the font cache (in number of glyphs). Default: 16.
|
* 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
|
* CONFIG_NXCONSOLE_LINESEPARATION
|
||||||
* This the space (in rows) between each row of test. Default: 0
|
* This the space (in rows) between each row of test. Default: 0
|
||||||
* CONFIG_NXCONSOLE_NOWRAP
|
* CONFIG_NXCONSOLE_NOWRAP
|
||||||
@@ -104,12 +105,8 @@
|
|||||||
* remembered.
|
* remembered.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NXCONSOLE_FONTCACHE
|
#ifndef CONFIG_NXCONSOLE_CACHESIZE
|
||||||
# ifndef CONFIG_NXCONSOLE_CACHESIZE
|
# define CONFIG_NXCONSOLE_CACHESIZE 16
|
||||||
# define CONFIG_NXCONSOLE_CACHESIZE 16
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# undef CONFIG_NXCONSOLE_CACHESIZE
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Pixel depth */
|
/* Pixel depth */
|
||||||
|
|||||||
Reference in New Issue
Block a user