Re:Intro to Low-Level Graphics on Linux
by simplicio on Thursday August 31, 2017 @10:29AM
(#15140549)
Yea, I think ioctl is probably the most elegant solution. The fact that hardware has a wide-variation in properties, requests, etc. mean some part of the interface is going to be inelegant and case dependent. ioctl at least puts all that variation behind a single system call.
Just look at the absolute abortion that is "netlink". Very deeply nested structures with self-referencing pointers and sizeofs everywhere. You are looking at 300 LoC for the most trivial operations unless you want to use a shitty (like extfs tools shitty) library.
I actually prefer the ioctl, it keeps the insanity in check of these structure astronauts that gave us netlink.