Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 80722 - [PATCH] xorg-x11: Don't build MESA if nvidia card owner
Summary: [PATCH] xorg-x11: Don't build MESA if nvidia card owner
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-04 07:39 UTC by Prakash Punnoor
Modified: 2005-02-06 22:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
nvidia use patch (xorg-nvidia.diff,1.26 KB, patch)
2005-02-04 08:28 UTC, Prakash Punnoor
Details | Diff
build minimal drivers with nvidia (xorg-nvidia-driver.diff,505 bytes, patch)
2005-02-04 11:14 UTC, Prakash Punnoor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Prakash Punnoor 2005-02-04 07:39:42 UTC
If you are an nvidia binary driver user, so don't need mesa for accelerated glx, so this can be skipped emerging xorg-x11, which saves time and a bit of space. A minor problem is, that glxgears and glxinfo are not build, neither, perhaps this could be done using a seperate patch?

At least here is my proposed patch to current xorg-x11 ebuild for not building MESA if use flga nvidia has been specified. (I build xorg-x11 this way, though not using this specific patch, and glx works as expected. This patch is "untested".)


--- xorg-x11-6.8.1.904.ebuild.old	2005-02-04 16:10:31.095278304 +0100
+++ xorg-x11-6.8.1.904.ebuild	2005-02-04 16:29:52.688689264 +0100
@@ -46,7 +46,7 @@
 
 # IUSE="gatos" disabled because gatos is broken on ~4.4 now (31 Jan 2004)
 IUSE="3dfx 3dnow bitmap-fonts cjk debug dlloader dmx doc font-server hardened
-	insecure-drivers ipv6 minimal mmx nls opengl pam sdk sse static
+	insecure-drivers ipv6 minimal mmx nls nvidia opengl pam sdk sse static
 	truetype-fonts type1-fonts uclibc xprint xv"
 # IUSE_INPUT_DEVICES="synaptics wacom"
 
@@ -676,9 +676,16 @@
 		# Do we want the glx extension? This will turn off XF86DRI if it's off.
 		# DRI can't build if glx isn't built, so keep this below DRI define.
 		# Do this before hppa so they can turn DRI off
+		# nvidia users neither need dri nor mesa, but beware that
+		# glxgears and glxinfo won't be built, as well
 		use_build opengl BuildGlxExt
-		use_build opengl BuildGLXLibrary
-		use_build opengl BuildXF86DRI
+		if use opengl && ! use nvidia; then
+			echo "#define BuildGLXLibrary YES" >> ${HOSTCONF}
+			echo "#define BuildXF86DRI YES" >> ${HOSTCONF}
+		else
+			echo "#define BuildGLXLibrary NO" >> ${HOSTCONF}
+			echo "#define BuildXF86DRI NO" >> ${HOSTCONF}
+		fi
 		# Needs GL headers
 		use_build opengl BuildGLULibrary
 



Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Prakash Punnoor 2005-02-04 07:44:11 UTC
Oh, perhaps the ebuild should be furthpatched like with "minimal" that other drivers won't get build if "nvidia" is specified.
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2005-02-04 08:24:32 UTC
Prakash: Please always attach patche as plaintext, do not inline.
Comment 3 Prakash Punnoor 2005-02-04 08:28:16 UTC
Created attachment 50347 [details, diff]
nvidia use patch
Comment 4 Prakash Punnoor 2005-02-04 11:14:34 UTC
Created attachment 50364 [details, diff]
build minimal drivers with nvidia
Comment 5 Prakash Punnoor 2005-02-04 11:15:40 UTC
So, I added a patch, which also only builds minimal drivers (at lest I hope that this is enough. I added nv driver, as Nvidia users like to debug using this one.
Comment 6 Andrew Bevitt 2005-02-04 13:25:37 UTC
Having no default gl implementation to fall back on seems risky, and totally against the point of having opengl-update in my opinion. Having said that, your use of the use flag "nvidia" does give people the option so it has points there, however perhaps a different use flag name, as "nvidia" isnt entirely descriptive.

The other thing would be that if people build like this, then they must build nvidia-glx after xorg-x11, otherwise gl wont work full stop. Your patch would be more complete with a PDEPEND entry to do this also. Something like
PDEPEND="nvidia? (media-video/nvidia-glx)"

Until the tree doesnt need packages to switch to the xorg-x11 gl implementation to build, this probably shouldnt be used officially. After all, all you were after here is a speed increase in the build process, right?
Comment 7 Prakash Punnoor 2005-02-04 13:31:59 UTC
Yes, I am not a great ebuild hacker, but I guess you see my point. I am (and I guess most of Nvidia users) not interested in MESA as fallback. If I need nv, I simply disable use of GLX in xorg.conf.

The PDEPEND makes sense, of course. I think the official ebuild meintainer should decide.

If I look into the "minimal" use flag, it is not very usable for the average user as well, so I think "nvidia" or whatver you call it might make sense, as well, even for more users. :-)
Comment 8 Prakash Punnoor 2005-02-04 13:39:26 UTC
Oh, btw, what happens if my patched ebuild would be used on a fresh system? I mean as long as no opengl is installed (nvidia-glx should be installed after, right?), would the ebuild break as opengl-update is pretty jobless? Then this needs to be slightly patched, as well...
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-04 17:57:07 UTC
Couple of points:

