diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-09-02 17:42:08 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-09-02 20:33:15 -0700 |
commit | 708c062b08a70ecfb0ef3db23f8d770c312ed827 (patch) | |
tree | 3bcf223ebda065949d04efd9776c98f6364ee596 /README.historic | |
parent | fe9eca2f7fd3e65c7bfbecfcf485b8eff9c633a8 (diff) |
doc: write a new more current README
Also renamed old README to README.historic instead of deleting
it, for posterity, in case anyone wonders why some things are the
way they are - simpler times.
Diffstat (limited to 'README.historic')
-rw-r--r-- | README.historic | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/README.historic b/README.historic new file mode 100644 index 0000000..a63c4f9 --- /dev/null +++ b/README.historic @@ -0,0 +1,35 @@ +This is a quick little graphics hack I put together to experiment with libdrm +and this "dumb buffer" thingy David Airlie added to the kernel back in 2011. + +If you're like me and miss the pre-KMS days of functional SVGAlib on linux +where we could write purely software-rendered graphics toys like demos that +were still beautiful and synchronized to vertical retrace without any tearing +or flickering, there is cause to rejoice. + +Using libdrm and these two ioctls: +DRM_IOCTL_MODE_CREATE_DUMB +DRM_IOCTL_MODE_MAP_DUMB + +We can then mmap into our address space a 32bpp buffer that can be drawn to +while off-screen, and submitted to the gpu for displaying in a page-flipping +fashion, synchronized to the vertical retrace. It's revisiting the 90s, it's +VESA 2.0 linear frame buffers but actually supporting all our crazy native +resolutions and abundant memory for 32bpp with page flipping. + +In my testing so far, this seems to work without even requiring root. + +Before you try to run these things, realize this is direct libdrm graphics, +it's going to compete with your X/wayland server. Switch to a plain virtual +console to run the program. You don't need to quit X, just switch away from the +X vt so it's not visible. + +To quit it's as simple as Ctrl-C, rototiller will otherwise run forever. + +Do not try switching back to X while rototiller is drawing, Ctrl-C it first, or +X will get angry and exit when it tries to do drm things and can't. + +Your display may be left in an inconsistent state after exiting rototiller. +Don't panic! Just switch virtual consoles or go back to X, graphics will be +restored. This seems like a bug in drm to me. It's genuine SVGAlib dejavu, +corrupt displays and all. BUCKETS OF NOSTALGIA + |