LCA: Graphics driver ponies
It has now been about a year since kernel mode setting (KMS) was merged into the mainline kernel. KMS ends the "mess" which came from having graphics drivers in user space; digging out of that particular hole took a good seven years or so. But now our graphics drivers are in the kernel, just like most other drivers.
Beyond cleaning up the mess, there are a few other good reasons for merging
KMS. One is that the system is now able to make full use of the
power-saving features of the hardware; before KMS, the kernel never really
knew enough about what was going on with the hardware to do this. The
Intel drivers can now perform as well as Windows with regard to power
saving; the ATI drivers, instead, are not quite there yet. Another nice
feature is the ability to use a kernel debugger on a system with graphics
running; it's now possible to trap into the debugger, then return to a
running system and have everything just work.
One of the reasons why KMS took so long to merge is that it places a number of new requirements on the kernel. At the top of the list is a proper manager for graphical memory. That's a hard problem, one that the graphics developers always intended to get to sometime Real Soon Now. Eventually the TTM developers got to it, but they quickly ran into a number of API difficulties. After some effort, the Intel developers decided that a generic approach to the memory management API wasn't going to work; out of that realization came the GEM memory manager, which only tried to solve the Intel problem.
Developers working on ATI chipsets, in turn, soon realized that GEM did not have the capabilities that they needed. So they went back to TTM, but not before bolting something that looks a lot like the GEM API onto it. TTM was recently merged, making KMS possible for ATI chipsets as well.
So what is coming? One future feature is the Gallium 3D architecture. Gallium, says Dave, is starting to work, but full functionality will take a while yet. Moving drivers to Gallium is going to be a painful exercise; there are already plenty of APIs that these drivers need to support. DRI2 is also coming along. This feature really needed KMS to work properly, especially when compositing is being used. There are still performance issues which must be resolved, though.
Another thing to look forward to is the Wayland display server. Wayland can be seen as a simpler, smaller replacement for X built on KMS. It can run GTK and GL applications now; there is also an X server emulator which can run on top of it. A few difficulties remain, including the fundamental fact that Wayland is not X; since X is the standard in this area, alternatives are going to be hard to sell. The Wayland developers also have not yet really dealt with the input problem, but input is a big piece of the X code. So Wayland, too, will be a while in coming; it may find its way into embedded situations first.
Dave spent some time on the current state of the graphics drivers. Intel, he says, is currently in the leading position. It supports KMS for everything - well, almost everything; the "chipset we won't name" (the proprietary GMA500) still lacks support. The driver is feature-complete, but Dave isn't quite ready to call it "mature"; another release or two will be required first. As discussed here previously, the driver will need to retain user mode setting (UMS) support for some time, but the current upstream X.org sources have already removed UMS from the X server.
The ATI/AMD drivers are further behind, but getting closer; this driver is harder than the Intel driver, due to the large number of chipset variations. Chipsets from R100 to R700 are currently supported; R800 support can be expected within a few weeks. The driver works "nearly as well as the old stuff" at this point; suspend and resume work better than before. Support for power-saving features is missing but expected for 2.6.34. The Radeon driver is currently in the staging tree, but it might move out before the end of the 2.6.33 development cycle.
What about the RadeonHD driver? That fork of the driver is primarily the result of a disagreement over the use of ATI's BIOS tables; the Radeon driver has an interpreter for these tables, while RadeonHD reimplements the functionality that those tables provide. Using the BIOS tables makes life a lot easier; it lets the driver ignore a lot of the details associated with different chipset variations. The BIOS table code is part of the KMS implementation which has been merged into the mainline; that should, Dave thinks, resolve this disagreement.
The "pony" displayed for the Nouveau discussion was a Trojan horse. Nouveau, of course, was merged for 2.6.33. The driver has just lost its user-mode support; it will be KMS only. Chipsets from the NV4 through the G80 are supported, with the final pieces to be filled in soon. The "ctxprogs" firmware is being figured out; the NV40 version has already been replaced with a rewritten, freely-licensed equivalent and NV50 is in the works. Dave noted that, whatever one thinks about NVIDIA's approach to working with the community, its hardware tends to be relatively good and easy to work with.
When Dave was asked about support for non-Linux systems, he replied that
most of them have been left behind at this point. There is, apparently, an
OpenSolaris port being done within Sun, but no code has been released from
that group. One other audience member asked about running X without root
privileges: that does work now, and Moblin is doing it. There are some
problems remaining, though, especially with fast user switching. In the
absence of a revoke() system call, there's no way to guarantee
that one user isn't listening in on another. Since revoke() is
known to be a hard problem, it's not clear how this issue will be
resolved.
Index entries for this article | |
---|---|
Kernel | Device drivers |
Kernel | Nouveau |
Conference | linux.conf.au/2010 |
Posted Jan 28, 2010 4:36 UTC (Thu)
by thedevil (guest, #32913)
[Link] (13 responses)
Posted Jan 28, 2010 5:01 UTC (Thu)
by BenHutchings (subscriber, #37955)
[Link] (7 responses)
Posted Jan 28, 2010 6:43 UTC (Thu)
by thedevil (guest, #32913)
[Link] (6 responses)
Posted Jan 28, 2010 13:29 UTC (Thu)
by xav (guest, #18536)
[Link] (4 responses)
Posted Jan 28, 2010 14:57 UTC (Thu)
by nix (subscriber, #2304)
[Link] (2 responses)
(but, yes, a nice fb console with huge numbers of rows and columns which
Posted Jan 28, 2010 21:52 UTC (Thu)
by michich (guest, #17902)
[Link] (1 responses)
Posted Jan 28, 2010 22:53 UTC (Thu)
by nix (subscriber, #2304)
[Link]
(though 800x600 is the last-ditch fallback resolution in any case, so
Posted Feb 2, 2010 1:38 UTC (Tue)
by Spudd86 (subscriber, #51683)
[Link]
Posted Jan 28, 2010 20:59 UTC (Thu)
by BenHutchings (subscriber, #37955)
[Link]
Posted Jan 28, 2010 7:42 UTC (Thu)
by airlied (subscriber, #9104)
[Link] (3 responses)
So just load it by default somewhere before X starts and get a hires console.
Posted Jan 29, 2010 5:05 UTC (Fri)
by thedevil (guest, #32913)
[Link] (2 responses)
I guess I should report this, but where?
Posted Jan 30, 2010 4:09 UTC (Sat)
by thedevil (guest, #32913)
[Link] (1 responses)
Posted Jan 30, 2010 11:36 UTC (Sat)
by chris.wilson (guest, #42619)
[Link]
config DRM_KMS_HELPER
Posted Feb 2, 2010 1:37 UTC (Tue)
by Spudd86 (subscriber, #51683)
[Link]
You CAN'T use both at the same time, KMS implies framebuffer console with the KMS based driver controlling it. (And vesafb should do nothing)
Posted Jan 28, 2010 10:56 UTC (Thu)
by epa (subscriber, #39769)
[Link] (2 responses)
Posted Jan 28, 2010 13:25 UTC (Thu)
by niner (subscriber, #26151)
[Link]
Posted Jan 28, 2010 14:25 UTC (Thu)
by corbet (editor, #1)
[Link]
Posted Jan 28, 2010 13:57 UTC (Thu)
by Tet (guest, #5433)
[Link] (10 responses)
I do wish they wouldn't do this. It essentially prevents me from using a recent kernel. With my card, KMS causes a segfault in the server, but it works just fine without KMS. I understand why they want to do it. The non-KMS code is messy, and they don't want to maintain it. But it works, in places where KMS currently doesn't.
Posted Jan 28, 2010 15:43 UTC (Thu)
by rahulsundaram (subscriber, #21946)
[Link] (5 responses)
Posted Jan 28, 2010 16:49 UTC (Thu)
by nix (subscriber, #2304)
[Link]
Posted Jan 29, 2010 21:08 UTC (Fri)
by Tet (guest, #5433)
[Link] (3 responses)
Posted Jan 30, 2010 6:03 UTC (Sat)
by rahulsundaram (subscriber, #21946)
[Link] (1 responses)
Have you reported your bug? We can debate on what is the right threshold but it is also the case as long as there are two different systems end users tend to switch between them and never report bugs
Posted Jan 31, 2010 16:21 UTC (Sun)
by Tet (guest, #5433)
[Link]
Posted Jan 30, 2010 18:48 UTC (Sat)
by nix (subscriber, #2304)
[Link]
However ATI have a crazy variety of cards, all wired up slightly
Posted Jan 28, 2010 19:34 UTC (Thu)
by jsbarnes (guest, #4096)
[Link]
Posted Jan 28, 2010 22:02 UTC (Thu)
by Thalience (subscriber, #4217)
[Link] (2 responses)
Posted Jan 28, 2010 22:59 UTC (Thu)
by nix (subscriber, #2304)
[Link] (1 responses)
Posted Feb 2, 2010 1:43 UTC (Tue)
by Spudd86 (subscriber, #51683)
[Link]
Posted Jan 28, 2010 15:56 UTC (Thu)
by ernstp (guest, #13694)
[Link]
It's all coming together very quickly now! I guess that's the benefit of having several full time employees working on this... :-)
(Not sent to Linus yet though)
Posted Jan 28, 2010 16:43 UTC (Thu)
by chrish (guest, #351)
[Link] (2 responses)
"One other audience member asked about running X without root privileges: that does work now, and Moblin is doing it. There are some problems remaining, though, especially with fast user switching. In the absence of a revoke() system call, there's no way to guarantee that one user isn't listening in on another."
Could someone expdand on the part in bold and describe in more detail what the problem is? Why would fast user switching cause a single fd to be allocated to processes belonging to different users?
Posted Jan 28, 2010 17:59 UTC (Thu)
by wingo (guest, #26929)
[Link]
At least this comment should provoke someone knowledgeable to correct me :)
Posted Feb 1, 2010 0:05 UTC (Mon)
by whot (subscriber, #50317)
[Link]
If the fd of a keyboard can be opened by a user, this user is able to read keyboard events. Example scenario:
Unless any process by user A can be suspended or revoked access to the fd, this process can sniff keyboard events from user B.
I have 2 comments about the ATI side.
1. I think what in the staging tree in 2.6.32 is just the option of making KMS the default. Even if you don't enable the staging tree at all you can already use KMS just by doing
LCA: Graphics driver ponies
echo 'options radeon modeset=1' >> /etc/modprobe.d/local-radeon.conf
2. I tried it, it works fine in X, and I see no problems as long as my virtual consoles start in old-fashioned text mode. They actually seem to be changed to an internal framebuffer mode as soon as I switch to them with Alt+Ctl+Fn . But I get a very unexpected result when I enable *both* KMS and vesafb. When I switch to a virtual console with Alt+Ctl+Fn, my monitor displays the "No signal" message and goes to sleep! So, based on this experience I am not going to use KMS quite yet.
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
I can tell with Radeon KMS there is no way: the resolution the monitor
prefers is always selected. This is normally fine for those of us with
LCDs, but for the poor sods stuck on CRTs it seems suboptimal.
does not bugger up X acceleration is a major plus of KMS. Another major
plus.)
Boot parameter LCA: Graphics driver ponies
video=800x600
works for me with Radeon KMS. See Documentation/fb/modedb.txt
.
LCA: Graphics driver ponies
obvious of places :)
perhaps not the best one to test with.)
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
tristate
depends on DRM
select FB
select FRAMEBUFFER_CONSOLE if !EMBEDDED
LCA: Graphics driver ponies
Unclear paragraph
KMS ends the "mess" which came from having graphics drivers in the kernel; digging out of that particular hole took a good seven years or so. But now our graphics drivers are in the kernel, just like most other drivers.
I don't understand - are the drivers in the kernel or not, and is this a mess?
Unclear paragraph
already reported that obvious typo. But it's still very early in the
morning over in the U.S.
That's a really silly mistake; I'm not sure how it got through. It's fixed now, sorry for the confusion.
Unclear paragraph
The driver has just lost its user-mode support; it will be KMS only
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
misdesigned. Multiple drivers in kernel and userspace arguing over a
single video card is pretty much obviously a bad idea. If video cards on
PCs had never been capable of displaying text, I suspect this design would
never have lasted as long as it has, at least on Linux: this meant that
most people could just use a text-mode console and pretend that there was
only one graphics driver, the 2D X one, when in fact the other driver was
in the video card...
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
reserved for compatibility checking) with its Radeon 9250 is quite happy
with KMS.
differently, and the pre-ATOM ones don't give the drivers much help to
fight through the morass. So, yes, report as a bug.
LCA: Graphics driver ponies
LCA: Graphics driver ponies
LCA: Graphics driver ponies
implement KMS over the course of many years are probably moribund anyway.
(The cynic in me would say that everything but Linux is pretty moribund as
an X server platform these days...)
LCA: Graphics driver ponies
LCA: Graphics driver ponies
http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6...
revoke()
revoke()
revoke()
1. user A logs in, /dev/input/event0 is opened as keyboard
2. user A starts keyboard sniffer on /dev/input/event0 because he or she has permissions to open this file.
3. user A uses fast user switching
4. user B logs in, /dev/input/event0 is opened as keyboard