It looks very ineffective. For example, in fbg_draw() they have this code: https://github.com/grz0zrg/fbg/blob/master/src/fbgraphics.c#... > memcpy(fbg->buffer, fbg->disp_buffer, fbg->size); So they don't flip buffers, and don't even use video memory for them, they just copy data from buffer in main memory into a memory-mapped framebuffer. This must be slow. Also it doesn't check for vblank and therefore doesn't prot…
> and don't even use video memory for them, they just copy data from buffer in main memory into a memory-mapped framebuffer. This must be slow No, it is as fast as it gets and it's the correct way of doing it (in fb at least).
FBG – Lightweight C Linux framebuffer graphics with parallelism
41–50 of 50 posts
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#42Earlier quoted context omitted.
> and don't even use video memory for them, they just copy data from buffer in main memory into a memory-mapped framebuffer. This must be slow No, it is as fast as it gets and it's the correct way of doing it (in fb at least).
Linux frame buffer is perfectly capable of doing 2 pages and "flipping" without memcpy. Just have it initialize a double height virtual screen, and then use a panDisplay IOCTL to swap between them.
But yeah, don't expect smooth animations without a dual buffer.
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#43Earlier quoted context omitted.
The memory mapped frame buffer is video memory, that's why you have to use a driver API to map it. Though obviously on many systems it ends up just being system dram with different caching settings anyway. And this isn't something you'd code a game with, but you'd be surprised at how high modern memory bandwidth is.
Yeah, but linux framebuffer can do a very optimal swap... Just make the "virtual buffer" twice as tall, and then swap which "half" is "active" with a panDisplay IOCTL... That's why memcpy is such a bad idea, cause there is a very cheap method that can prevent tearing and such.
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#44It looks very ineffective. For example, in fbg_draw() they have this code: https://github.com/grz0zrg/fbg/blob/master/src/fbgraphics.c#... > memcpy(fbg->buffer, fbg->disp_buffer, fbg->size); So they don't flip buffers, and don't even use video memory for them, they just copy data from buffer in main memory into a memory-mapped framebuffer. This must be slow. Also it doesn't check for vblank and therefore doesn't prot…
VESA is suprisingly good with Haiku. Since most GPU manufacturers have ignored Haiku, the community has spent some time getting the VESA driver as good as it can get, and it is very respectable. Most users will not be aware that they are running VESA, since Haiku still less laggy than it's contemporaries.
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#45A suggestion for the benchmarks: add one where the screen is filled with a solid color. I was getting 175fps on 1280x768 with a 1.5Ghz AMD back in 2003.
However a single core memset (still RPI 3B) for this case is fast : 235 FPS
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#46A suggestion for the benchmarks: add one where the screen is filled with a solid color. I was getting 175fps on 1280x768 with a 1.5Ghz AMD back in 2003.
So, such a microbenchmark marks the baseline for how fast you could get via framebuffer. That's like 6 ms per frame. If you spend a bit less than two thirds of the time in rendering you could still get 60 fps. But that's still just crazy slow. The 175 fps at that resolution comes down to about 20-60 MB/s depending on display depth. Memory peak transfer rates were worst like that during the 1990's, then several hundre…
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#47It looks very ineffective. For example, in fbg_draw() they have this code: https://github.com/grz0zrg/fbg/blob/master/src/fbgraphics.c#... > memcpy(fbg->buffer, fbg->disp_buffer, fbg->size); So they don't flip buffers, and don't even use video memory for them, they just copy data from buffer in main memory into a memory-mapped framebuffer. This must be slow. Also it doesn't check for vblank and therefore doesn't prot…
VESA is suprisingly good with Haiku. Since most GPU manufacturers have ignored Haiku, the community has spent some time getting the VESA driver as good as it can get, and it is very respectable. Most users will not be aware that they are running VESA, since Haiku still less laggy than it's contemporaries.
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#48Earlier quoted context omitted.
> and don't even use video memory for them, they just copy data from buffer in main memory into a memory-mapped framebuffer. This must be slow No, it is as fast as it gets and it's the correct way of doing it (in fb at least).
Linux frame buffer is perfectly capable of doing 2 pages and "flipping" without memcpy. Just have it initialize a double height virtual screen, and then use a panDisplay IOCTL to swap between them.
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#49Earlier quoted context omitted.
Linux frame buffer is perfectly capable of doing 2 pages and "flipping" without memcpy. Just have it initialize a double height virtual screen, and then use a panDisplay IOCTL to swap between them.
Tried to implement page flipping today and performances are terribly low on the Raspberry PI due to direct draw calls to the video mapped memory... so you need to do a single memcpy to avoid multiple write to the video mapped memory, this result in the initial behavior.
Re: FBG – Lightweight C Linux framebuffer graphics with parallelism
#50Earlier quoted context omitted.
Tried to implement page flipping today and performances are terribly low on the Raspberry PI due to direct draw calls to the video mapped memory... so you need to do a single memcpy to avoid multiple write to the video mapped memory, this result in the initial behavior.
Generate single frame, copy to "off page", flip. This prevents tearing.