I'm writing code to run an old-style black&white vector game on a Pi Zero with a 3.5in LCD attached over SPI.
A few years back I would have used the fbcp-ili9341 driver but that is deprecated now. It worked by comparing framebuffer contents between frame updates and only sending the changed bits.
The driver we have now appears to send the entire framebuffer and I only get something like 5 FPS.
Since I know in my code the vectors I send on each frame, I don't need a general driver like that - if I could write directly to the display on one frame, I could save those vector endpoints and explicitly draw the same vectors again on the next frame, but in black, to erase the previous drawing before sending the new data. No framebuffer driver could do that as quickly because it would have to compare the old and new framebuffers first whereas I already know which pixels to wipe - they're the same ones I drew the first time (using a trivial Bresenham implementation).
So my question is, how do I write to one of these SPI displays directly, in the modern linux/Raspberry Pi world, without the need for a framebuffer and a background kernel process that's transferring from the framebuffer to the SPI screen? Just direct sending of pixel data over SPI... is there code you can point me at which will let me do that from my program directly?
I've looked, but all I could find were drawing examples that used framebuffer drivers like I'm currently using, or links to and old driver that is no longer compatible with the new KMS system.
The games need relatively few lines - they're wireframe and the number of white pixels in a frame is maybe only 1% of the screen. I *ought* to be able to run on one of these SPI displays at full FPS... (which for the moment is targetted at 30 fps, though 60 fps would be great).
I'm using a Zero 2W under bookworm, on a 320x480 3.5inch display with an ADS7846 touchscreen. I'm currently using the 'piscreen' driver and I'm not 100% sure which model the display is - it's hard to find. I actually have three different screens like this - some old, some new - that I could use and they're all compatible with the generic MHS035 drivers from lcdwiki. Most likely they're all ILI9341 compatibles.
Thanks for any help.
A few years back I would have used the fbcp-ili9341 driver but that is deprecated now. It worked by comparing framebuffer contents between frame updates and only sending the changed bits.
The driver we have now appears to send the entire framebuffer and I only get something like 5 FPS.
Since I know in my code the vectors I send on each frame, I don't need a general driver like that - if I could write directly to the display on one frame, I could save those vector endpoints and explicitly draw the same vectors again on the next frame, but in black, to erase the previous drawing before sending the new data. No framebuffer driver could do that as quickly because it would have to compare the old and new framebuffers first whereas I already know which pixels to wipe - they're the same ones I drew the first time (using a trivial Bresenham implementation).
So my question is, how do I write to one of these SPI displays directly, in the modern linux/Raspberry Pi world, without the need for a framebuffer and a background kernel process that's transferring from the framebuffer to the SPI screen? Just direct sending of pixel data over SPI... is there code you can point me at which will let me do that from my program directly?
I've looked, but all I could find were drawing examples that used framebuffer drivers like I'm currently using, or links to and old driver that is no longer compatible with the new KMS system.
The games need relatively few lines - they're wireframe and the number of white pixels in a frame is maybe only 1% of the screen. I *ought* to be able to run on one of these SPI displays at full FPS... (which for the moment is targetted at 30 fps, though 60 fps would be great).
I'm using a Zero 2W under bookworm, on a 320x480 3.5inch display with an ADS7846 touchscreen. I'm currently using the 'piscreen' driver and I'm not 100% sure which model the display is - it's hard to find. I actually have three different screens like this - some old, some new - that I could use and they're all compatible with the generic MHS035 drivers from lcdwiki. Most likely they're all ILI9341 compatibles.
Thanks for any help.
Statistics: Posted by gtoal — Fri Nov 21, 2025 8:53 am