Nouveau 的 DRM 组件将(可能?)进入 Kernel 2.6.33

{ 撰文/guest }

Nouveau 是一个开源的 Nvidia 显卡驱动。相比之下 Nvidia 的官方驱动不是开源的,而开源的 xf86-video-nv 功能又很弱。对比官方驱动,Nouveau 的优势在于支持新内核的 Kernel Mode Setting 特性。在 Fedora 12 中,使用 Nouveau 驱动启动内核后会第一时间直接进入显示器的最佳分辨率,启动界面(不论文本还是图形)与 X、GDM 之间的切换、用 Ctrl+Alt+Fn 在 X 和终端间切换完全的"flicker free",使用体验大大增强。

但是其 DRM 模块部分一直没有进入内核的代码树。昨天在 Phoronix 网上看到一则消息,大意是说 Linus 看 Fedora 提供 Nouveau 已经很长时间了,希望 Nouveau 的 DRM 也进入内核。Nouveau 的维护者和 Fedora 的维护者则解释说主要是由于 Nouveau 是依靠反向工程来了解 NV GPU 的某些内部机制的,使用了一些 Microcode,而这些 Microcode 相关的代码进入内核可能有版权问题。Linus 回复说这些理由都是 BS(从几次 Linus 的发言来看这位还真是"牛气"啊),Fedora 是不是完全没有版权问题的发行版?是那么上述理由就是 BS,否则以后发布就别分发 Nouveau 驱动。

今天又看到上面一则消息,这件事的下文是这样:红帽公司的 David Airlie 和 Ben Skeggs 对 Nouveau 的内核部分代码进行了修改,Microcode 将使用内核的 Firmware 接口来加载。这样就避免了版权问题。

接下来引用一句原文:

In this pull request, there is the Nouveau driver that is set to go in the Linux 2.6.33 kernel under the staging area

也许 2.6.33 中,我们就能用上正式进入内核的 Nouveau 驱动,获得各种新特性了。

PS: NV 官方驱动虽然不支持 KMS,但是支持 OpenCL(G80+),视频加速方面支持 XvMC(G80-)和 Vdpau(G80+)。对于这些功能,Nouveau 并没有支持。实际上连 3D 功能 Nouveau 也不直接支持。现在的发展趋势是由 Mesa 和其中的 Gallium3D 来提供 OpenGL(也许甚至是 D3D)、OpenVG、、OpenCL 的支持。显卡驱动仅仅完成与显卡的基本交互。最近 Kernel 的图像部分发展成为了亮点,page flipping ioctl 进入 2.6.33("据说"不论对于 X 还是 Wayland 都很有用),现在 Intel/ATI/NV 的 KMS 驱动又都不断完善,Linux 用户的图形体验必将逐步增强。

{ Thanks guest. }

Read More:

