sgfxi :: patch rules and samples

In vain hopes that I actually start getting some meaningful help with sgfxi patches, especially fglrx patches, here's a brief list of patch requirements:

For more complete how to on how to use sgfxi itself to do most of these steps, read sgfxi: set test data as well. Keep in mind, for advanced testing, you can also use http://localhost with Apache webserver to test patches and so on.

Basic patching requirements for any potential patch

Bad patches, errors, bad hunks, etc

The patch should execute with no errors, no bad hunks, and ideally, no offset lines. When patch runs, a successful patch looks like this:

patching file common/lib/modules/fglrx/build_mod/firegl_public.c
patching file common/lib/modules/fglrx/build_mod/firegl_public.h

while a bad patch will have offsets, hunk failed messages, and so on, or:

can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------

which means you didn't use the correct path in the patch itself.

Patching syntax

Correctly done patches for sgfxi should be able to be run from inside the directory, which means they have a relative full path to the file in question, like so:

# for an fglrx patch, for instance:
--- common/lib/modules/fglrx/build_mod/firegl_public.c 2008-07-21 14:32:08.000000000 -0400
+++ common/lib/modules/fglrx/build_mod/firegl_public.c 2008-07-21 14:31:48.000000000 -0400
@@ -24,13 +24,13 @@

# or you can use something like this:
diff -ru common/lib/modules/fglrx/build_mod/firegl_public.c common/lib/modules/fglrx/build_mod.2.6.26-8-6/firegl_public.c
--- common/lib/modules/fglrx/build_mod/firegl_public.c
+++ common/lib/modules/fglrx/build_mod.2.6.26-8-6/firegl_public.c
@@ -24,13 +24,13 @@

# nvidia patches, done usually by nvidia programmers, usually look like this:
diff -ru usr/src/nv/nv-linux.h usr/src/nv.2404825/nv-linux.h
--- usr/src/nv/nv-linux.h	2008-04-02 01:17:56.000000000 -0700
+++ usr/src/nv.2404825/nv-linux.h	2008-05-06 16:22:16.603101044 -0700
@@ -145,16 +145,19 @@

And that's about it. If the patch works, it will pass these tests, and I should be able to drop it into sgfxi without any further modifications.

Anyone can do these tests, but only people with ATI cards can test the actual driver, if it works, etc.