User Scripts & Dragons - fglrx 11-2 & 2.6.38 & ...

Rich.Rat - 28.03.2011, 01:45
Post subject: fglrx 11-2 & 2.6.38 & ...

I had a time to take a deep look in the latest fglrx-modules-dkms and now it is works for me on my laptop.
2xamd64 & hd2600
Issue is the removed smp_lock.h from aptosid kernel headers.

!! at your own risk !!
Here is my patch, it goes against drmP.h and firegl_public.c from package


It should work with all kernels, aptosid and non aptosid - like from alfgaida.de. It should, but please don't blane me if ...

--- drmP.h.orig   2011-02-02 19:39:00.000000000 +0100
+++ drmP.h   2011-03-28 00:48:08.338428122 +0100
@@ -57,7 +57,11 @@
 #include <linux/pci.h>
 #include <linux/version.h>
 #include <linux/sched.h>
+/* with no Big Kernel Lock and linux 2.6.38
+   and higher smp_lock.h is removed      */
 #include <linux/smp_lock.h>   /* For (un)lock_kernel */
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #if defined(__alpha__) || defined(__powerpc__)
--- firegl_public.c.orig   2011-03-18 23:34:00.000000000 +0100
+++ firegl_public.c   2011-03-28 00:51:41.330750446 +0100
@@ -116,7 +116,16 @@
 #include <linux/pci.h>
 #include <linux/wait.h>
 #include <linux/miscdevice.h>
-#include <linux/smp_lock.h>
+/* with no Big Kernel Lock and linux 2.6.38
+   and higher is smp_lock.h removed.
+   instead of smp_lock.h is sched.h required    */
+#include <linux/smp_lock.h>   /* For (un)lock_kernel */
+#include <linux/sched.h>
 // newer SuSE kernels need this
 #include <linux/highmem.h>

If the patch is working, please give a respond.
If the patch is not working, hmm - I think I can't help you. But, please give a respond. ;)
If you know it better, feel free to edit.

cu rich
orinoco - 28.03.2011, 21:01
Post subject:

I'm interested to test your patch but I ran into a problem applying this patch. I have no experience in doing such a task. I created a text-file from your patch and copied it to /usr/src/fglrx-11-2/patch.txt and run it with patch < patch.txt.

Unfortunately the patch failed with the message: Hunk #1 failed at 57

Can you give me a hint what I've made wrong?

But I was to curious to got to bed without further trying. (:

I made the patches by hand and run
dkms build -m fglrx -v 11-2 -k $(uname -r)

and loaded the module with
insmod /var/lib/dkms/fglrx/11-2/2.6.38-2.slh.1-aptosid-amd64/x86_64/module/fglrx.ko

and it works. (:

But to which folder I must copy the module?

I recognized one bad thing. I lost the compositing in KDE...
towo - 28.03.2011, 21:03
Post subject:
That's not my patch, if it would my patch, it would work, because i would build a deb, which has the patch in.
orinoco - 28.03.2011, 21:16
Post subject:
      towo wrote:
That's not my patch, if it would my patch, it would work, because i would build a deb, which has the patch in.

??? Yes, I know that this is not your patch. I just wanted to give Rich.Rat a positive feedback for his work and asked him for some further help. If somebody tells me where I have to copy the module I would be happy for today.
towo - 28.03.2011, 21:32
Post subject:
Oh, i missed, that this is not the initial thread of you, sorry.
orinoco - 28.03.2011, 21:36
Post subject:
I cheated from VirtualBox and copied fglrx.ko to /lib/modules/2.6.38-2.slh.1-aptosid-amd64/updates/dkms.

# depmod -a
# modprobe fglrx
# service kdm restart

It even survived a reboot. Thanks to Rich.Rat for his work.
Rich.Rat - 29.03.2011, 09:37
Post subject:
Sorry for my late answer.

How to build a deb - Hmm, I dont know, but I can manipulate an existing thats all.
This means the package Version stays same.

You must have the package
Copy the package in a separat folder;
navigate to the folder;
if necessary, change the owner rights of the package from ROOT to USER;
extraxt the package files and the related DEBIAN files with with dpkg-deb;
$dpkg-deb -x fglrx-modules-dkms_1%3a11-2-2_amd64.deb fglrx-modules-dkms_1%3a11-2-2-NEW_amd64
$dpkg-deb -e fglrx-modules-dkms_1%3a11-2-2_amd64.deb fglrx-modules-dkms_1%3a11-2-2-NEW_amd64/DEBIAN

Attention to the correct writing !! /DEBIAN !! and not /debian or what ...

After this you have extracted the complete package in one folder fglrx-modules-dkms_1%3a11-2-2-NEW_amd64
If you have this sub folders and some other files under the folder fglrx-modules-dkms_1%3a11-2-2-NEW_amd64 everything should be all right.

Now you can patch the files. You find the related files under
the related files are

apply the patch with
patch -p0 <YourPatchFileName

The output should be like (in my case)
sid@sidbox:~/tst3$ patch -p0 <fglrx-11-2_no_smp_lock_h.patch
patching file drmP.h
patching file firegl_public.c

Check the files, search for 2.6.38 - the related area should look nearly like my patch (without the first characters # - @ )
Delete or move the patchfile to an other folder.
navigate back above the folder fglrx-modules-dkms_1%3a11-2-2-NEW_amd64
Build the package with dpkg-deb
$dpkg-deb -b fglrx-modules-dkms_1%3a11-2-2-NEW_amd64

EDIT: ]$dpkg-deb -b .... Rich
Now you should have a package fglrx-modules-dkms_1%3a11-2-2-NEW_amd64.deb.

But like I sayd ...-NEW... is no Version or Subversion!
Both packages are version 1:11.2.2
How to change the versions? Sorry I don't know.
Rich.Rat - 29.03.2011, 16:05
Post subject:
perhaps something is missing in the patch. (copy and past issue )

At the end of the last line ...

#include <linux/highmem.h>[press ENTER button & save]
Rich.Rat - 29.03.2011, 22:18
Post subject:
I'm really suprised, Our maintainer is verry fast Very Happy

Debian Bug report logs - #619952
fglrx-modules-dkms DKMS fails with missing include/linux/smp_lock.h

Date: Mon, 28 Mar 2011 15:18:01 UTC
Severity: wishlist
Tags: patch
Found in version fglrx-driver/1:11-2-2
Fixed in version fglrx-driver/1:11-3-1
Done: Patrick Matthäi <pmatthaei>

be happy ..., until it breaks again Smile
All times are GMT - 12 Hours
Powered by PNphpBB2 © 2003-2010 The Zafenio Group