Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting DRI working with Intel Sonoma (i915GM) chipset
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Thu Jul 28, 2005 11:40 pm    Post subject: Getting DRI working with Intel Sonoma (i915GM) chipset Reply with quote

HOWTO: Getting DRI working with Intel Sonoma (i915GM) chipset

Hi all.

For all those who tried to have DRI work on Intel Sonoma chipset here are good news. That chipset is available in many laptops, including Dell Inspiron 6000 and Samsung X20. However the implementation varies quite a lot between brands and even within a brand itself. In fact the i915 supports some features, including high-definition audio. But hardware manufacturers are free to use it... or not. As far as I can tell, there is no HDA in Dell Inspiron 6000 for instance.

But it's not the topic of this thread. If, like me and many other ones, you have an Intel Sonoma chipset (i915GM) and never could get DRI to work properly - or tried and got poor results, this is for you :-).

The following applies if...
  • you have a i915 chipset and
  • you have a recent vanilla-based kernel: >=suspend2-sources-2.6.12-r3, >=vanilla-sources-2.6.12_rc5(*), >=gentoo-sources-2.6.12-r6(*) and
  • you have kernel support for i915 drm (either built-in or as a module) and
  • you have selected xorg driver i810 in xorg.conf and
  • you are not using DRI snapshots

(*) Note: These are the kernels I have made tests with. But I have not applied the patch to those kernels. Suspend2 sources are vanilla-based kernel sources with only patches for suspend-to-disk, framebuffer console, framebuffer splash plus the the inotify functionnality. Gentoo sources contain all the patches from Gentoo kernel developers.

I don't use modelines in my xorg.conf since XOrg >= 6.8.99 supports non-standard modes of i915 chipset. However you'll notice that XOrg is using VESA facilities to setup graphics mode:
Code:
# grep -i vesa /var/log/Xorg.0.log
(II) I810(0): VESA BIOS detected
(II) I810(0): VESA VBE Version 3.0
(II) I810(0): VESA VBE Total Mem: 7872 kB
(II) I810(0): VESA VBE OEM: Intel(r)915GM/910ML/915MS Graphics Chip Accelerated VGA BIOS
(II) I810(0): VESA VBE OEM Software Rev: 1.0
(II) I810(0): VESA VBE OEM Vendor: Intel Corporation
(II) I810(0): VESA VBE OEM Product: Intel(r)915GM/910ML/915MS Graphics Controller
(II) I810(0): VESA VBE OEM Product Rev: Hardware Version 0.0
(II) I810(0): VESA BIOS detected
(II) I810(0): VESA VBE Version 3.0
(II) I810(0): VESA VBE Total Mem: 12288 kB
(II) I810(0): VESA VBE OEM: Intel(r)915GM/910ML/915MS Graphics Chip Accelerated VGA BIOS
(II) I810(0): VESA VBE OEM Software Rev: 1.0
(II) I810(0): VESA VBE OEM Vendor: Intel Corporation
(II) I810(0): VESA VBE OEM Product: Intel(r)915GM/910ML/915MS Graphics Controller
(II) I810(0): VESA VBE OEM Product Rev: Hardware Version 0.0
(II) I810(0): VESA VBE PanelID read successfully
(II) I810(0): VESA VBE DDC supported
(II) I810(0): VESA VBE DDC Level 2
(II) I810(0): VESA VBE DDC transfer in appr. 1 sec.
(II) I810(0): VESA VBE DDC read successfully
(II) I810(0): VESA BIOS detected
(II) I810(0): VESA VBE Version 3.0
(II) I810(0): VESA VBE Total Mem: 7872 kB
(II) I810(0): VESA VBE OEM: Intel(r)915GM/910ML/915MS Graphics Chip Accelerated VGA BIOS
(II) I810(0): VESA VBE OEM Software Rev: 1.0
(II) I810(0): VESA VBE OEM Vendor: Intel Corporation
(II) I810(0): VESA VBE OEM Product: Intel(r)915GM/910ML/915MS Graphics Controller
(II) I810(0): VESA VBE OEM Product Rev: Hardware Version 0.0

It doesn't matter. I hope ;) ...

A little bit of history

I have a Dell Inspiron 6000 that I immediately installed with Gentoo Linux. I had already installed a couple of machines with Gentoo so I was pretty confident. But when you deal with laptops, things can get terribly difficult, reminding how it's easy under... Window$ (sorry but that's true).

