From: Thomas Zimmermann <tzimmermann@suse.de>
To: Fabio Piparo <holofermes@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Javier Martinez Canillas <javierm@redhat.com>
Subject: Re: drm/ssd130x: stale pixels when the GPU renders into the framebuffer
Date: Mon, 14 Sep 2026 10:43:22 +0200 [thread overview]
Message-ID: <1f383114-e367-4b67-899b-14a393fece94@suse.de> (raw)
In-Reply-To: <CAB3Lz5ZuAJcgKpx0L-O3a-1psk+vwBMeH_Eux+OAgaYcyfFm6A@mail.gmail.com>
Hi
Am 13.08.26 um 06:27 schrieb Fabio Piparo:
> The symptom
> ===========
>
> I am working with a Raspberry Pi 5 driving a 128x32 SSD1306 over I2C
> through ssd130x, brought up with dtoverlay=ssd1306, and a GLES client
> rendering into it. The GPU renders straight into the panel's framebuffer.
> The panel shows a blocky pattern that is affected by CPU load. The kernel
> is 6.18.39.
>
> A capture:
>
> https://files.fabiopiparo.com/ssd130-line-glitch.webp
>
> This is a simple trail traveling left to right, and the busier the Pi is,
> the shorter the trail (link above). On an idle machine the leftovers build
> up into a blocky fog. That was the clue that pointed me at the CPU cache,
> since the lifetime of the artifact tracks memory pressure.
>
> The trace
> =========
>
> I made a test program that flips between two alternating solid frames
> while i2c_write payloads are traced. 15 of the 31 flushes carry bytes
> from both frames in one payload, mixed at 64 byte granularity.
I assume you write these frames quickly one after the other? As i2c is
really slow, you might write to buffers that are still being transferred
in the background.
Do you read back the status of the page flips? DRM should tell you when
it has completed transferring a frame. See [1]
[1]
https://elixir.bootlin.com/linux/v7.2.5/source/drivers/gpu/drm/drm_file.c#L85
Best regards
Thomas
>
> What appears to happen
> ======================
>
> My reading: the driver's XRGB conversion reads the framebuffer through a
> cached mapping while the GPU writes the same memory directly, so what
> reaches the panel is whatever lines the CPU still holds. The 64 byte
> granularity and the load dependence both fit that, and write-combining
> the mapping makes it stop.
>
> What stops it
> =============
>
> Setting shmem->map_wc in a .gem_create_object hook makes all the traced
> payloads come out as expected.
>
> Whether the exporter is the right place for this, I do not know.
>
> I am happy to test anything on this hardware and report back.
>
> Disclosure
> ==========
>
> The panel, the symptom and the i2c trace come from my own hardware. The
> analysis above and the change came out of a long debugging session with
> an AI assistant.
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-09-14 8:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 4:27 drm/ssd130x: stale pixels when the GPU renders into the framebuffer Fabio Piparo
2026-08-14 18:34 ` Javier Martinez Canillas
2026-09-14 8:43 ` Thomas Zimmermann [this message]
2026-09-23 16:00 ` Fabio Piparo
2026-09-29 9:04 ` Thomas Zimmermann
2026-09-29 21:50 ` Maíra Canal
2026-09-30 6:48 ` Thomas Zimmermann
2026-09-30 7:48 ` Javier Martinez Canillas
2026-09-30 8:32 ` Thomas Zimmermann
2026-09-30 13:49 ` Maíra Canal
2026-09-30 15:52 ` Javier Martinez Canillas
2026-09-30 18:45 ` Fabio Piparo
2026-10-02 8:18 ` Thomas Zimmermann
2026-09-30 19:57 ` Maíra Canal
2026-10-02 8:12 ` Thomas Zimmermann
2026-10-02 21:13 ` Maíra Canal
2026-10-06 6:50 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1f383114-e367-4b67-899b-14a393fece94@suse.de \
--to=tzimmermann@suse.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=holofermes@gmail.com \
--cc=javierm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.