dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.64k stars 115 forks source link

implement graphics on linux drm/kms console #1955

Open dankamongmen opened 3 years ago

dankamongmen commented 3 years ago

in addition to the framebuffer console of the old skool, we ought support modern DRM/DRI/KMS "dumb buffers", which look marvelously more complex than fbcon despite little payoff for this project (i.e., we'll need enumerate CRTCs, check to see which are connected, etc.).

https://www.kernel.org/doc/html/v4.17/gpu/drm-kms.html

It looks like there's some kind of plane abstraction, which might prove useful in terms of compositing.

I don't see this being a 3.0 item, but who knows?

dankamongmen commented 3 years ago

note that fedora36 intends to pull fbdev entirely in favor of simpledrm, so it's probably best to do this sooner rather than later. how much code can we share with the existing fb implementation?

dankamongmen commented 3 years ago

i think maybe libdrm can cut out a lot of the basic generic boilerplate crap for us?

dankamongmen commented 3 years ago

hrmmm we might get some FreeBSD console support! https://wiki.freebsd.org/Graphics#drm-kmod

dankamongmen commented 3 years ago

so it looks like doing this properly (i.e. with full hotplug etc.) involves installing a watch on /dev/dri (or maybe /sys/class/drm; will either work on freebsd)? a fd from each device ought be opened and fed through drmModeGetResources().

dankamongmen commented 3 years ago

we want #2310 for this

dankamongmen commented 3 years ago

my fedora VM seems to be simpledrm-only. hrmm, actually, there is a /sys/class/graphics/fb0/modes with the content 'U:1024x768p-0". name is qxl. why don't we pick this up?

dankamongmen commented 3 years ago

ahhh, not in the video group, dumbass asshole

dankamongmen commented 3 years ago

this is going to be a bigger PITA than perhaps originally thought. mpv -vo drm fails on a kmscon. i think it wants a raw instance, which is of very little use to us (maybe in a pure VGA VT?). the only drm terminal i'm aware of, kmscon, has been abandoned by upstream. moving back from 3.0.0.