Mach64 DRI on Linux 2.6

I got my Mach64-based video chip (ATI Rage Mobility) doing DRI again on my Inspiron 3800 running Linux 2.6.1. I installed the applicable Mach64 library debs and module source debs from http://people.debian.org/~daenzer/dri-mach64-sid/, unpacked the source, patched it up a bit by hand, reconfigured X a bit, and it seems I have 3D support again.

I had to drop back to 16bpp default depth to get enough memory for DRI to stay enabled.

To get it to even build against 26, I came up with this minimal patch to the drm-mach64-module source as unpacked from daenzer's deb file:

diff -rc drm-mach64/Makefile.kernel drm-mach64-2.6/Makefile.kernel
*** drm-mach64/Makefile.kernel	Tue Jan 20 14:21:52 2004
--- drm-mach64-2.6/Makefile.kernel	Tue Jan 20 14:22:29 2004
***************
*** 49,55 ****
  obj-$(CONFIG_DRM_FFB)   += ffb.o
  
  ifeq ($(BELOW2552),y)
! include $(TOPDIR)/Rules.make
  endif
  
  ifeq ($(BELOW25),y)
--- 49,55 ----
  obj-$(CONFIG_DRM_FFB)   += ffb.o
  
  ifeq ($(BELOW2552),y)
! include $(TOPDIR)/debian/rules
  endif
  
  ifeq ($(BELOW25),y)
diff -rc drm-mach64/debian/control.m4 drm-mach64-2.6/debian/control.m4
*** drm-mach64/debian/control.m4	Sun May  4 11:35:50 2003
--- drm-mach64-2.6/debian/control.m4	Tue Jan 20 14:05:10 2004
***************
*** 1,3 ****
--- 1,4 ----
+ Source: drm-mach64-module-KVERS
  Section: graphics
  Priority: extra
  Maintainer: KMAINT <KEMAIL>
diff -rc drm-mach64/drmP.h drm-mach64-2.6/drmP.h
*** drm-mach64/drmP.h	Sun May  4 12:28:46 2003
--- drm-mach64-2.6/drmP.h	Tue Jan 20 13:58:13 2004
***************
*** 48,54 ****
  #include <linux/init.h>
  #include <linux/file.h>
  #include <linux/pci.h>
! #include <linux/wrapper.h>
  #include <linux/version.h>
  #include <linux/sched.h>
  #include <linux/smp_lock.h>	/* For (un)lock_kernel */
--- 48,54 ----
  #include <linux/init.h>
  #include <linux/file.h>
  #include <linux/pci.h>
! /* include <linux/wrapper.h> */
  #include <linux/version.h>
  #include <linux/sched.h>
  #include <linux/smp_lock.h>	/* For (un)lock_kernel */
***************
*** 470,475 ****
--- 470,477 ----
  } drm_device_dma_t;
  
  #if __REALLY_HAVE_AGP
+ typedef struct agp_memory agp_memory;
+ 
  typedef struct drm_agp_mem {
  	unsigned long      handle;
  	agp_memory         *memory;
***************
*** 479,484 ****
--- 481,488 ----
  	struct drm_agp_mem *next;
  } drm_agp_mem_t;
  
+ typedef struct agp_kern_info agp_kern_info;
+ 
  typedef struct drm_agp_head {
  	agp_kern_info      agp_info;
  	drm_agp_mem_t      *memory;

Once it builds, the resulting deb package installs the module as /lib/module/2.6.1/kernel/drivers/char/drm/mach64.o. It needs to be renamed to mach64.ko. I couldn't figure out how to get the Makefile to do that for me, so I just did it by hand.

After the X server's reconfigured, the module is installed and renamed, I restart my X server and I was in business. Of course, my path to discovering this clear-cut method was not near as direct.

Update: Some people reported having trouble with my patch as presented above, so here's a link: drm-mach64-2.6.patch.txt.


Filed Under: Linux