24 Comments

  1. 1 Iven Commented @ 2009-12-12 11:46Reply to this comment

    虽然用的 A 卡,还是来支持一下~开源驱动越来越棒了~希望 Linux 的图形体验的改观能够带来桌面游戏的发展……

  2. 2 ebird Commented @ 2009-12-12 12:05Reply to this comment

    强什么啊~ 现在F12默认设置的分辨率很高,弄得字符界面字体小得不得了! 我感觉又回到了十年前(当年装turbolinux 5的时候)……

    默认分辨率不准确,还不支持3D加速,放内核里干吗?! 想换掉都不容易~

  3. 3 eBuild Commented @ 2009-12-12 12:34Reply to this comment

    @ebird: 现在的Linux显卡驱动模式正在大调整啊,

    以后估计就要直接给内核写驱动,X就不管驱动,直接在Gallium3D上跑,就跟Vista/7、MacOSX那样,窗口系统成了一个DX或OpenGL应用程序了。

    可是Nvidia的人不积极,还大发雷霆,认为是冲着他们的闭源驱动来的,所以只有自己动手丰衣足食了……

  4. 4 Etrnls Commented @ 2009-12-12 12:58Reply to this comment

    @eBuild: 大发雷霆是哪里的话?nvidia的人没任何理由积极帮助Nouveau吧,而且据我所知,nvidia的人接受采访的时候说,nvidia的显卡驱动linux、windows、mac的版本公用的部分有90%,所以将现在的linux闭源驱动开源就意味着windows版的基本也就没有秘密了,对于市场竞争上很不利,而同时他们对于Nouveau的工作的态度是绝对不会打击,同时不会提出帮助。从Nouveau现在的状态来看,跟nvidia的驱动竞争还差的太远呢。

  5. 5 socket9999 Commented @ 2009-12-12 13:33Reply to this comment

    看过phoronix对nvidia公司负责linux驱动的员工的采访。问到nouveau时,人家说nouveau很好很强大,我们不打算干预,也不打算帮忙。

  6. 6 eBuild Commented @ 2009-12-12 13:42Reply to this comment

    不是说nv的人对nouveau很恼火,而是他们对Intel和ATi主导下搞的新的驱动模式很恼火(GEM+DRI2),从nvnews里的发言可以感觉到,当然说大发雷霆有点过了

  7. 7 zakarum Commented @ 2009-12-12 15:52Reply to this comment

    Nvidia恼火也是有理由的,由于不同平台的驱动公用比例比较大,开源是基本不可能。而由于N卡在3D图形工作站的市场份额非常高,其闭源驱动对于UNIX like平台的支持一直是比较积极的。现在社区把linux的图形架构搞的天翻地覆,尤其是后面有Intel和ATI主导。现在Nvidia面临着,要是开源,对于市场竞争不利;不开源,以后驱动这一块就会落后,UNIX like平台3D图形工作站的显卡份额必然要受到影响。

  8. 8 Pepino Commented @ 2009-12-12 16:43Reply to this comment

    这是那个Phoronix访谈中的两段:

    NVIDIA GPU software is organized with teams focused on developing the core cross-platform driver code base, teams focused on adding new GPU support to the core driver code base, and "solutions teams" focused on leveraging much of that core code and driving it in different markets (e.g., Notebook, Apple, etc). The NVIDIA Linux Graphics Driver Team is one of these solutions teams. With that structure of core, chips, and solutions, it isn't straightforward to compare sizes of the "Linux team" to the "Windows team".

    • For competitive reasons on other platforms, I don't think we would ever open source any of our cross-platform driver source code (which is 90%+ of the Linux driver... see my earlier description of code sharing). The Linux-specific pieces of the driver code base don't really stand on their own, and generally need to change in sync with the cross-platform code, so I don't believe it would be practical to just open source the Linux-specific pieces.

    真是成也萧何败也萧何啊

    因为nVidia的驱动有一个跨平台的核心代码库,无论是跨平台驱动开发,还是通过驱动为显卡增加新的功能和接口,都比对手容易,可是这样也缚住了自己的手脚……

  9. 9 kidfruit Commented @ 2009-12-12 17:17Reply to this comment

    其实我一直用nvidia官方的驱动,感觉良好…………

    nvidia的驱动架构还是挺好的,奈何Intel和Ati不想让nvidia一家独爽…………

  10. 10 飘风 Commented @ 2009-12-12 18:05Reply to this comment

    如果真的能进,相信对Nvidia官方驱动的开放性会有一些影响!

  11. 11 somebody(莫多) Commented @ 2009-12-12 18:27Reply to this comment

    真是好消息。 感觉现在用Linux最好还是集成显卡。都是驱动惹的祸。

  12. 12 lh Commented @ 2009-12-12 18:58Reply to this comment

    扯,ATI的驱动也并不是开放代码的吧,开放相应接口文档不就可以了,以什么驱动代码共用的原因不开放理由并不成立吧。

  13. 13 zakarum Commented @ 2009-12-12 19:20Reply to this comment

    @lh: A卡是把一个半成品的驱动扔给社区,然后就不管了。你看X11R7.5出来那么长时间了,A卡的私有驱动到现在都不支持呢。上X11R7.5的A卡用户只能用开源驱动。

    对比N卡,已经针对X11R7.5出了两个版本的驱动,并且把所有Legacy升级,以便让那些还在用老型号的用户也能上X11R7.5。

  14. 14 ccaaatt Commented @ 2009-12-12 19:35Reply to this comment

    已经提交了,staging Linus用过了 说不错 很高兴 http://lkml.org/lkml/2009/12/11/171

  15. 15 黑日白月 Commented @ 2009-12-12 19:43Reply to this comment

    @ebird:

    麻烦更新到新的 2.6.31.6-166 内核,改善了 nouveau 的很多问题。

    另外更改分辨率和字体大小在 Linux 下是件无比容易的事情……不必 Panic 的……

  16. 16 wulun Commented @ 2009-12-12 21:16Reply to this comment

    后娘养的ATI啊.........

  17. 17 syrano Commented @ 2009-12-12 21:19Reply to this comment

    @wulun: 如果用了KMS, nouveau就无法改分辨率了(即使分辨率是错的) 因为KMS下驱动不会再读取xorg.conf

  18. 18 黑日白月 Commented @ 2009-12-12 21:41Reply to this comment

    @syrano:

    “系统”-“首选项”-“显示”,这里不行么?那个工具不需要 xorg.conf 的啊……

    Nouveau 支持 XRander 的啊……不像 Nvidia Binary Driver。

  19. 19 liangsuilong Commented @ 2009-12-13 0:38Reply to this comment

    @ebird:

    那可能是你的显示器点距过小的问题...

    KMS 会把显示器分辨率调到标准分辨率下。如果你是用 21.5 寸的 16:9 宽屏显示器,确实是十分杯具的..

  20. 20 Kappa Commented @ 2009-12-13 15:18Reply to this comment

    访谈在此

    http://www.phoronix.com/scan.php?page=article&item=nvidia_qa_linux&num=1

  21. 21 qyb Commented @ 2009-12-15 9:26Reply to this comment

    据说 2.6.32 开始就能设置 console 的分辨率了: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git&a=commit&h=d50ba256b5f1478e15accfcfda9b72fd7a661364

  22. 22 Drivers Commented @ 2009-12-15 17:27Reply to this comment

    不知天杀的Via和Sis显卡情况怎样?

  23. 23 lophyxp Commented @ 2009-12-28 16:37Reply to this comment

    page flipping ioctl 功能据说要解决composize和显卡驱动之间的同步问题,将大不幅度提高显卡驱动对特效的速度和性能。很是期待啊。

  24. 24 ebird Commented @ 2010-02-15 15:58Reply to this comment

    @liangsuilong: 说对了,笔记本万恶的宽屏……

    @黑日白月: 当时刚装的时候kernel没update可用啊~等了好久,后来好了~

    不过现在偶早就用上nv官方驱动了,没这些问题了!