First time I tried xorg 6.8 on my laptop I got a black screen when I started X. I then used unmasked versions of Xorg. I tried 6.8.2 and almost every 6.8.99.xx. There were strange messages with dmesg like

Code:
# dmesg | grep -i agpgart
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel 915GM Chipset.
agpgart: Detected 7932K stolen memory.
agpgart: AGP aperture is 256M @ 0xc0000000

or even about dri (or was it drm?) being disabled.

I also checked Gentoo forums: Dell Inspiron 6000, started by Sejam and i915 and xorg - how? started by Klavs. Many of us, posters, tried DRI snapshots and that mostly... did not work. (There are people who reported they do on their machine.) For instance checking glxinfo says

Code:
$ glxinfo | grep direct
direct rendering: No.

XOrg reports only 8 MB of usable RAM - not enough for using DRI - although 128 MB or more are available through shared RAM:

Code:
(II) I810(0): detected 7932 kB stolen memory.
(II) I810(0): I830CheckAvailableMemory: -545582944 kB available
...
(II) I810(0): 15440 kBytes additional video memory is required to
   enable tiling mode for DRI.
(II) I810(0): 3040 kBytes additional video memory is required to enable DRI.
(II) I810(0): Disabling DRI.

All I could get so far was either DRI not working or giving poor performance - around 200 FPS with Glxgears though I saw people with more than 2000. The patch below has given me over 1300 FPS with Glxgears instead of 800 (the best I could ever get).

I have searched for months in forums and Googled the Internet in vain. Yesterday, completely by chance, I saw this article on Gentoo wiki, especially the title "DRI, Xvideo and co.". It's about patching lnx_agp in Xorg source files, which is the topic of this thread.

Alan Hourihane (xorg developer) is tracking down the real reason why DRI may not work with i915 (http://lists.freedesktop.org/pipermail/xorg/2005-July/008735.html). He provided a workaround as a patch. So let me remind you:
I wrote:
this is just a workaround and not a fix.

However the impact on DRI is - let's hope - the same.

The patches

Note: You will be creating patches from scratch. Be careful to replace indent spaces with tabs since this is a standard for ebuild, especially. If you don't replace spaces with tabs, patch may fail with an error message like:
Code:
patching file xorg-x11-6.8.99.15.ebuild
Hunk #1 FAILED at 33.
Hunk #2 FAILED at 491.
2 out of 2 hunks FAILED -- saving rejects to file xorg-x11-6.8.99.15.ebuild.rej


I could have provided a single patch for xorg ebuild but I wanted to go further. In the same time I saw how to install custom ebuilds using an overlay directory. This is the way I followed.

Why? I went a bit frustrated with my fix attempts disappearing after an emerge sync. Don't worry, that's normal. So if you want your changes to pertain even after portage updates, use a portage overlay.

Update (9 oct. 2005): Portage overlays take precedence over official ebuilds in portage hence we're going to use that feature. At the time of this writing I initially renamed Xorg ebuild (xorg-x11-6.8.99.15) but you can simply copy the official ebuild to the portage overlay directory. Note you will have to repeat these steps and patch subsequent Xorg ebuild versions after a sync.

I also defined a USE flag to control whether the patch will be applied to lnx_agp or not. you must set dri-patch to compile Xorg with the DRI patch applied.

You might object this is a big overhead but if an new ebuild with the same name is released it won't conflict with this one. Finally since I'm working with the original sources I found it convenient to revert to the initial ebuild: just remove the use flag to emerge.

What will we do?
  1. We will first create the overlay structure.
  2. Then we'll save a custom file to patch XOrg's lnx_agp.c.
  3. We'll copy and patch the official xorg ebuild.
  4. We'll sign the new ebuild with the digest.
  5. We'll finally make sure make.conf directs portage to use the new overlay directory.

I'll assume you are now root on your system.

First create the overlay directory, typically /usr/local/portage/. XOrg patches are downloaded and applied in batch. Small patches are put into portage tree in the ./files sub-directory of the ebuild directory. This is where we'll put our custom patch. That directory is mapped to the $FILESDIR variable in ebuilds. Since you'll have to copy the exact structure of the ebuild you want to change hence you create the whole structure in one go:

Code:
~ # mkdir -p /usr/local/portage/x11-base/xorg-x11/files/

Next copy the xorg ebuild you want to change. I'll use xorg-x11-6.8.99.15 but you can copy the one that best suits for you:

Code:
~ # cp -p /usr/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15.ebuild /usr/local/portage/x11-base/xorg-x11/

Save the text that follows the cat instruction below into /usr/local/portage/x11-base/xorg-x11/files/dri-lnx_agp.patch (the original patch can be found there):

Code:
~ # nano /usr/local/portage/x11-base/xorg-x11/files/dri-lnx_agp.patch
~ # cat /usr/local/portage/x11-base/xorg-x11/files/dri-lnx_agp.patch
Note: This patch has been tweaked by VinzC to be applied using portage
Source: http://www.gentoo-wiki.com/HARDWARE_Samsung_X20#DRI.2C_Xvideo_and_co.
--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c   2005-07-03 09:01:32.000000000 +0200
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c~       2005-07-28 13:26:41.000000000 +0200
@@ -139,6 +139,12 @@
                return NULL;
        }

