Skip to content

Conversation

@ArturR0k3r
Copy link

Overview

This PR adds backlight GPIO control to the ILI9341 display binding and introduces a comprehensive gaming performance benchmark sample. This work originated from AkiraOS - a retro-cyberpunk gaming console project built on Zephyr RTOS.

Motivation

During AkiraOS development, we identified critical needs for ILI9341-based gaming applications:

  1. Power Management: Battery-powered gaming devices need backlight control for power saving
  2. Performance Understanding: Gaming requires 30-60 FPS, but baseline full-screen updates take ~350ms
  3. Documentation Gap: No existing samples demonstrated gaming-specific display usage

Changes Made

1. Devicetree Binding Enhancement

File: dts/bindings/display/ilitek,ili9341.yaml

Added optional bl-gpios property for backlight control:

bl-gpios:
  type: phandle-array
  description: |
    Backlight GPIO control pin (optional).
    Controls the display backlight on/off state for power management.

Benefits:

  • Power saving for battery devices
  • User comfort control
  • Gaming screen effects
  • Simple on/off control via GPIO

2. Gaming Performance Sample

Directory: samples/drivers/display/ili9341_gaming/

Complete sample application demonstrating:

  • Performance Testing: Full screen fill benchmark
  • Backlight Control: Power management demonstration
  • Color Verification: RGB color bar testing
  • Documentation: Hardware wiring, performance analysis, troubleshooting

Key Features:

  • Documents real-world gaming requirements (30/60 FPS targets)
  • Explains performance bottlenecks and solutions
  • Provides hardware setup guide for ESP32/ESP32-S3
  • Includes comprehensive README with AkiraOS context

Testing

Hardware Tested:

  • ESP32-S3 DevKitM + ILI9341 320x240 SPI display
  • ESP32 DevKitC + ILI9341 320x240 SPI display

Test Results:

Display device ready: ILI9341 (320x240)
Backlight GPIO configured
Full screen fill: ~350ms
Performance: Suitable for dirty rectangle optimization
Backlight control: Working

Sample Configuration:

  • Includes sample.yaml for CI testing
  • Platform-specific overlays for ESP32-S3
  • Documented in README.rst

AkiraOS Project Context

Project: https://github.com/ArturR0k3r/AkiraOS

AkiraOS is an open-source retro-cyberpunk gaming console featuring:

  • Zephyr RTOS as the core OS
  • ILI9341 320x240 display
  • ESP32-S3 microcontroller
  • Battery-powered portable design
  • Classic gaming library (Snake, Tetris, Space Invaders, etc.)

This contribution demonstrates how Zephyr enables innovative gaming projects while identifying areas for optimization.

Why This Sample Matters

  1. Gaming Use Case: First sample specifically addressing gaming performance
  2. Real Project: Documents actual production device requirements
  3. Educational: Helps developers understand ILI9341 performance characteristics
  4. Power Management: Shows practical backlight control implementation

Performance Analysis Included

The sample documents critical gaming metrics:

  • 30 FPS requirement: 33ms/frame budget
  • 60 FPS requirement: 16ms/frame budget
  • Current baseline: 350ms full screen update
  • Solution path: Dirty rectangle optimization needed

Files Changed

M  dts/bindings/display/ilitek,ili9341.yaml
A  samples/drivers/display/ili9341_gaming/CMakeLists.txt
A  samples/drivers/display/ili9341_gaming/README.rst
A  samples/drivers/display/ili9341_gaming/boards/esp32s3_devkitm_procpu.overlay
A  samples/drivers/display/ili9341_gaming/prj.conf
A  samples/drivers/display/ili9341_gaming/sample.yaml
A  samples/drivers/display/ili9341_gaming/src/main.c

Checklist

  • Follows Zephyr coding style
  • Includes comprehensive documentation
  • Tested on target hardware
  • Includes sample.yaml for CI
  • Signed-off-by present
  • References real-world project (AkiraOS)
  • No breaking changes

Related Issues

This addresses the need for:

  • Display backlight control in gaming applications
  • Performance benchmarking for gaming workloads
  • Documentation of ILI9341 gaming usage patterns

Future Work

Based on AkiraOS development, potential future enhancements:

  • Dirty rectangle optimization in display drivers
  • DMA-optimized SPI transfers
  • Frame buffer management utilities
  • Additional gaming-focused samples

@github-actions
Copy link

Hello @ArturR0k3r, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Add optional backlight GPIO control property to ILI9341 display binding.
This enables power management and user comfort features essential for
battery-powered gaming devices.

Developed during AkiraOS project - a retro-cyberpunk gaming console on
Zephyr RTOS. Backlight control is critical for battery life and user
experience in portable gaming applications.

Features enabled:
- On/off backlight control for power saving
- User comfort adjustments
- Screen effects in gaming applications

Example usage:
  &ili9341 {
      bl-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
  };

Tested-on: ESP32-S3 DevKitM with ILI9341 320x240 display
Project: https://github.com/ArturR0k3r/AkiraOS
Signed-off-by: ArturR0k3r <[email protected]>
@ArturSir ArturSir force-pushed the feature/ili9341-akira-gaming-optimizations branch from ba43095 to 7f7296e Compare November 11, 2025 09:48
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants