#44 [PATCH] ati.2 driver and XFree86

Stefan Fiedler

for some reason the mails I sent to the devel list did not arrive, even
after subscribing and creating an sf account, so I try it here.

Dear Gatos Developers,
In an effort to build the ati.2 driver (todays cvs co) from source
against XFree86, I encountered several compile errors that
can be split into two groups;

1) The following #define's were removed from
xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h for reasons
I don't know:

#define PCI_CHIP_R200_Qh 0x5168
#define PCI_CHIP_R200_Qi 0x5169
#define PCI_CHIP_R200_Qj 0x516A
#define PCI_CHIP_R200_Qk 0x516B
#define PCI_CHIP_R200_Ql 0x516C /* Undocumented in all
ATI manuals */

Those are used by radeon_probe.c and radeon_driver.c.
I added them to radeon_probe.h.

2) several functions use an undeclared pScreen variable:
ATIPutImage, ATIPutVideo in atixv.c
R128PutImage, R128PutVideo in r128_video.c
RadeonPutImage, RadeonPutVideo in radeon_video.c

Putting 'ScreenPtr pScreen;' at the beginning of each function is just
a wild guess and most probably wrong, but at least it compiles ;-)
... most probably wrong, so I tried something different, and took a
look at the XFree86 4.4.0 sources,
e.g. /xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c.

The pScreen error in the gatos driver occurs only once in each of the
above mentioned functions, namely in the expression
REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
which is the same in every function.
So let's see how this looks in XFree86 4.4.0 in the same functions:
REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);

Making this substitution compiles, too, and seems to me worth a try.
I don't have the hardware to test it at hands, though, and kindly ask
you for feedback.
Patch attached, to be applied in the top level Gatos ati.2 driver
directory (ati.2/), typing
patch -p1 < thepatchfile
Please note: the patches apply to today's cvs checkout, built against
XFree86 (4.4.0 prerelease) and do not handle compilation
for other XFree86 mainlines (e.g. 4.3).

Yours sincerely,
Stefan Fiedler