+       /*
+        * Workaround to get DRI working with i915
+        * (http://www.gentoo-wiki.com/HARDWARE_Samsung_X20#DRI.2C_Xvideo_and_co.)
+        */
+       memset((char*)&agpinf, 0, sizeof(agpinf));
+
        if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
                xf86DrvMsg(screenNum, X_ERROR,
                           "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n",

Now we need to change the ebuild so that the patch in the ./files directory is applied to xorg source file lnx_agp.c.

Info: ebuilds are decompressed in a temporary location, /var/tmp/portage/<ebuild-category>/<ebuild-name>/work. They traditionnally apply patches in the ebuild unpack step (see ebuild: A Safer Approach for more information on how ebuilds work). This is where we place the new code to apply our custom patch lnx_agp.c.

Here's a patch (yeah, gimme one more patch!) to change the ebuild but you can change the ebuild manually. To patch the ebuild, save the text that follows the cat instruction below into /root/xorg-ebuild.diff:

Code:
# nano ~/xorg-ebuild.diff
# cat ~/xorg-ebuild.diff
--- xorg-x11-6.8.99.15.ebuild       2005-07-21 22:05:58.000000000 +0200
+++ xorg-x11-6.8.99.15.ebuild~   2005-07-28 22:35:41.000000000 +0200
@@ -33,7 +33,8 @@

 # IUSE="gatos" disabled because gatos is broken on ~4.4 now (31 Jan 2004)
 IUSE="3dfx bitmap-fonts cjk debug doc font-server insecure-drivers ipv6 minimal
-       nls nocxx opengl pam sdk static truetype-fonts type1-fonts uclibc xprint xv"
+       nls nocxx opengl pam sdk static truetype-fonts type1-fonts uclibc xprint xv
+       dri-patch"
 # IUSE_INPUT_DEVICES="synaptics wacom"

 FILES_VER="0.1"
@@ -490,6 +491,11 @@
        cd ${WORKDIR}
        EPATCH_SUFFIX="patch" \
        epatch ${PATCHDIR}
+
+       # Patch using DRI workaround
+       if use dri-patch; then
+               epatch ${FILESDIR}/dri-lnx_agp.patch
+       fi
        cd ${S}
 }


Note the use flag dri-patch added to the IUSE variable. Be careful when saving the above text: lines are indented with tabs, not spaces. You must then replace indent spaces with tabulations before you save the diff file.

Important

The example above uses xorg-x11-6.8.99.15. With subsequent releases of xorg 6.8.99.15 you will have to edit the first two lines in xorg-ebuild.diff so that they match the new ebuild file name.

For example, to patch xorg-x11-6.8.99.15-r4:
Code:
# head -n 2 ~/xorg-ebuild.diff
--- xorg-x11-6.8.99.15-r4.ebuild       2005-07-21 22:05:58.000000000 +0200
+++ xorg-x11-6.8.99.15-r4.ebuild~   2005-07-28 22:35:41.000000000 +0200


Now you must apply the patch to the ebuild from its directory:
Code:
# cd /usr/local/portage/x11-base/xorg-x11/
xorg-x11 # patch -p0 < ~/xorg-ebuild.diff

The lnx_agp patch is applied from the ebuild by a function called do_patch. If the patch does not work, you can still make the changes manually. The ebuild should now look like this:

Code:
xorg-x11 # egrep -A 12 -B 0 '^do_patch' xorg-x11-6.8.99.15.ebuild
do_patch() {
        # Bulk patching - based on patch name
        # Will create excluded stuff once it's needed
        cd ${WORKDIR}
        EPATCH_SUFFIX="patch" \
        epatch ${PATCHDIR}

        # Patch using DRI workaround
        if use dri-patch; then
                epatch ${FILESDIR}/dri-lnx_agp.patch
        fi
        cd ${S}
}


Next you must tell portage you are using an overlay. It must be done before the ebuild is signed. Edit /etc/make.conf with your favorite editor and add PORTDIR_OVERLAY="/usr/local/portage":

Code:
xorg-x11 # nano /etc/make.conf
xorg-x11 # grep -i -C 1 overlay /etc/make.conf
PORT_DIR=/usr/portage
PORTDIR_OVERLAY="/usr/local/portage"
PORT_LOGDIR=/var/log/portage

Right now the ebuild is almost ready for use; sign it with the digest:

Code:
xorg-x11 # ebuild xorg-x11-6.8.99.15.ebuild digest
>>> Generating digest file...
<<< eurofonts-X11.tar.bz2
<<< xfsft-encodings-0.1.tar.bz2
<<< gentoo-cursors-tad-0.3.1.tar.bz2
<<< gemini-koi8-u.tar.bz2
<<< xorg-x11-6.8.99.15-files-0.1.tar.bz2
<<< xorg-x11-6.8.99.15-patches-0.1.2.tar.bz2
<<< xorg-x11-6.8.99.15.tar.bz2

>>> Generating manifest file...
<<< xorg-x11-6.8.99.15.ebuild
<<< files/dri-lnx_agp.patch
<<< files/digest-xorg-x11-6.8.99.15
>>> Computed message digests.

xorg-x11 # ls -lR
.:
total 60
-rw-rw-r--  1 root portage   213 Jul 28 22:50 Manifest
drwxr-xr-x  2 root root      136 Jul 28 14:17 files
-rw-r--r--  1 root root    54182 Jul 28 22:35 xorg-x11-6.8.99.15.ebuild

./files:
total 8
-rw-rw-r--  1 root portage 516 Jul 28 22:50 digest-xorg-x11-6.8.99.15
-rw-r--r--  1 root root    901 Jul 28 14:14 dri-lnx_agp.patch

Note the files that were created: Manifest and digest-xxx. They are required by portage.

Installing the modified XOrg

Now the ebuild is ready and will update your current installation of XOrg with the overlay. Since you're using the same ebuild file name as the official one in portage and you've probably unmasked it, no further step is required. Remember we defined a USE flag to enable the patch on XOrg. Type USE="dri-patch" before the actual emerge instruction:

Code:
xorg-x11 # USE="dri-patch" emerge -av xorg-x11

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild     U ] x11-base/xorg-x11-6.8.99.15 [6.8.99.15]  -3dfx +bitmap-fonts -cjk -debug -doc +dri-patch* -font-server -insecure-drivers -ipv6 -minimal +nls -nocxx +opengl +pam -sdk -static +truetype-fonts +type1-fonts (-uclibc) -xprint +xv 0 kB [1]

Total size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/portage

Do you want me to merge these packages? [Yes/No] y
...

Since the patch applies to a version of XOrg you already installed, (did you?) there is nothing to download. Restart X and run glxgears in a terminal as a normal user. Before applying the patch glxgears displayed around 800 FPS in 16 bpp mode (i.e. 65536 colors) on my laptop; that's more than a 50% increase! IMHO it's worth reading this [long indeed ;) ] post:

Code:
$ glxinfo | head -n 3
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
$ glxgears
6571 frames in 5.0 seconds = 1314.166 FPS
6509 frames in 5.0 seconds = 1301.620 FPS
6521 frames in 5.0 seconds = 1304.011 FPS
6569 frames in 5.0 seconds = 1313.762 FPS
6572 frames in 5.0 seconds = 1314.397 FPS
6624 frames in 5.0 seconds = 1324.633 FPS
6574 frames in 5.0 seconds = 1314.659 FPS
6492 frames in 5.0 seconds = 1298.331 FPS

Enjoy!

Conclusion

You can revert the patch by clearing the use flag on the command line. Note if you don't add it to your /etc/make.conf you'll only have to type emerge xorg to re-emerge the same ebuild but without the lnx_agp patch.