1. Everyone with an nvidia card doesn't necessarily want to use/install the binary drivers
2. "minimal" users shouldn't be forced to have the nv driver built. The list is purposely made as minimal as possible while still usable.
3. opengl-update isn't used in the xorg-x11 ebuild when USE="-opengl" so no, it wouldn't break. Look at when switch_opengl_implem() is called.
Comment 10 Prakash Punnoor 2005-02-05 00:27:43 UTC
1) True, so maybe use another flag. Nevertheless I am pretty sure that most Nvidia users will use binary driver, because of 2d and 3d accel. (Should I start a poll in the Forum? :-)

2) I haven't touched minimal if you look closely...

3) The ebuild says
		if use opengl; then
			switch_opengl_implem
		fi
As I intended that opengl and the nvidia flag is used, I need to alter the line to

if use opengl && ! use nvidia; then

I guess...
Comment 11 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-05 00:45:23 UTC
1) The idea of a flag that does something unrelated to build-time or run-time dependencies, unrequired for nvidia cards to work adequately in at least 2D and unwanted by a significant minority of nvidia users who only use the "open" driver is a little weird.

2) Oh I see. No, can't do that either -- people get incredibly confused when they switch cards and the drivers aren't there, unless the build-time driver selection is available for ALL drivers and is well-documented and announced.

3) Ah, I see where you're coming from here. This is just a bad idea for the official ebuild because it doesn't scale. There are at least three other binary drivers in portage, plus others around.

All in all, I have a feeling this may make better overlay material than being part of the tree.
Comment 12 Prakash Punnoor 2005-02-05 01:53:16 UTC
In fact what I would like is that there would be a seperate ebuild or whatever for driver selection and maybe one ebuild for mesa, as well, or that drivers could be installed at a later stage w/o recompiling X. I Windows I don't have to reinstall Windows when I switch cards, just the driver. (Yes, I know X ist not an OS...

Wouldn't this be the cleanest approch? Split the x.org ebuild like the kde guys did?
Comment 13 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-05 16:09:47 UTC
xorg isn't in a state amenable to splitting in its current tree. It's already been attempted, and there are many brick walls that need to be knocked down. Work upstream is underway to modularize it, which we are following eagerly.

We've recently discussed building Mesa separately -- until recently, it wasn't able to build an X-friendly libGL, and still none of its releases have come with the DRI drivers.

You may be interested in following e.g. bug #17025.
Comment 14 Prakash Punnoor 2005-02-06 09:12:03 UTC
Hmm, the bug seems to be fairly old

But as far as I can see it should be possible to split xorg at least partially w/o major hacking. Eg. fonts can be installed using a seperate ebuild. (Patch out program, libs... target in root Imakefile...etc) Only problem is the support for certain types of fonts. I haven't understood yet, whether this can be done seperately.

I think handling fonts would be a fisrt step, as there are loads of defines there, so that nearly everything there could be cut down. Doing this by flags seems like too much, but maybe do it similar as glibc does with userlocales?

Tehn we could see whether it could be done for mesa and drivers, though this looks more complicated.
Comment 15 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-06 16:18:46 UTC
Why are you talking in this bug? That should've been posted in the other one.
Comment 16 Prakash Punnoor 2005-02-06 22:19:01 UTC
Oh well, I'll do a copy and paste then...
Comment 17 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-06 22:44:21 UTC
Thanks. The people who care about the discussion aren't CC'd on this bug.