Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keybow 2040: Speed up RGB. #982

Merged
merged 7 commits into from
Jun 12, 2024
Merged

Commits on Jun 10, 2024

  1. Keybow 2040: Speed up RGB.

    Replace slow RGB wrapper for is31fl3731 driver with a custom implementation
    which double-buffers with two frames and writes pixels in batches (or all 144 in bulk).
    
    Speeds up default RGB breath effect from ~12FPS to ~60FPS.
    
    Fixes KMKfw#859.
    
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    0bf503f View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2024

  1. Keybow 2040: Run IS31 I2C at 400KHz.

    Speed up Keybow 2040 I2C further to ~5ms (200FPS) by increasing from the default 100KHz to 400KHz I2C.
    
    Since Keybow 2040 does not include a Qw'St connector, we need not worry about other I2C devices.
    
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    6eb9542 View commit details
    Browse the repository at this point in the history
  2. Keybow 2040: Simplify RGB data writes.

    Write all 144 LED values (only 48 are used) in one transaction.
    
    This is faster with 400KHz than trying to be smart.
    
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    36fde7d View commit details
    Browse the repository at this point in the history
  3. Keybow 2040: Further tiny RGB speedup.

    Speed up RGB a little more by skipping the first 17 and last few unused elements.
    
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    0b66a7c View commit details
    Browse the repository at this point in the history
  4. Keybow 2040: Further 30% speedup.

    Create the address lookup only once for a further 30% performance boost.
    
    Co-authored-by: xs5871 <xs5871@qn-4.net>
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid and xs5871 committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    bfbf0d0 View commit details
    Browse the repository at this point in the history
  5. Keybow 2040: use local scope for a small speedup.

    Bring references to the output buffer and address lookup into the hot path,
    gives around a .7ms speedup by using optimised (local scope first) qstr lookups.
    
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    281b027 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. Keybow 2040: drop double-buffering, simplify buffer output.

    Remove hot path conversion to bytes and drop double-buffering which had no visible impact.
    
    Reduce the size of the output buffer to remove leading 17 and trailing 4 bytes, and prime
    the buffer with the first LED address.
    
    Drop offset multiply and cache LED offsets in address lookup.
    
    Iterate through address lookup and unpack offset, r, g, b.
    
    Update time is now ~4ms and much more stable.
    
    Signed-off-by: Phil Howard <github@gadgetoid.com>
    Gadgetoid committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    dcaaae0 View commit details
    Browse the repository at this point in the history