lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.12k stars 200 forks source link

Bus_Parallel16 doesn't appear to support non-windowed GFX functions #255

Closed bitbank2 closed 2 years ago

bitbank2 commented 2 years ago

I just got the MakerFabs ESP32-S3 board with 16-bit parallel ILI9488 LCD. The demo sketch works to display the logo bitmap, but is very slow because it uses pushImage() to send each line of the BMP file to the display. This causes an address window of 1 line to be set, as well as RGB888 to RGB565 color conversion:

for (int row = 0; row < Y; row++)
{
    f.read(RGB, 3 * X);
    lcd.pushImage(0, row, X, 1, (lgfx::rgb888_t *)RGB);
}

I tried using the non-window GFX functions like pushPixels(), pushColor(), etc. and none of them work with the 16-bit parallel LGFX class. Is there a function which works with the 16-bit parallel class and gets maximum performance by just writing raw RGB565 pixels?

Thank you

lovyan03 commented 2 years ago

・なぜあなたはIssueテンプレートを無視しているんですか? ・デモスケッチとはどれのことですか? ・私の環境ではpushPixels、pushColorは動作していますが、動作しないとはどういう意味ですか? ・非常に遅いとはどの程度遅いのですか?

bitbank2 commented 2 years ago

Here is the demo code: https://github.com/Makerfabs/Makerfabs-ESP32-S3-Parallel-TFT-with-Touch/tree/main/firmware/SD16_3.5 I'm using the latest release of LovyanGFX

The display update is MUCH slower (> 10x) because each line calls setAddrWindow() internally. I tried the pushPixels and pushColor functions and they have no effect (no pixels are transmitted to the display). I tried adding startWrite()/endWrite) and the functions still did not work. All I want to do is be able to send raw pixels a line at a time without setting the address window too.

lovyan03 commented 2 years ago
#define LGFX_USE_V1
#include <LovyanGFX.hpp>

#include "your setting header.h"

static LGFX display;
static uint32_t count = 0;
static lgfx::swap565_t linebuffer[2][256];

void setup(void)
{
  display.init();
  display.setColorDepth(16);
  display.startWrite();
}

void loop(void)
{
  ++count;
  display.setAddrWindow(0, 0, 256, 256);
  for (int y = 0; y < 256; ++y)
  {
    auto buf = linebuffer[y&1];
    for (int x = 0; x < 256; ++x)
    {
      buf[x] = lgfx::swap565(x+count, x+y+count, y+count);
    }
    display.pushPixelsDMA(buf, 256);
  }
}

https://user-images.githubusercontent.com/42724151/176569982-1fba1751-68a5-49b0-b99a-bd37ec64fd97.MOV

bitbank2 commented 2 years ago

That worked - thank you It must have been the order of operations I tried before.