|
|
Log in / Subscribe / Register

Graphics drivers and the BSDs

By Jake Edge
October 15, 2014

X.Org Developers Conference

At one time, the BSDs and Linux shared a fair amount of graphics code, in the form of direct rendering manager (DRM) drivers. There was a common core that could be used by both Linux and various BSD flavors, along with operating-system-specific parts, all housed in the same tree. That changed in 2008, when the DRM tree moved into the Linux kernel tree; that move was done to rationalize DRM development, but had the side effect of cutting the BSDs adrift to some extent. Representatives from three of the BSDs came to the X.Org Developers Conference (XDC) to talk about where things stand with DRM drivers for their flavor.

FreeBSD

First up was Jean-Sébastien Pédron, who described the state of the FreeBSD graphics stack. After the DRM drivers moved into the Linux kernel, kernel mode setting (KMS) became mandatory, which added more changes to the drivers. In addition, over time newer hardware was only supported by the Linux drivers—at least for Intel and, later, AMD. NVIDIA provides a binary driver for FreeBSD, but Intel and AMD do not target any of the BSDs with their open-source drivers. FreeBSD did not participate in the development of those drivers since they are essentially Linux-only.

[Jean-Sébastien Pédron]

In 2012, the Intel i915 KMS driver from the 3.2 (or, possibly, 3.4) Linux kernel was imported into FreeBSD. As part of that, the developers made a copy of the old DRM code into a new drm2 directory in the FreeBSD kernel tree. Features that were required to support the i915 hardware were added to the DRM device-independent code. The use of Linux-specific APIs and data structures was converted to use FreeBSD equivalents. That driver was available in FreeBSD 9.1.

Similarly, the AMD Radeon KMS driver from Linux 3.8 was imported into FreeBSD's tree, along with the Translation Table Maps (TTM) memory-management layer for DRM. Pédron, who did the port, made some additions to the DRM device-independent code and changed Linux-isms to their FreeBSD counterparts. That was released as part of FreeBSD 9.3.

Those two drivers suffered from a number of problems, the biggest of which was the "gratuitous changes all over the place", he said. The use of FreeBSD APIs and data structures, variable renaming, and an incomplete implementation of DRM all make it difficult to import new code from the Linux drivers.

Recently, he has been working on updating the i915 code. That work is close to completion. He has also synchronized the device-independent DRM code with the version in Linux 3.8. In the longer term, he plans to use a Linux API wrapper to make it easier to bring changes over from Linux, but he will need to convince the other FreeBSD developers in order to do so. He would also like to get rid of the code duplication by merging the drm and drm2 source trees.

That was the major problem with graphics in the FreeBSD kernel, Pédron said, but there is a second problem: it lives in the ports tree that is used to package third party applications for the distribution. The ports tree is a repository of makefiles and patches that can be built and installed with a single make command, though there are higher-level tools available as well. One of the great features of the ports tree is that all of the packages can be installed for any version of FreeBSD that is still being supported, he said. So older FreeBSD versions still have access to recent versions of applications. But there is a downside to that: the package needs to be able to handle missing features in earlier releases.

The differences in the driver support for FreeBSD releases has led to problems in the ports tree. New X server and Mesa versions require certain i915 and Radeon driver versions, but the ports tree is not set up to handle those kinds of dependencies. A hack was made using a build-time flag in the tree, WITH_NEW_XORG, to build the more recent versions of the graphics stack.

That hack caused a number of problems; it was a "nightmare" to maintain and test, and was confusing for users. That led to fewer updates in the graphics stack to try to reduce the complexity. It also caused unrelated packages (the X server and Mesa) to be upgraded in lockstep, which should have been unnecessary. It was, in short, a "fiasco", he said.

Recently, a problem cropped up with version 1.12 of the cairo graphics library and the older Intel driver that would crash the X server. That, it appears, was the straw that broke the camel's back; the older graphics stack has been dropped from FreeBSD. It took a lot of work to convince the developers to do so, however.

The FreeBSD graphics team is small, with just two kernel and two ports developers, not all of whom are fully dedicated to graphics work. There is a lack of X11 expertise and of understanding of the graphics stack, Pédron said. Users are scared of graphics updates, as are the developers. Those updates tend to be "large and tricky", jumping over multiple versions, rather than smaller, incremental changes. Another problem is that many FreeBSD developers do not use the graphics stack for their development systems; they often use Mac OS X instead.

