4 ms·
Also, I'm curious about portable (i.e. across different Unixes) low-level graphics, if such a thing exists. I assume that the interfaces discussed here are Lin
by d_theorist 9y ago
Also, I'm curious about portable (i.e. across different Unixes) low-level graphics, if such a thing exists.
I assume that the interfaces discussed here are Linux specific, and the BSDs have something different.
Does POSIX have anything to say about graphics interfaces?
What is the lowest-level portable way to draw graphics? X11?
It's funny, because I always thought of X as being more of a windowing abstraction, rather than graphics in general. Perhaps I am making a distinction that does not really exist.
Obviously I am not a graphics guy :)
- shmerl 9y agoLooks like FreeBSD is following Linux design for DRM/KMS: https://wiki.freebsd.org/Graphics https://wiki.freebsd.org/Graphics
- panic 9y agoProbably because that's how the vendors distribute their proprietary drivers.
- shmerl 9y agoActually Nvidia blob didn't start using DRM/KMS until very recently. I think it's more because of Mesa. It makes sense for FreeBSD to leverage the major open project which does heavy lifting for graphics.
- kllrnohj 9y agoI don't think there is any common low level way, even among the Linux flavors. Android's graphics stack, for example, is completely different and doesn't use any of this. If you want portable you're going to want something like SDL probably.
- shmerl 9y agoAndriod is a weird deviation, and kind of annoying because the rift goes all the way to libc, which makes Android blobs incompatible without translation hacks like libhybris. If in case of GPU you can at least get something like Freedreno to avoid such hacks, but good luck getting open drivers for the modem and the like. So those blobs are a necessary evil for some devices to be usable, and there are none for glibc.
- kllrnohj 9y agolibhybris would still exist if Android had been running glibc. You still have architecture-specific stuff at the end of the day. Just like how XWayland exists to map X11 to Wayland, even though both use the same glibc. Looking through the source of libhybris it looks like very little of it has anything to do with bionic itself.
- shmerl 9y agoI thought its whole point is to work around idiosyncrasies of bionic, and translate it into glibc proper. Or you mean that Android drivers architecture is very different from proper Linux drivers?
- kllrnohj 9y agobionic is largely just a subset of glibc. There's not really any idiosyncrasies to workaround going from bionic to glibc (the hard part is the reverse as people commonly use non-portable glibc extensions) libhybris is more things like converting Surfaceflinger calls into Wayland ones. Looks like there's some media, camera, and input stuff, too, which is all outside the realm of bionic/glibc.
- pjmlp 9y agoYes completely different. This how the graphics stack look like on Android, a mix of Java, C and C++ code. https://source.android.com/devices/graphics/ https://source.android.com/devices/graphics/ https://source.android.com/devices/graphics/architecture https://source.android.com/devices/graphics/architecture
- 0xcde4c3db 9y agoThe BSDs and Solaris/Illumos have had DRM for years (where available), but it tends to lag the Linux version significantly because it's not trivial to port the code from Linux. I'm not sure where the compatibility breaks relative to the code given on the page, but most of them have some derivative of the original drm.h header that defines most of the structs and ioctls mentioned (e.g. [1] [2] [3]) [1] https://github.com/freebsd/freebsd/blob/master/sys/dev/drm/drm.h https://github.com/freebsd/freebsd/blob/master/sys/dev/drm/d... [2] https://github.com/openbsd/src/blob/master/sys/dev/pci/drm/drm.h https://github.com/openbsd/src/blob/master/sys/dev/pci/drm/d... [3] https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/io/drm/drm.h https://github.com/illumos/illumos-gate/blob/master/usr/src/...
- d_theorist 9y agoAh, thanks. Interesting.
- pjmlp 9y ago> Does POSIX have anything to say about graphics interfaces? Not at all. Writing 100% compliant POSIX code means sticking to the PDP-11 model of what an application is supposed to be, meaning either a terminal text application or a daemon. Anything graphical related is a separate standard. http://www.opengroup.org/standards/unix http://www.opengroup.org/standards/unix