I haven't tested this patch with earlier versions of XOrg. I have successfully applied it to all 6.8.99.xx releases, up to -r4. It might be applied to version 6.8.2 however. It doesn't make sense to apply it to even earlier versions as they don't support i915 chipset [properly].

Acknowledgements

Last but not least: thanks to everyone who posted in these forums (Sejam, Klavs, stormer, lancealtar, PolarXL, et al. Believe me, they are many :) ) and of course a big big thank you to Alan Hourihane.

[Some]References

Here are some posts and articles I read that helped me; take your time :D :


Change history
  • Prepared make.conf before computing the digest
  • Ebuild patching changed (copy, patch and rename)
  • Ebuild patch: date/time changed
  • Patch level in ebuild patch
  • Leading garbage partly removed from dri patch (Index)
  • Note about spaces in patches (fix for patch failure)
  • Removed rename instructions with overlay
  • Note on recent releases of xorg.

_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”


Last edited by VinzC on Wed Nov 09, 2005 10:50 pm; edited 9 times in total
Back to top
View user's profile Send private message
darkdruid
n00b
n00b


Joined: 07 Oct 2003
Posts: 2

PostPosted: Fri Jul 29, 2005 7:57 pm    Post subject: Some Problems Reply with quote

Thenks for the great howto. I'm trying it out right now. I Ran into a few problems, so far nothing major, but it might be good to point them out. For some reason the ebuild patch dosen't seem to work, which is no big deal I did the editing by hand and it seems fine so far.

Second problem occurs running the ebuild digest command. The OVERLAY_DIR needs to be added to the /etc/make.conf file before the command is run otherwise it dosen't work.
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Fri Jul 29, 2005 9:54 pm    Post subject: Re: Some Problems Reply with quote

darkdruid wrote:
Thenks for the great howto. I'm trying it out right now. I Ran into a few problems, so far nothing major, but it might be good to point them out. For some reason the ebuild patch dosen't seem to work, which is no big deal I did the editing by hand and it seems fine so far.

Thanks for your feedback. In fact I did the patch myself by running diff -Naur against the original file in portage and the modified one. I suspect file dates are taken into account by patch. It might be not as easy to create patches :) . I think I'm going to read a couple more HOWTOs on how to make patches...

darkdruid wrote:
Second problem occurs running the ebuild digest command. The OVERLAY_DIR needs to be added to the /etc/make.conf file before the command is run otherwise it dosen't work.

I'm updating right now.

EDIT: done.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Sat Jul 30, 2005 9:49 am    Post subject: Reply with quote

Just wondering: Has anyone gotten this to work with a HP Compaq nx6110? :?:
_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
thomasa88
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 143
Location: Sweden

PostPosted: Sat Jul 30, 2005 10:01 am    Post subject: Reply with quote

the ebuild-patch didnt work for me either.. but when I had changed it manually and tried a diff -Naur I get the exact same result as you posted :?

and the other patch cant find the file to patch.. maybe it should be the /var/portage/something/work?
_________________
- thomasa88


Last edited by thomasa88 on Sat Jul 30, 2005 10:15 am; edited 1 time in total
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Sat Jul 30, 2005 10:03 am    Post subject: Reply with quote

meulie wrote:
Just wondering: Has anyone gotten this to work with a HP Compaq nx6110? :?:

Nope, I think you're the first one.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Sat Jul 30, 2005 10:17 am    Post subject: Reply with quote

thomasa88 wrote:
the ebuild-patch didnt work for me either.. but when I had changed it manually and tried a diff -Naur I get the exact same result as you posted :?

Wierd. Did you copy the original ebuild with cp -p? Did you get an error message about unapplied hunks? Or does patch prompt for a file name?

The ebuild date on my laptop is Jul 21 22:05. I see in my post the date in the ebuild patch differs. I'm changing it.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
thomasa88
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 143
Location: Sweden

PostPosted: Sat Jul 30, 2005 10:39 am    Post subject: Reply with quote

I got an error message that 2 of 2 hunks failed with the ebuild-patch

with the other patch I get this error:
Code:

PATCH COMMAND:  patch -p4 -g0 --no-backup-if-mismatch < /usr/local/portage/x11-base/xorg-x11/files/dri-lnx_agp.patch

=============================
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: lnx_agp.c
|===================================================================
|RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v
|retrieving revision 1.7
|Note: This patch has been tweaked by VinzC to be applied using portage
|Source: http://www.gentoo-wiki.com/HARDWARE_Samsung_X20#DRI.2C_Xvideo_and_co.
|--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c   2005-07-03 09:01:32.000000000 +0200
|+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.new.c   2005-07-28 13:26:41.000000000 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