There has been little effort to work with the X community, but Pédron and others are trying to change that. There is an effort to participate more on the mailing lists, for example. His XDC talk is another attempt to reach out to the community. The wiki page on the graphics stack is the best place for those interested to see where things stand. A quarterly report of progress and plans for FreeBSD graphics will also be published.

In the future, there are plans to sync the FreeBSD drivers with those in a more recent Linux kernel (3.10 perhaps). As time allows, he would like to work on adding DMA-buf support as well as working on udev and an alternative to systemd-logind to be able to run X as a non-root user. Wayland is in the plans as well. He finished by noting that the FreeBSD graphics developers wanted to work more closely with X.Org in the future, which was an idea that seemed to be well-received by those in attendance.

DragonFly BSD

Up next was François Tigeot from the DragonFly BSD project. He has worked on the project since 2011. DragonFly was forked from FreeBSD in 2003 and aims to be "high performance and scalable".

[François Tigeot]

The first "tentative" effort at porting the Linux DRM/KMS drivers to DragonFly was a Google Summer of Code (GSoC) project in 2010. The project was not well managed, but the student eventually got something to work using a Linux compatibility layer. Tigeot was never able to reproduce the results and suspects it only worked on the student's hardware.

So, in 2012, he started working on porting the i915 driver from FreeBSD, which shares some kernel APIs with DragonFly. By the end of 2012 it was mostly ported, but it took until mid-2013 to actually get it working. It required some cache management changes to the DragonFly kernel. After that, he switched to porting the Radeon driver and TTM layer, which was mostly ported by October 2013. By July 2014 the Radeon driver was working reliably, he said.

FreeBSD dropped the ball, though, Tigeot said, and there were no significant updates to the i915 driver after 2012. The latest supported hardware was Ivy Bridge. He started rebasing on the Linux i915 driver in September 2013 with a goal of providing Haswell support for DragonFly.

He chose the Linux 3.8.13 i915 driver as the basis for his work. 3.8 has the first known working Haswell support in Linux, but there were other reasons to choose that version. The Radeon port was based on 3.8, as was OpenBSD's Intel driver. Since OpenBSD has the best DRM implementation of the BSD family, using the same version made sense, he said.

There are a number of problems with the FreeBSD i915 driver, including having two DRM directories (as Pédron mentioned) with most of the code duplicated between them. In addition, the FreeBSD developers rewrote the entire driver to conform to FreeBSD's coding style, which resulted in lots of white space differences. Functions were renamed and moved around, file names were changed, and so on. He cleaned a lot of that up, reducing the diff size from 50K lines of code to 22K.

Much like the GSoC student's approach, Tigeot chose to use a Linux compatibility layer. Many of the linux/*.h header files were taken from the FreeBSD InfiniBand stack, which also has a Linux compatibility layer. Some APIs were taken from OpenBSD and others were implemented specifically for DragonFly.

Graphics drivers are a complex and fast-moving target, so it makes more sense to just use the Linux APIs. In a way, he said, he was porting DragonFly to the DRM drivers, rather than porting the drivers to the OS. There is not enough developer time to do otherwise. The major exception is for locking primitives, which are best converted to the DragonFly equivalents.

There were a number of trouble spots, including the Graphics Execution Manager (GEM) layer, which is quite different in the FreeBSD driver vs. Linux. By August of this year, he had the driver working reliably on Haswell hardware.

On the user-space side, DragonFly switched to using the FreeBSD ports tree (with an adaption layer) in 2013. It is "much better" than the previous package management system and brings more up-to-date code with it (e.g. X server 1.12). Unfortunately, the FreeBSD ports tree is beginning to lag a bit. It took years to go from cairo 1.10 to 1.12, for example.

The current state is that the i915 driver is mostly in sync with the Linux 3.8.13 version, except for the GEM code. It is "functionally equivalent to Linux on most paths", Tigeot said. In addition, the Radeon DRM driver is mostly in sync with Linux 3.8 and TTM with Linux 3.9. The generic DRM code is "a mess", with a few parts up to 3.8.13 and other parts much older (< 2.6.26).

