News for hackers. Stuff that matters.
Re:Programming the Linux Framebuffer by megous on Wednesday January 31, 2018 @04:24PM (#16277681)
I'd say it's better to use DRM, it's more flexible, and you'll end up with framebuffer in the end too. It will allow you to use different pixmap formats, layers, double buffering, etc.

And even if you don't want GUI framework, and want to write your app differently, you can start with cairo and pangocairo or something similar, so that you don't have to care about low level drawing primitives.

Re:Programming the Linux Framebuffer by zokier on Wednesday January 31, 2018 @04:50PM (#16277851)
Doesn't DRM take over the whole display, requiring you then to manage delegating buffers to clients and essentially recreating Wayland?

Also, the whole clock is basically 100 lines of fairly straightforward code in all its glory. How much would a DRM/Pango/Cairo soultion weight?

Re:Programming the Linux Framebuffer by revelation on Wednesday January 31, 2018 @05:39PM (#16278198)
No one wants window management in the kernel, so yeah, the assumption is that there is one master that decides what buffer(s) are scanned out. That said, DRM is the only way to use the hardware compositors found on many mobile chips, which allow you to rotate, resize and blend together multiple buffers on the fly to produce the final display.

A minimal DRM example isn't much more, by the way:

https://github.com/yuq/gfx/blob/master/drm/main.c

And this does a lot more stuff that you want, like what connectors (think HDMI or LVDS internally) does my hardware have, which of those have displays connected, what modes are supported by those displays, and it can be very easily extended to do 3D rendering.

Beyond the HW planes, there is lots of stuff DRM enables that you simply can't do with /dev/fb but absolutely want, like true VSync synchronized rendering.

Re:Programming the Linux Framebuffer by megous on Wednesday January 31, 2018 @05:33PM (#16278152)
My somewhat equivalent code for working with double-buffered version of display code using DRM is about 200 lines of C. But that includes some abstraction and a lot of error checking/logging.

I'm not sure why you'd need to replicate anything complicated like wayland. You can use DRM API just like you'd use /dev/fb0, it just has more options/features.

As for cairo, obviously it's a heavier solution, but also more featureful, optimized and output neutral.

Re:Programming the Linux Framebuffer by zokier on Wednesday January 31, 2018 @06:30PM (#16278534)
I guess the main question is can you simply overlay stuff on top of Linux console (presumably fbcon) with DRM? That is kinda the key thing here, and the examples I've seen have always just done full-screen stuff.
Re:Programming the Linux Framebuffer by jwilk on Wednesday January 31, 2018 @06:36PM (#16278572)
Show us the code. :)