ViezeVingertjes opened a new pull request, #4173:
URL: https://github.com/apache/nuttx-apps/pull/4173

   ## Summary
   
   fbcon only showed text on memory-mapped 32 bpp framebuffers.  On the LCD
   framebuffer of an SPI/QSPI panel (RGB565, CONFIG_FB_UPDATE) nothing
   appeared at all.  Three fixes, one per commit:
   
   1. **Draw with the configured pixel depth.**  fbcon_bitmap() and
      fbcon_fill() wrote every pixel as a uint32_t, so at 16 bpp each
      character was drawn at twice its x position and width.  fbcon_bitmap()
      also ignored its stride and copied the source from its start, which is
      only right when the whole glyph is drawn, not when a scroll redraws the
      part of a glyph within one row.  Copy and fill in bytes according to
      FBCON_BPP, and pass the glyph origin so that a clipped area is read
      from the right place in the glyph.
   2. **Support framebuffers that need FBIO_UPDATE.**  With
      CONFIG_FB_UPDATE, framebuffer writes only reach the display after an
      FBIO_UPDATE ioctl.  Track the area changed by fbcon_bitmap() and
      fbcon_fill() and send it once per pass of the main loop.  Without
      CONFIG_FB_UPDATE nothing changes.
   3. **Echo the typed character.**  With CONFIG_NSH_READLINE, every typed
      character was echoed from the output buffer instead of the character
      itself (e.g. "--------" for "uname -a").
   
   For 32 bpp memory-mapped framebuffers the output is the same as before
   (apart from the clipped redraw being correct now).  24 bpp stays
   unsupported, as in the glyph rendering.
   
   ## Impact
   
   * Is new feature added? Is existing feature changed? YES: fbcon now works on 
8/16 bpp framebuffers and on framebuffers that need FBIO_UPDATE (bug fixes).
   * Impact on user (will user need to adapt to change)? NO
   * Impact on build (will build process change)? NO
   * Impact on hardware (will arch(s) / board(s) / driver(s) change)? NO
   * Impact on documentation (is update required / provided)? NO
   * Impact on security (any sort of implications)? NO
   * Impact on compatibility (backward/forward/interoperability)? NO
   
   ## Testing
   
   I confirm that changes are verified on local setup and works as intended:
   * Build Host(s): Linux x86_64, xtensa-esp-elf GCC 15.2.0 
(esp-15.2.0_20251204), host GCC for sim.
   * Target(s): Waveshare ESP32-S3-Touch-AMOLED-2.16 (CO5300 AMOLED 480x480, 
RGB565 LCD framebuffer with CONFIG_FB_UPDATE), with the board's fbcon 
configuration (board support is in a separate PR), x11 fixed 10x20 font.
   
   On the board: commands typed on the USB console and their output are shown
   on the display, typed commands are echoed correctly, and long output
   (help) scrolls cleanly.  Each commit builds on its own.
   
   Builds (each on current master plus this PR only):
   
   * PASS sim:fb + fbcon, 32 bpp, memory-mapped, no CONFIG_FB_UPDATE (warnings: 
1, existing, see below)
   * PASS esp32s3-m5-cardputer:fb + fbcon, 16 bpp LCD framebuffer, 
CONFIG_FB_UPDATE (warnings: 0)
   * PASS sim:fb + fbcon at 16 and 8 bpp (compile check)
   * PASS esp32s3-touch-amoled-216:fbcon for each commit on its own (warnings: 
0)
   * checkpatch: no issues
   
   The sim builds show one existing warning (unused variable 'index' in main()
   when CONFIG_BUILTIN is disabled), unrelated to this change.
   
   Testing logs before change:
   
   ```
   nsh> fbcon
   (display stays black: nothing is sent to the panel; with the FBIO_UPDATE
   commit alone, text is drawn at twice its x position and width)
   ```
   
   Testing logs after change (as read from the display):
   
   ```
   NuttShell (NSH) NuttX-13.1.1
   nsh> uname -a
   NuttX 13.1.1 ... xtensa esp32s3-touch-amoled-216
   nsh> ls /dev
   /dev:
    console
    fb0
    null
    ram0
    ttyACM0
    zero
   nsh>
   ```
   
   ## PR verification Self-Check
   
   * [x] This PR introduces only one functional change.
   * [x] I have updated all required description fields above.
   * [x] My PR adheres to Contributing Guidelines and Documentation (git commit 
title and message, coding standard, etc).
   * [ ] My PR is still work in progress (not ready for review).
   * [x] My PR is ready for review and can be safely merged into a codebase.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to