Future plans are to bring the generic DRM code up to Linux 3.8, then to start upgrading both DRM and drivers to more recent versions. With TTM working properly, Nouveau could be ported to DragonFly fairly easily as well. Either restoring text mode or adding a graphical TTY layer is another task that needs some work; currently exiting the X server goes to a blank screen or frozen image. In answer to a question from the audience, Tigeot said that he did not have any benchmarks of the drivers, but that the performance was not a problem for day-to-day use.

OpenBSD

The final *BSD representative was Matthieu Herrb, who gave a presentation about the status of the OpenBSD graphics stack. OpenBSD split off from NetBSD (which was the only major BSD variant not represented at XDC) in 1996. One of its claims to fame is its support for many different architectures including some that are not particularly mainstream any more (VAX and Sequent, for example).

[Matthieu Herrb]

OpenBSD already supports bitmap consoles, which makes it easier for it to adopt KMS, he said. Another difference for the project is that it includes X as part of the base system, rather than in its ports tree, which means that it is more closely integrated with the kernel and the rest of the system. Like the other BSD variants, OpenBSD has a ports tree for third party software like GNOME, KDE, Firefox, LibreOffice, and so on.

Herrb last gave a status report at FOSDEM in early 2013, so this talk was an update since then. Most of the user-space components are more recent versions than those used by the other BSDs (e.g. Mesa 10.2.7, X server 1.16.1, etc.), though the DRM/KMS drivers for Intel and Radeon are also based on the Linux 3.8 versions. One downside to importing Linux code is that it won't be reviewed by OpenBSD kernel developers because they won't read code that does not conform to the BSD coding style.

The OpenBSD graphics stack (aka Xenocara) has more features than other systems, he said, including support for graphics on non-x86 architectures. The wscons console driver is integrated with KMS. It has hotplug support for input devices, though there is no keyboard support in the wscons X driver (xf86-input-ws). The X server runs with privilege separation, so the main server does not run with privileges and there is no aperture driver for KMS. OpenBSD uses the CWM window manager, which only uses BSD-licensed libraries; that requirement rules out most other window managers.

There are a number of "missing parts". OpenBSD is planning to switch away from GCC for building the base system, but that has not yet happened, so there is no LLVM package available. That means there is no support for Gallium software rendering. Even when the base system gets LLVM, it will be an older version, while Mesa uses the most recent, so there may need to be two versions supported.

Thread local storage (TLS) is not supported in the GLX driver and there are some issues with futexes and shared-memory fences (xshmfence) that need to be resolved. There is no support for multi-touch, yet, nor any Nouveau support. The latter should be easier since TTM support was added for the Radeon driver.

All of those things are on the radar for future work, as is updating to later versions of the Linux drivers, which "should not be too hard", Herrb said. Moving the input drivers to be more similar to the Linux evdev model is also planned at some point.

He noted a few difficulties, including that some of the KMS drivers are GPL-licensed. There is also a perception in the BSD community that Linux is slowly drifting away from the traditional Unix model with projects like systemd and Wayland. That scares some BSD users, he said. Lastly, there is a lack of developer time to work on these projects.

The latter seems to be a common concern among the three presenters. Graphics is a complex area that requires a lot of developer time to keep up with new hardware support, but the BSDs are fairly small projects—and there are at least four of them. The tone in the room suggested that the X developers are willing to help, to the extent they can, but that there are a number of political, social, licensing, and technical hurdles that only the BSD projects themselves can surmount.

[ I would like to thank the X.Org Foundation for travel assistance to Bordeaux for XDC. ]

Index entries for this article
ConferenceX.Org Developers Conference/2014


to post comments

Graphics drivers and the BSDs