it starts with -p0 and ends at -p4

line 9 would be: @@ -139,6 +139,12 @@
_________________
- thomasa88
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Sat Jul 30, 2005 11:22 am    Post subject: Reply with quote

thomasa88 wrote:
I got an error message that 2 of 2 hunks failed with the ebuild-patch

with the other patch I get this error:
Code:

PATCH COMMAND:  patch -p4 -g0 --no-backup-if-mismatch < /usr/local/portage/x11-base/xorg-x11/files/dri-lnx_agp.patch

=============================
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: lnx_agp.c
|===================================================================
|RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v
|retrieving revision 1.7
|Note: This patch has been tweaked by VinzC to be applied using portage
|Source: http://www.gentoo-wiki.com/HARDWARE_Samsung_X20#DRI.2C_Xvideo_and_co.
|--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c   2005-07-03 09:01:32.000000000 +0200
|+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.new.c   2005-07-28 13:26:41.000000000 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

it starts with -p0 and ends at -p4

line 9 would be: @@ -139,6 +139,12 @@

Ok, I see my confusion now. I thought you talked about the patch applied to xorg ebuild file.

The lnx_agp patch is a modified version of the initial patch. I think it was generated from CVS. It didn't work as-is on my machine; I changed it so that it could be applied using portage. I reconstructed the header after I changed lnx_agp manually and run diff -Naur too. Strangely enough it worked for me :? ...

I see a solution but it's a bit long:
  1. remove the patching line from the ebuild and sign the ebuild again.
  2. run ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild unpack
  3. find lnx_agp and cd to that directory (should be /var/tmp/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1/work/xc/programs/Xserver/hw/xfree86/os-support/linux/)
  4. apply the orginial patch (using patch -p0 < <path to initial patch>) or make the changes by hand
  5. run ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild compile && ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild install && ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild qmerge

_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
thomasa88
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 143
Location: Sweden

PostPosted: Sat Jul 30, 2005 11:30 am    Post subject: Reply with quote

I was thinking of that too ;)

btw, doesnt qmerge do all of the cmds if I dont remember wrong (latest)?

edit.
otherwise I read a sweet thing in a magazine, I could do like this:
ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild {compile,install,qmerge} :)

edit.

succeded with -F3, im soo lazy :P
_________________
- thomasa88
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Sat Jul 30, 2005 12:50 pm    Post subject: Reply with quote

thomasa88 wrote:
btw, doesnt qmerge do all of the cmds if I dont remember wrong (latest)?

I have absolutely no idea. I didn't go that far. Not yet ;) .

thomasa88 wrote:
otherwise I read a sweet thing in a magazine, I could do like this:
ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild {compile,install,qmerge} :)

You mean in one go, on the same line?

thomasa88 wrote:
succeded with -F3, im soo lazy :P

patch -p0 -F3 < <patch file> ?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
thomasa88
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 143
Location: Sweden

PostPosted: Sat Jul 30, 2005 12:56 pm    Post subject: Reply with quote

VinzC wrote:
thomasa88 wrote:
btw, doesnt qmerge do all of the cmds if I dont remember wrong (latest)?

I have absolutely no idea. I didn't go that far. Not yet ;) .

checked the man, merge does all, and I think it doesnt unpack if already unpacked.

VinzC wrote:

thomasa88 wrote:
otherwise I read a sweet thing in a magazine, I could do like this:
ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild {compile,install,qmerge} :)

You mean in one go, on the same line?

yes, but I dont know if it does && or ||...

VinzC wrote:

thomasa88 wrote:
succeded with -F3, im soo lazy :P

patch -p0 -F3 < <patch file> ?

yepp :)

edit.

99.15 takes years to compile compared to the others :(, maybe something with ccache..
_________________
- thomasa88
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Sat Jul 30, 2005 1:02 pm    Post subject: Reply with quote

thomasa88 wrote:
VinzC wrote:
thomasa88 wrote:
btw, doesnt qmerge do all of the cmds if I dont remember wrong (latest)?

I have absolutely no idea. I didn't go that far. Not yet ;) .

checked the man, merge does all, and I think it doesnt unpack if already unpacked.

VinzC wrote:

thomasa88 wrote:
otherwise I read a sweet thing in a magazine, I could do like this:
ebuild /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.99.15-r1.ebuild {compile,install,qmerge} :)

