!SfJCDXZbMHXkPovtKL:matrix.org

Rust Embedded Graphics

324 Members
Help and chat for embedded-graphics and the wider embedded Rust graphics ecosystem | https://github.com/embedded-graphics/embedded-graphics | https://crates.io/crates/embedded-graphics27 Servers

Load older messages


SenderMessageTime
11 Nov 2024
@almindor:matrix.orgalmindorthat's what I planned as a super low hanging fruit improvement00:18:46
@almindor:matrix.orgalmindor you can then just do let di = SpiInterface::with_buffer_size::<256>(spi_device, dc); kind of thing 00:19:15
@grantm11235:matrix.orgGrantM11235A user provided slice can be more dma-friendly00:19:20
@almindor:matrix.orgalmindoralthough providing a buffer is even better coz if there's DMA to be done manualy or such00:19:27
@almindor:matrix.orgalmindoryeah00:19:29
@almindor:matrix.orgalmindori wonder considering the use case here (e.g. fill_solid) if the buffer should also be made accessible00:21:18
@grantm11235:matrix.orgGrantM11235 You mean like so you can "save" a buffer full of BLACK somewhere to reuse later? 00:22:32
@almindor:matrix.orgalmindorno, more so that we don't waste memory re-buffering00:22:51
@almindor:matrix.orgalmindorif DI is given a buffer, then mipidsi inside fill_solid for example shouldn't make a new buffer00:23:06
@almindor:matrix.orgalmindorit'd mean we can OOM00:23:12
@grantm11235:matrix.orgGrantM11235mipidsi shouldn't have it's own buffer for fill_solid, it should just tell the interface to do that00:23:58
@almindor:matrix.orgalmindoryou mean repeat_pixel call00:24:10
@grantm11235:matrix.orgGrantM11235yeah00:24:18
@almindor:matrix.orgalmindoror I guess more like "repeat data"00:24:26
@almindor:matrix.orgalmindorhmm that works, but isn't it kind of very specific?00:24:36
@almindor:matrix.orgalmindorfeels like we're outsorcing graphics logic to the interface at that point00:25:00
@grantm11235:matrix.orgGrantM11235The interface is in the best position to decide whether to buffer the data or not. For example, a non-dma parallel interface wouldn't waste time or memory filling a buffer, it would just send the data out pixel by pixel00:28:07
@almindor:matrix.orgalmindortrue, it does mean we want to have a good enough "intention retention" in the API00:29:09
@almindor:matrix.orgalmindorI think that in combination with a BE default storage for pixel data could be a nice win00:29:31
@grantm11235:matrix.orgGrantM11235I'm not sure how much switching to BE would save. I think it should only add one instruction per pixel, which at 320x240 and 160mhz, is only 0.48ms. That's the difference between 60fps and 58.3fps00:40:52
@almindor:matrix.orgalmindorstill, why do LE if almost all displays expect BE?00:41:49
@grantm11235:matrix.orgGrantM11235It would make it more expensive to manipulate the green value, but I'm not sure how common that is00:46:24
@grantm11235:matrix.orgGrantM1123516bit parallel interfaces would prefer native endian, not to mention all the framebuffer-in-ram e-g impls on bigger chips and on desktop00:53:09
@almindor:matrix.orgalmindorI think it should be a switch00:54:42
@almindor:matrix.orgalmindornot sure if it'd be easy to expose on "globally" for e-g though, might not be worth it00:55:02
@almindor:matrix.orgalmindorit'd also have to be accessible compile time inside, so that the drivers could just go "ah native, cool don't process, just send"00:55:31
@dark_therion:matrix.org@dark_therion:matrix.org left the room.03:13:15
@almindor:matrix.orgalmindor GrantM11235: well, I was able to get https://github.com/almindor/mipidsi/pull/145 in. It's not particularly great looking but it does the job with minimal duplication, speed went down from 48ms to 18ms (pure buffer fill is 12ms) 20:26:48
@almindor:matrix.orgalmindora bigger rewrite is warranted with DI as well as some better design wrt. buffer usage overall20:27:04
@almindor:matrix.orgalmindor i'm still unsure if I want the repeat_pixel_to_buffer optional or not for Models. forcing it seems better so there's no "unoptimized path" for fill_solid, on the other hand it'd mean incompatibility with existing external models and a major version bump 20:31:28

Show newer messages


Back to Room ListRoom Version: 5