linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	Dave Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org, dri-devel@lists.sf.net
Subject: Re: [git pull] drm request 3
Date: Fri, 5 Mar 2010 08:06:57 +1000	[thread overview]
Message-ID: <21d7e9971003041406n53d9cae0h53374abf3dca494e@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1003041142250.3751@localhost.localdomain>

> Can we try to make it less of a pain in the ass at some other level?
>
> For example, I realize that it's a real pain - both for the kernel _and_
> for the user space library - to dynamically have to support multiple
> versions of some interface.
>
> And doing it _statically_ (with a compile option) isn't much better,
> because you end up not only with source code from hell, you still end up
> with the problem of having to compile the libraries and the kernel for the
> same interface, and not being able to mix.
>
> So let's say that we live with an API that changes, where none of the
> binaries (and no single version of the source code either) really support
> anything but _their_ version of the interface.
>
> Why does it then have to be such an effing pain for the _user_?
>
> (And by being such an effing pain for the user, it also becomes indirectly
> a pain for the distribution too - now you have all those nasty
> dependencies where you really cannot mix things up at all, and you can't
> upgrade one piece without upgrading the other).
>
>> Now I can ask Ben if he'd like to try and supply a libdrm that could in
>> theory deal with both as a favour, but I'm not expecting the nouveau
>> project guys to care, we pretty much got ourselves into this corner, and
>> we'll pretty much have to get ourselves out.
>
> Quite frankly, I really don't think that's a wonderful option either.
> Havign dynamic conditionals in code not only makes things worse to
> maintain, they slow things down too, and make code bigger.
>
> So what I'd look for is a sane technical solution to the technical problem
> of "that ABI screwed up".
>
> And it's not like this is a new issue. We've had this several times
> before. It's called versioning, and the solution tends to pretty much
> _always_ boil down to two cases:
>
>  - don't _ever_ change the ABI in backwards-incompatible ways, and have
>   "feature flags" to say what level of support ther is.
>
>   This is quite common, but it really does require that backwards
>   compatibility. You can add features, but every time you add a feature,
>   you still maintain the old ones _and_ new users need to check the
>   feature flag first (and fall back on the old way of doing things if the
>   new feature isn't there)
>
>   Clearly this one doesn't seem to work for DRM. And quite frankly, I
>   suspect it's at least partly because some DRM people aren't even
>   _trying_ - possibly because they aren't even thinking about these kinds
>   of issues.

We've done this exactly like this since the drm went upstream, I think
there has been one interface incompatible change in the kernel drm since
it was upstream, in i810 back in the XFree86 days. KMS required new config
options since moving the card init into the kernel, was going to break
or be broken
by a userspace driver reiniting that card, and we've retained compatiblity
with older drivers fine.

So you are tarring the whole drm with the interface to one driver
which is clearly
marked as having an unstable ABI. Nouveau is different, they have had no
reason to version or make a stable interface until they could design
an interface
that would expose the features of the hw that they are trying to build
a driver for.
They've also used the timing to drop all support for legacy user modesetting
drivers while they could, before it was deployed on a lot of people's machines
in a lot of places.


>   I really don't understand why this wouldn't solve all your distro
>   problems, _and_ solve my kind of user problems too. It's simply not
>   acceptable to just say "ok, X doesn't work". Why aren't the libdrm
>   libraries simply _versioned_?

This would require redesigning the whole way distros build and distribute
packages. Having to build 4-5 versions of nouveau for each version of Fedora
would be a major increase in overheads for a minimal amount of return.

>
>   IOW, why can't we just have
>
>        /usr/lib64/xorg/modules/drivers/nouveau_drv-0.0.15.so
>        /usr/lib64/xorg/modules/drivers/nouveau_drv-0.0.16.so
>
>   living happily side-by-side? Why can't we just switch between Fedora
>   11, 12 and 13 kernels, and automatically get the right library? The
>   glibc people do it based on hardware features. It's just a "dlopen()"
>   away.
>
> This isn't rocket science. I shouldn't need to complain. I think it would
> make the life of even the _developers_ much easier.
>
> Who was the less-than-rocket-scientist that decided that the right thing
> to do was to "check the kernel DRM version support, and exit with an error
> if it doesn't match"?
>
> See what I'm saying? What I care about is that right now, it's impossible
> to switch kernels on a particular setup. That makes it effectively
> impossible to test new kernels sanely. And that really is a _technical_
> problem.
>
> Btw, I'm sure there are other approaches too. But I really suspect that it
> should be pretty trivial to change nouveau (and I suspect this has nothing
> nouveau-specific in it - it migth even be the X server itself that does
> the DRM version test) to instead of dying, just doing a dlopen() of the
> right version.
>
> Wouldn't the radeon and intel driver people love to be able to do
> something like that -too-?

Speaking as distro maintainer here,

No because we've got versioned interfaces and we are happy to support them
yes it would be nice sometimes to dream about this, but its a major explosion in
the testing matrix. You have to realise the more codepaths a distro ships, the
more codepath it has to keep track off for security issues, for bug fixes, etc.

When to we decide to stop shipping nouveau_drv-0.0.13? when do we find
out it has a security issue? Here's the thing, distros are trying to ship an
OS with a consistent set of packages, not a pick-n-mix.

I'm going to talk to Ben when we both make it to the same place, from a
nouveau point-of-view I'm quite happy what they've done is technically the
correct solution for them, because otherwise you end up with too many
versions of things to support, and you get distros who aren't willing to put
any developer effort into the project, shipping 3 different versions of things,
(this happens with binary drivers, and its a nightmare).

The thing with redesigning the whole stack like you say, its you are optimising
for the wrong use case, this isn't a common case, this is one off
event that we've
been forced into by merging nouveau upstream. I'd rather not optimise
for this case
if we can get away with it.

Dave.

  reply	other threads:[~2010-03-04 22:13 UTC|newest]

Thread overview: 147+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 23:56 [git pull] drm request 3 Dave Airlie
2010-03-04 18:18 ` Linus Torvalds
2010-03-04 18:27   ` Matt Turner
2010-03-04 18:36   ` Jesse Barnes
2010-03-04 18:39     ` Jesse Barnes
2010-03-04 18:51       ` Linus Torvalds
2010-03-04 18:56         ` Jesse Barnes
2010-03-04 19:08           ` Linus Torvalds
2010-03-04 19:25             ` Dave Airlie
2010-03-04 20:01               ` Linus Torvalds
2010-03-04 22:06                 ` Dave Airlie [this message]
2010-03-05  0:08                   ` Linus Torvalds
2010-03-05  0:28                     ` Ben Skeggs
2010-03-05  0:41                       ` Linus Torvalds
2010-03-05  0:56                         ` Luc Verhaegen
2010-03-05  1:08                           ` Linus Torvalds
2010-03-05  1:16                             ` Luc Verhaegen
2010-03-05  1:22                               ` Linus Torvalds
2010-03-05  1:20                             ` Linus Torvalds
2010-03-05  1:28                               ` Dave Airlie
2010-03-05  5:17                                 ` Linus Torvalds
2010-03-05  5:22                                   ` Dave Airlie
2010-03-05  5:30                                     ` Linus Torvalds
2010-03-05  5:42                                       ` Linus Torvalds
2010-03-05  1:19                         ` Upstream first policy Kyle McMartin
2010-03-05  1:28                           ` Linus Torvalds
2010-03-05  2:00                         ` [git pull] drm request 3 Tony Luck
2010-03-05 20:34                         ` Felipe Contreras
2010-03-05  6:49                       ` Ingo Molnar
2010-03-05  7:06                         ` Pekka Enberg
2010-03-05  7:17                           ` "C. Bergström"
2010-03-05  7:53                             ` Ingo Molnar
2010-03-05 15:18                             ` Linus Torvalds
2010-03-05  7:44                           ` Ingo Molnar
2010-03-05  7:58                             ` Dave Airlie
2010-03-05  8:16                             ` Stephane Marchesin
2010-03-05 10:00                             ` Making Xorg easier to test (was Re: [git pull] drm request 3) Carlos R. Mafra
2010-03-05 12:54                               ` Valdis.Kletnieks
2010-03-05 15:22                               ` Matt Turner
2010-03-05 15:41                                 ` Daniel Stone
2010-03-05 15:49                                   ` Making Xorg easier to test David Miller
2010-03-05 16:03                                     ` Alan Cox
2010-03-05 16:06                                     ` Daniel Stone
2010-03-05 17:50                                     ` Xavier Bestel
2010-03-05 17:54                                       ` David Miller
2010-03-05 18:02                                         ` Jesse Barnes
2010-03-05 18:05                                           ` David Miller
2010-03-05 15:53                               ` Making Xorg easier to test (was Re: [git pull] drm request 3) Linus Torvalds
2010-03-05 16:11                                 ` Daniel Stone
2010-03-05 16:30                                   ` Linus Torvalds
2010-03-08  8:57                                     ` Daniel Stone
2010-03-05 16:26                                 ` Jesse Barnes
2010-03-05 13:55                             ` [git pull] drm request 3 Luc Verhaegen
2010-03-05 16:21                             ` Jesse Barnes
2010-03-05 12:38                         ` Alan Cox
2010-03-05 14:37                           ` David Miller
2010-03-05 14:46                             ` Mike Galbraith
2010-03-05 18:05                               ` Ingo Molnar
2010-03-05 15:09                             ` Alan Cox
2010-03-05 15:11                               ` David Miller
2010-03-05 15:17                             ` Daniel Stone
2010-03-05 15:26                               ` David Miller
2010-03-05 15:40                                 ` Daniel Stone
2010-03-05 15:48                                   ` David Miller
2010-03-05 16:02                                     ` Alan Cox
2010-03-05 16:05                                       ` David Miller
2010-03-05 17:58                                         ` Younes Manton
2010-03-05 16:13                                       ` Linus Torvalds
2010-03-05 16:23                                         ` Alan Cox
2010-03-05 16:44                                           ` Linus Torvalds
2010-03-05 17:04                                             ` Alan Cox
2010-03-05 17:19                                               ` tytso
2010-03-05 16:04                                     ` Daniel Stone
2010-03-05 16:06                                       ` David Miller
2010-03-05 16:31                                         ` Alan Cox
2010-03-05 17:36                                           ` Jerome Glisse
2010-03-05 16:46                                       ` tytso
2010-03-05 19:38                                         ` Corbin Simpson
2010-03-05 21:01                                           ` Corbin Simpson
2010-03-05 21:51                                           ` tytso
2010-03-05 23:50                                             ` Tilman Schmidt
2010-03-05 17:23                                       ` Linus Torvalds
     [not found]                                       ` <hmra63$898$1@xyzzy.farnsworth.org>
2010-03-06  6:17                                         ` Dale Farnsworth
2010-03-06 17:21                                       ` Valdis.Kletnieks
2010-03-05 15:56                                   ` Luca Barbieri
2010-03-05 16:13                                     ` Alan Cox
2010-03-05 16:19                                       ` Linus Torvalds
2010-03-05 16:38                                         ` Alan Cox
2010-03-05 20:59                                         ` Felipe Contreras
2010-03-05 16:25                                       ` Luca Barbieri
2010-03-05 15:42                                 ` Alan Cox
2010-03-05 16:07                                 ` Linus Torvalds
2010-03-05 17:42                               ` Jeff Garzik
2010-03-05 19:11                                 ` Justin P. mattock
2010-03-04 19:33             ` Jesse Barnes
2010-03-04 19:12         ` Matthew Garrett
2010-03-04 18:45     ` Linus Torvalds
2010-03-04 18:43   ` Linus Torvalds
2010-03-04 18:50     ` Matthew Garrett
2010-03-04 18:55       ` Linus Torvalds
2010-03-04 19:01         ` Linus Torvalds
2010-03-04 19:04         ` Matthew Garrett
2010-03-04 19:14           ` Linus Torvalds
2010-03-04 19:25             ` Matthew Garrett
2010-03-04 19:41               ` Linus Torvalds
2010-03-04 19:53                 ` Matthew Garrett
2010-03-04 20:07                   ` Linus Torvalds
2010-03-04 20:46                     ` Matthew Garrett
2010-03-04 20:57                     ` Stephane Marchesin
2010-03-04 22:54                       ` Linus Torvalds
2010-03-04 23:03                         ` Dave Airlie
2010-03-04 23:19                           ` Linus Torvalds
2010-03-04 23:27                             ` Michel Dänzer
2010-03-04 23:28                             ` Linus Torvalds
2010-03-04 23:35                               ` Dave Airlie
2010-03-04 23:53                                 ` Linus Torvalds
2010-03-05  0:24                                   ` Ed Tomlinson
2010-03-05  0:24                                   ` Kyle McMartin
2010-03-04 23:28                             ` Dave Airlie
2010-03-04 23:05                         ` Jesse Barnes
2010-03-05 12:26                         ` Alan Cox
2010-03-04 22:28             ` Adam Jackson
2010-03-04 23:03               ` Linus Torvalds
2010-03-04 23:14                 ` Stephane Marchesin
2010-03-05 12:29                 ` Alan Cox
2010-03-05 16:18                 ` Adam Jackson
2010-03-04 19:32           ` Jeff Garzik
2010-03-04 22:18             ` Adam Jackson
2010-03-04 22:21               ` Jeff Garzik
2010-03-04 22:59                 ` Adam Jackson
2010-03-05 11:24                   ` Jeff Garzik
2010-03-05 15:46                     ` Adam Jackson
2010-03-05  1:47             ` Robert Hancock
2010-03-05 12:21             ` Alan Cox
2010-03-05 19:30               ` Eric Anholt
2010-03-05 20:39                 ` Luca Barbieri
2010-03-06 15:23     ` Sergio Monteiro Basto
2010-03-06 17:40       ` Linus Torvalds
2010-03-06 19:06         ` Sergio Monteiro Basto
2010-03-06 19:28           ` Linus Torvalds
2010-03-06 20:49             ` tytso
2010-03-06 20:52               ` Alan Cox
2010-03-06 22:38                 ` tytso
2010-03-04 21:21   ` Maarten Maathuis
2010-03-04 21:22     ` Maarten Maathuis
2010-03-04 21:27   ` Maarten Maathuis
  -- strict thread matches above, loose matches on Subject: below --
2010-03-05 22:18 Jonas Ritz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21d7e9971003041406n53d9cae0h53374abf3dca494e@mail.gmail.com \
    --to=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sf.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).