Posted Oct 16, 2014 8:31 UTC (Thu) by Thue (guest, #14277) [Link] (28 responses)

> There is also a perception in the BSD community that Linux is slowly drifting away from the traditional Unix model with projects like systemd and Wayland.

Uhhh.

systemd is a bunch of binaries working together and developed in sync. Just like the BSDs. systemd is just a smaller more focused project than the BSDs. The BSDs say that is not the traditional UNIX model? Because systemd has not gobbled up enough functionality to be as large as a BSD?

The xorg project is a huge many-headed monster, which includes font management and the kitchen sink. Very much not the UNIX way of doing one thing and doing it well. Wayland is the replacement doing one thing, and doing it well. Certainly that is the UNIX way?

What are the BSD guys talking about?

Graphics drivers and the BSDs

Posted Oct 16, 2014 9:27 UTC (Thu) by NAR (subscriber, #1313) [Link] (1 responses)

I think their point is that "a traditional UNIX (model) has X and init" while Linux is getting rid of both nowadays. I think their point is not that systemd or X follows a "traditional UNIX model".

Graphics drivers and the BSDs

Posted Oct 16, 2014 10:37 UTC (Thu) by anselm (subscriber, #2796) [Link]

I don't think BSD actually even has the sort of “init” that Linux is now getting rid of.

Graphics drivers and the BSDs

Posted Oct 16, 2014 10:46 UTC (Thu) by njd27 (subscriber, #5770) [Link] (1 responses)

Oddly, the way that systemd is developed, with all the low-level system plumbing in one single repository, is actually drifting back towards what BSD does with a single repository for their base system.

So on one hand, we have the BSD folks telling us that it's the UNIX philosophy to develop everything together, and on the other hand we have people saying that it's the UNIX philosophy that everything is separate little projects. Who to believe!

Graphics drivers and the BSDs

Posted Oct 16, 2014 13:37 UTC (Thu) by ortalo (guest, #4654) [Link]

Unix is the collective thought I guess. And the collective is Unix.

(No, I am not writing this from a Borg cube currently in space over your head - though it could sensibly be the case - or not sensibly.)

Graphics drivers and the BSDs

Posted Oct 16, 2014 14:45 UTC (Thu) by nelljerram (guest, #12005) [Link] (1 responses)

I think what they mean is that the traditional Unix model is to fork the OS into several subtly incompatible projects, and thereby have to implement new technology work in N different ways instead of just one.

</sarcasm>

I'm sorry; but I find it hard to care about *BSD folk having to do catch-up work, when their main feature (as a loosely defined community) seems to be the divisiveness that causes more catch-up work to be needed.

Linux's killer feature is, indeed, that it has drifted away from this.

Graphics drivers and the BSDs

Posted Oct 23, 2014 2:39 UTC (Thu) by ThinkRob (guest, #64513) [Link]

> I'm sorry; but I find it hard to care about *BSD folk having to do catch-up work, when their main feature (as a loosely defined community) seems to be the divisiveness that causes more catch-up work to be needed.

That's a rather negative outlook, frankly.

There are plenty of features that make the various BSDs attractive. Just because they're not something that you're interested in doesn't mean that their existence and different design is inherently negative (which is certainly what your comment implies.)

Graphics drivers and the BSDs

Posted Oct 16, 2014 21:44 UTC (Thu) by wahern (subscriber, #37304) [Link] (21 responses)

systemd relies heavily on Linux-specific features. Software which depends on, e.g., cgroups and KMS (KMS is effectively more than simple mode setting at this point, and marks the shift toward doing more graphics work in the kernel), is really difficult to port. These aren't quirky system calls; these are complex subsystems.

If I had to guess what was meant by "Unix model", it would be do the minimum necessary in the kernel, and nothing more. We can quibble about what necessary means, but clearly the BSD folks perceive many projects relying, directly or indirectly, on Linux-specific kernel features in a way that leaves them out in the cold. At some point portability between BSD and Linux could end up looking like portability between Linux and Windows.

And systemd isn't just a bunch of binaries working together. All those "separate" binaries heavily use shared libraries implemented under the systemd umbrella. For example, Lennart reimplemented libevent. And Lennart has specifically stated that he sees no value in portability to non-Linux systems, period. He's balls-to-walls Linux, without hesitation. And he's not interested in making helping others port his software, either. (By contrast, I too use my own custom event and timing loop library--like him I wanted an API that fit my preferred design patterns better and which was easier to maintain--but it actually happens to work on most modern Unix systems, not just Linux.)

That means that as GNOME and KDE increasingly rely on systemd components, they become more difficult to port to BSD. And because systemd is not now nor will ever be portable, not even the bits that aren't Linux specific, that means the BSDs need to reimplement many of these components from scratch, or at least fork them, whereas once upon a time they could have ported and maintained them with comparative ease.

I love Linux. And I love the various BSDs. I use them all and try to keep my software, especially open source software, as widely portable as practicable. But I definitely think that Linux developers fetishize the kernel more than most. Linus & Co push back, but they can only slow the trend down and try to channel the efforts.

When Linux developers scratch an itch, they more often attempt to do so in the form of a kernel module or kernel-focused architecture than their counterparts in BSD-land or who are more concerned with portability. And as Linux has been commercialized this trend has increased, because commercial developers _definitely_ fetishize kernel programming, as if it somehow makes their code magically more robust and performant.

I'm not trying to say that these differences in culture are like night & day. (Feel free to attack that strawman if you wish.) But these differences are real, and they're creating a chasm between Linux on the one hand, and everybody else on the other, with systemd (for obvious reasons, not the least of which is Lennart's expressed disinterest in portability) at the epicenter. And it has little to do with the value of systemd per se, but with how the ecosystem is evolving. Unlike earlier times, where portability was considered virtuous, Lennart, RedHat, and a growing community of others openly discourage portability as a waste of time.

Many LWN readers are of the same mind as Lennart and RedHat. That's your choice, and it's not a choice that is prima facie wrong--reasonable people can disagree on the value of portability. But don't feign ignorance at why these developments might cause consternation outside of the Linux bubble.

Graphics drivers and the BSDs

Posted Oct 16, 2014 22:11 UTC (Thu) by jspaleta (subscriber, #50639) [Link] (10 responses)

Have you followed the debian alternative kernel porting effort at all for hurd or bsd? Even stoggy old well understood sysvinit relies on linuxisms and cross kernel compatibility with existing default init systems normally used for OSes built around each kernel have never been practical drop-in replacements for each other on different kernels.

I mean seriously... it you want to talk about the unix-way as practised.. then init implementations have always been heavily coupled to specific kernel features. The sysvinit that does exists for debian-bsd and debain-hurd is not as complete as you would hope. sysvinit still uses linux specific apis. BSD and Hurd have just grown compatibility layers to provide the linux API sysvinit expects to see.

For reference:
https://teythoon.cryptobitch.de/posts/on-portability-of-i...

So BSD kernels could very well grow the ability to run systemd the same way they've grown the ability to run sysvinit...but building a compatibility layer to provide the expected and required linux APIs.

As it went for sysvinit cross-kernel support so it can go with systemd. This is well trod ground, and systemd is not setting a precendent here by requiring something BSD nor Hurd provide.

-jef

Graphics drivers and the BSDs

Posted Oct 16, 2014 23:44 UTC (Thu) by lsl (subscriber, #86508) [Link] (9 responses)

It might be that no one cared about the portability of sysvinit because there were no application-level developers depending on sysvinit-specific features. You could just run Gnome on BSD running BSD init. Apparently, that's no longer an option with recent Gnome versions. Sure, some other implementation could provide those interfaces. It seems to me, though, that there's no universal agreement on the extent of APIs an operating system is supposed to provide to applications.

In the past the system interface amounted to something vague commonly called the Unix API, some of it formalized by SUS and some of it just common wisdom about what things a reasonable Unix variant is supposed to provide. If an application wanted to use interfaces not part of this common subset (like e.g. epoll/kqueue), it usually did (and was expected to do) the necessary portability work so it would still run on any decent Unix(*).

Now there are people claiming that this common API is no longer appropriate for today's applications. Others disagree with that. That's the sticking point IMHO.

(*) with varying interpretations on what exactly "decent" means here

Graphics drivers and the BSDs

Posted Oct 17, 2014 0:31 UTC (Fri) by anselm (subscriber, #2796) [Link]

There are two points worth reiterating here:

  • Linux is probably the last Unix-like system that still actually uses sysvinit, therefore anything that sysvinit provides can no longer reasonably be considered part of the portable “decent Unix API“. Consequently, it's not as if making your software sysvinit-ready is going to help you all that much when you want to port it to other Unixes.
  • By far most of GNOME actually does not depend on systemd in any way, shape, or form, so not having systemd isn't that much of an impediment to running GNOME on a non-Linux system.

Graphics drivers and the BSDs

Posted Oct 17, 2014 0:45 UTC (Fri) by jspaleta (subscriber, #50639) [Link] (6 responses)

you know you should really look at the state of applications prior to the introduction systemd and assess how linux specific it was already and how far the other kernel communities had to go to mimic linux API to get complicated things like KDE or GNOME to work.

For example, the same compatibility layer which sysvinit requires to implement the linuxism of /proc on BSD is the same compatibility that GNOME dependencies like policyKit and consolekit required. I want to stress that the codebase that logind is replacing was already required linuxisms that BSD did not share. BSD had to provide a compatibility layer that implemented linux's proc. And now in the brave new world of today... for BSD to remain relevant it will have to provide a cgroups compatibility layer or not. Everything old is new again.

I mean seriously.. systemd isn't breaking any new ground with a lack of cross-compatibility. There was never cross-compatibility that is being bantered about. BSD and Hurd have both been compelled ti grown linux API compatibility layers to cover "just enough" linuxisms in the past to get important end-user applications working to stay relevant. The momentum shifted years ago. Now those compatibility layers will need to grow to include at least cgroups API compatibility. All we are doing is wringing our hands and playing a bit of brinksmanship trying to decide whose on the hook for doing that compatibility work. Pretty sure the history on this is clear... the other kernel communities are going to have to find the manpower to mimic cgroups...just like they did with procfs..to stay relevant.

-jef

Graphics drivers and the BSDs

Posted Oct 23, 2014 2:45 UTC (Thu) by ThinkRob (guest, #64513) [Link] (5 responses)

> the other kernel communities are going to have to find the manpower to mimic cgroups...just like they did with procfs..to stay relevant.

This is correct provided that your definition of "to stay relevant" is read as "to continue running complex desktop environments".

While this may be your definition, I'm not sure that it's everyone else's.

Graphics drivers and the BSDs

Posted Oct 23, 2014 7:05 UTC (Thu) by rodgerd (guest, #58896) [Link] (4 responses)

If you think that cgroups are useful only for desktop environments I can only assume you don't have meaningful depth or breadth of experience in server environments.

Graphics drivers and the BSDs

Posted Oct 23, 2014 20:13 UTC (Thu) by dlang (guest, #313) [Link] (3 responses)

cgroups are very useful in some server environments and worse than useless in others.

If you have many competing applications on a server that you need to isolate from each other, cgroups can be useful.

But if you are in the situation where you instead have many servers running the same application, then the overhead that cgroups impose on that application far outweigh any benefits they may provide.

So assuming that all servers will benefit from cgroups also shows a lack of "depth or breadth of experience in server environments." (in other words, back off a bit and assume that the other people have a point rather than assume that they are ignorant or outdated)

Graphics drivers and the BSDs

Posted Oct 23, 2014 20:19 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

So don't use cgroups, then. Systemd doesn't require any controllers to be attached to its cgroups tree so the resulting overhead is negligible.

Graphics drivers and the BSDs

Posted Oct 23, 2014 20:34 UTC (Thu) by dlang (guest, #313) [Link] (1 responses)

actually, I've heard that there is a significant amount of overhead to having cgroups compiled in, even if no controllers are in use. This is one of the complaints that the kernel folks have about cgroups. They let it in on the "well it has no effect if it's compiled out" logic, and the lesson of cgroups is why they are shifting from that logic to requiring that a new feature have minimal effect if it's compiled in, but not enabled.

Graphics drivers and the BSDs

Posted Oct 23, 2014 20:35 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

I think there's overhead if memcg is used and especially with swap accounting. But it's negligible if you don't turn it on.

Graphics drivers and the BSDs

Posted Oct 17, 2014 3:49 UTC (Fri) by raven667 (guest, #5198) [Link]

> You could just run Gnome on BSD running BSD init. Apparently, that's no longer an option with recent Gnome versions.

That's not actually true, GNOME is very much supported on BSD, you can google the release notes and find this stuff which explicitly mentions fixes for BSD

http://www.gnome.org/press/2014/03/gnome-3-12-released-wi...

Graphics drivers and the BSDs

Posted Oct 16, 2014 23:43 UTC (Thu) by johannbg (guest, #65743) [Link] (4 responses)

Hmm interesting response and repeated synonyms of Lennart and Red Hat which somehow indicates it's his and Red Hat's initial ideas so please provide a reference where Red Hat "openly discourage portability as a waste of time" which should prove an interesting read.

Graphics drivers and the BSDs

Posted Oct 17, 2014 1:24 UTC (Fri) by wahern (subscriber, #37304) [Link] (3 responses)

Given that Lennart is an employee of Red Hat, and so Red Hat has some say in the strategic direction of the Linux Desktop, I think it's sufficient to quote Lennart. See, e.g., https://archive.fosdem.org/2011/interview/lennart-poettering

That said, I didn't mean to say that Red Hat as a corporation is entirely opposed to portability across the board. The context of the discussion related to graphics drivers, and by extension the desktop.

Red Hat engineers actively participate in POSIX. Heck, most of the additions to POSIX 2008 were from Red Hat employees. Large parts of the GNU toolchain are actively maintained to be portable, and Red Hat employs many GNU toolchain engineers. Red Hat develops JBoss so it works well on Solaris and Windows.

I'm not trying to bash systemd or Red Hat. I'm trying not to over-generalize, which is hard to do when examining the ephemeral open source software community and the ill-defined dynamics at play. Part of me not trying to over generalize is to pinpoint deliberate decisions, and there's no avoiding coming back around to systemd and Lennart. It's not a criticism of systemd or Lennart. The systemd developers in particular, and the Linux desktop community in general clearly prefer to focus--exclusively or nearly exclusively--on Linux. And that preference has consequences for non-Linux users, especially given the size of the respective communities.

Apple and Microsoft don't care about the Linux or BSD desktop either. That doesn't make them Wrong or Right. But once upon a time the Linux and BSD desktop communities shared the same boat and the same fate. It increasingly looks like they're parting ways, which will make life harder for one community and more convenient for the other.

Graphics drivers and the BSDs

Posted Oct 17, 2014 3:36 UTC (Fri) by raven667 (guest, #5198) [Link] (2 responses)

That's not entirely true, the GNOME developers have invested in a BSD test environment within the last year or two and made automated testing on BSD part of their normal code validation process so the reality is exactly opposite of your fears, BSD is getting more attention and not less, it just doesn't' have the same level of session management and multi-seat as Linux supports.

Graphics drivers and the BSDs

Posted Oct 17, 2014 21:47 UTC (Fri) by wahern (subscriber, #37304) [Link] (1 responses)

I never said that GNOME developers had no interest in portability. Lennart has zero interest in portability, but I never said Lennart and GNOME developers were in lock-step.

And how did you get from "not entirely true" to "the reality is exactly opposite of your fears"? I think it's fairly self-evident and uncontroversial that the focus of KDM and GNOME has been on Linux, particularly in the last decade. But that's different from being opposed to portability. Do you use a BSD? Have you listened to the complaints of their ports maintainers? KDE and GNOME are reasonably responsive, but they're not interested in dropping everything just so the BSDs can catch up with the changes that have been sweeping through, such as in graphics support and system configuration.

And if the BSDs were getting more attention than they were before, why are they troubled by the direction things are going? Feel free to put forth your own examination. I can only assume it would be along the lines of "the BSD developers' fears are unfounded". In other words, brushing aside their concerns.

Also, these aren't my fears. I don't even use a Linux or BSD desktop. I use OS X (I'm content with TeXShop, a browser, and terminal windows--OS X is more stable for my work habits, but I'm seriously considering switching to a Chromebook), and use Linux and BSDs as servers. It's also why I care very little about systemd. I write network software for a living and systemd does almost nothing for me. I don't rely on killall to bring down my services, and I find it trivial to do daemonization and privilege separation as a practical matter, even portably. My init.d scripts simply forward the start/stop/restart command to the daemon directly, without any bash hocus-pocus. Many of my daemons are multi-process, and systemd couldn't handle that aspect of process management even if I wanted it to. Rearchitecting things just to take advantage of systemd would make things stilted and more complex. Plus, they need to be portable, including to Linux systems that lack systemd, like most embedded Linux systems.

From my perspective, the benefit of systemd is almost entirely on the desktop. It's on the desktop that you can have dozens of independent background processes with complex interdependencies but little explicit cooperation between them, and where systemd can beneficially provide the loose coupling needed. On the server such complexity doesn't usually exist in practice, and you have other problems if it does exist (like security).

Graphics drivers and the BSDs

Posted Oct 18, 2014 2:35 UTC (Sat) by raven667 (guest, #5198) [Link]

I may have been responding to a different comment, on re-reading I don't see how my comment relates to yours either. *sigh* You are right in that there is no grand conspiracy to disenfranchise the BSDs, there are just vastly more resources in the Linux ecosystem because that is where the developers and business is at.

Graphics drivers and the BSDs

Posted Oct 17, 2014 10:18 UTC (Fri) by Thue (guest, #14277) [Link] (4 responses)

> If I had to guess what was meant by "Unix model", it would be do the minimum necessary in the kernel, and nothing more. We can quibble about what necessary means

If there ever was a fundamental driver feature that deserved to live in a kernel driver, it was display mode setting.

And remember, in "traditional UNIX" X has always run as root, which has always been insane. With KSM and systemd, it can be done without.

https://fedoraproject.org/wiki/Changes/XorgWithoutRootRights
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582041

I am getting the strong feeling that this is all about the BSDs not wanting to implement the new interfaces because it is a lot of work, not because the new interfaces are worse than the old ones.

Graphics drivers and the BSDs

Posted Oct 17, 2014 21:16 UTC (Fri) by wahern (subscriber, #37304) [Link] (1 responses)

OpenBSD's X runs without root privilege, has done for years, and it was relatively easy to accomplish. It didn't happen before simply because of lack of attention, not because of some limitation in the design of X. OpenBSD preferred to keep things as confined to userland as practicable. The Linux developers were less hesitant to move things into kernel space. Preferences matter.

And as I said, at this point KMS is more than simply switching the mode of the graphics card, because now KMS is just a subcomponent of DRM. Arguably this mission creep is what OpenBSD was trying to avoid. OTOH, from the Linux perspective moving to the kernel provided more opportunities, at least more convenient opportunities.

But I'm not saying that the original idea of KMS is the wrong balance, even from a global, multi-kernel perspective. I agree that many things are definitely better done in the kernel. The issue is how much you keep in the kernel. Look at something like cgroups: even the core Linux kernel developers argue that currently cgroups does too much (thus the recent, excellent LWN series on process accounting), but the systemd developers keep wanting to pile on more features into the kernel subsystem. It may be optimal from a Linux-only perspective, but it's definitely less optimal from a portability standpoint.

In an ideal world, the community would get together and hash out a more limited interface which minimizes the amount of work being done in the kernel. The most obvious solution is to implement process descriptors and build a framework around that, including ancillary kernel APIs (such as fork events which queue up process descriptors for privileged listeners, to fix the race condition when doing process accounting in userland). That might result in removing some of the features that cgroups currently now provides.

But that ship seems to have sailed. He who does the work usually gets the final say, and nobody has been building the alternative. Lennart & Co has actually been putting good work on the table, including building services that make life easier for GNOME and KDE developers. The Linux graphics developers are much more productive and prolific than their counterparts in BSD land. And so all their preferences will steer the Linux desktop into the future, and that direction can't help but make life more difficult for the BSDs.

Graphics drivers and the BSDs

Posted Oct 17, 2014 22:36 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]

> OpenBSD's X runs without root privilege, has done for years, and it was relatively easy to accomplish.
Incorrect. While OpenBSD had a non-root X-server, it was (and still is!) a sham because it has direct access to hardware.

> But I'm not saying that the original idea of KMS is the wrong balance, even from a global, multi-kernel perspective.
KMS is about as minimal as it can be, while still supporting all the existing hardware features.

Graphics drivers and the BSDs

Posted Oct 20, 2014 15:44 UTC (Mon) by zlynx (guest, #2285) [Link] (1 responses)

> And remember, in "traditional UNIX" X has always run as root, which has always been insane.

If you want to get really traditional, Solaris on Sparc has always used the kernel to control the graphics modes, provide framebuffer devices and run X as a regular user.

At least that's how I remember it.

Graphics drivers and the BSDs

Posted Oct 23, 2014 3:54 UTC (Thu) by acoopersmith (subscriber, #72107) [Link]

Correct - Solaris on SPARC had the login process chown /dev/fb* and the input devices to the user, and put all register access in the kernel fb drivers so that the X server didn't need to run as root.

I believe pretty much all the traditional Unix workstations worked this way, and running the X server as root to access the hardware directly was a creation of the initial ports to x86 in the early 90's and spread from there.


Copyright © 2014, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds