Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Username1
Posts: 4
Joined: Thu Feb 05, 2026 2:39 pm

Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Postby Username1 » Wed Apr 22, 2026 6:36 am

Custom board with ESP32-S3-WROOM-1-N8R2 and SPI-connected (SDA, CLK, CS, DC) GC9A01 display driver for a 240 x 240 TFT display, using ESP-IDF v6.0.0, LVGL v9.5.0 and esp_lcd_gc9a01 v2.0.4.

I really need to know if it is possible to get rid of screen tearing, I tried single and double buffering with different sizes of buffers and all render modes, but I keep getting very bad screen tearing.

Can I sync the driver's read and write operations using SPI or is it just impossible?

Sprite
Espressif staff
Espressif staff
Posts: 10612
Joined: Thu Nov 26, 2015 4:08 am

Re: Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Postby Sprite » Thu Apr 23, 2026 1:44 am

Not really. Without an indication from the screen that it's safe to write (the GC9A01 driver has a TE output, but displays rarely bring this to the outside) you cannot make sure you're not writing in the middle of a screen update.

Username1
Posts: 4
Joined: Thu Feb 05, 2026 2:39 pm

Re: Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Postby Username1 » Thu Apr 23, 2026 6:05 am

Not even "manually" timing SPI communication to match display refresh rate?

Sprite
Espressif staff
Espressif staff
Posts: 10612
Joined: Thu Nov 26, 2015 4:08 am

Re: Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Postby Sprite » Thu Apr 23, 2026 8:36 am

Not even "manually" timing SPI communication to match display refresh rate?
Even if you were to match the display refresh rate exactly (frequency), you wouldn't know when the displays refresh clock has started (phase) so you still cannot find the moment where it's safe to refresh. And because the display doesn't really run off a stable clock, you can't even know the refresh rate in an accurate enough way.

By the way, there certainly are ways to make tearing look even more horrible. I know that if you set the display to write in a direction that is 90 degrees in respect to the direction it refreshes, the tears suddenly manifest as huge, diagonal lines, where otherwise they'd just show as a frame with half of the old and half of the new image showing. Not sure if that's what you're seeing.

Username1
Posts: 4
Joined: Thu Feb 05, 2026 2:39 pm

Re: Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Postby Username1 » Thu Apr 23, 2026 11:32 am

I'm trying to make a fade in fade out effect changing opacity, but i clearly see the display being updated top to bottom each frame, like old browsers used to do for images.

With this I see a more consistent and a "one shot" kind of refresh, where I lose some frame of the animation

Code: Select all

static void lvgl_task(void *args) {
    uint32_t time_till_next_ms = 0;

    for (;;) {
        xSemaphoreTake(lvgl_sem, portMAX_DELAY);
        time_till_next_ms = lv_timer_handler();
        xSemaphoreGive(lvgl_sem);

        time_till_next_ms = MAX(time_till_next_ms, LVGL_TASK_MIN_DELAY_MS);
        time_till_next_ms = MIN(time_till_next_ms, LVGL_TASK_MAX_DELAY_MS);

        vTaskDelay(pdMS_TO_TICKS(time_till_next_ms));
    }
}
With this i see the full animation but the tearing is inconsistent and based on render mode and buffers sizes it varies

Code: Select all

static void lvgl_task(void *args) {

    for (;;) {
        xSemaphoreTake(lvgl_sem, portMAX_DELAY);
        lv_timer_handler();
        xSemaphoreGive(lvgl_sem);

        vTaskDelay(pdMS_TO_TICKS(1));
    }
}

Who is online

Users browsing this forum: Google [Bot], meta-externalagent, Perplexity-User, PerplexityBot, Qwantbot and 3 guests