You mean in one go, on the same line?

yes, but I dont know if it does && or ||...

VinzC wrote:

thomasa88 wrote:
succeded with -F3, im soo lazy :P

patch -p0 -F3 < <patch file> ?

yepp :)

Thanks a lot for your feedback, that will serve a troubleshooting section.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Wed Aug 03, 2005 9:02 pm    Post subject: ebuild or something Reply with quote

ok iam not great at gentoo can we get an ebuild or something please
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Wed Aug 03, 2005 9:24 pm    Post subject: Reply with quote

i will host the ebuild file
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Wed Aug 03, 2005 9:34 pm    Post subject: i get that errro when trying to patch Reply with quote

patching file xorg-x11-6.8.99.15.ebuild
Hunk #1 FAILED at 33.
Hunk #2 FAILED at 491.
2 out of 2 hunks FAILED -- saving rejects to file xorg-x11-6.8.99.15.ebuild.rej
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Wed Aug 03, 2005 9:38 pm    Post subject: Re: ebuild or something Reply with quote

shadowtoo wrote:
ok iam not great at gentoo can we get an ebuild or something please

Well, the ebuild is already on your computer, just follow the instructions to the letter as all the fun goes to patching it and using an overlay directory :wink: . You will need an overlay even if you get the ebuild. What do you mean by hosting the file?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Wed Aug 03, 2005 9:41 pm    Post subject: Re: i get that errro when trying to patch Reply with quote

shadowtoo wrote:
patching file xorg-x11-6.8.99.15.ebuild
Hunk #1 FAILED at 33.
Hunk #2 FAILED at 491.
2 out of 2 hunks FAILED -- saving rejects to file xorg-x11-6.8.99.15.ebuild.rej

Damn! Despite all my fixing attempts... What version of patch do you have? You can type patch -v.

EDIT: you can also try thomasa88's patch -p0 -F3.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Wed Aug 03, 2005 9:57 pm    Post subject: Reply with quote

patch 2.5.9
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Wed Aug 03, 2005 10:00 pm    Post subject: Reply with quote

Hunk #1 FAILED at 33.
Hunk #2 succeeded at 491 with fuzz 3.
1 out of 2 hunks FAILED -- saving rejects to file xorg-x11-6.8.99.15.ebuild.rej
that was with the -F3
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Thu Aug 04, 2005 1:26 pm    Post subject: Reply with quote

no ideal?
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Thu Aug 04, 2005 7:09 pm    Post subject: Reply with quote

shadowtoo wrote:
no ideal?

Thanks to kallamej, the problem is due to spaces in the patch that people create from this thread. There are tabs in the original ebuild though when text is copied and pasted from here, spaces not tabs are inserted... I'll update the HOWTO ASAP.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
Oak
Apprentice
Apprentice


Joined: 25 Jan 2005
Posts: 239
Location: Sweden

PostPosted: Fri Aug 05, 2005 12:59 am    Post subject: Reply with quote

Thank you very very much VinzC! I can now watch my Simpsons episodes using xine without poor performace. :D
_________________
GCC-4.3.3-r1 - march=core2, gentoo-sources-2.6.30-r2 SMP x86_64 @ Core2Duo 2.4GHz, 4GB RAM
Back to top
View user's profile Send private message
shadowtoo
n00b
n00b


Joined: 03 Aug 2005
Posts: 8
Location: Tuscaloosa Alabama

PostPosted: Fri Aug 05, 2005 1:33 pm    Post subject: Reply with quote

ok 1 question after i did this when i do startx that works GREAT i get 1250FPS on glxgears
but i cant do atl ctrl f1 and when i exit X my console is screwed BADLY i have to reboot
if i use the vesa driver insted of i810 everything works great only poor preformance and no DRI
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4737
Location: Dark side of the mood

PostPosted: Fri Aug 05, 2005 5:06 pm    Post subject: Reply with quote

shadowtoo wrote:
ok 1 question after i did this when i do startx that works GREAT i get 1250FPS on glxgears
but i cant do atl ctrl f1 and when i exit X my console is screwed BADLY i have to reboot
if i use the vesa driver insted of i810 everything works great only poor preformance and no DRI

Are you using framebuffer splash and vesa-tng?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum