Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Christopher C. Chimelis" <chris@debian.org>
To: Peter Petrakis <ppetrakis@alphalinux.org>
Cc: Dave Gilbert <gilbertd@treblig.org>,
	axp-list@redhat.com, kbagel@yahoo.com
Subject: Re: DRI, Glide, and 2+ days of hacktivity (fixed!)
Date: Sun, 26 Nov 2000 01:00:34 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0011260050060.15147-200000@spawn.hockeyfiend.com> (raw)
In-Reply-To: <3A2097F0.4020308@alphalinux.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 714 bytes --]


On Sat, 25 Nov 2000, Peter Petrakis wrote:

> Yes please do send those along sir. thank you.

I'm attaching the whole diff that I used for Debian.  Some of the parts
may/may not be needed depending on if you have problems with that
undefined _bus_base() problem.  The patch also enables Jensen support
since it appears that some older motherboards that aren't Jensens are
still returning no dense mem base address when checked by glibc.

> Yeah, I think i'm gonna buy that. This and 512MB for my LX are my X-mass 
> present for
> me this year :-) Have you noticed how CHEAP ram has gotten latley?

Yes.  It really makes me wish I had even a little money :-)  I would like
to beef up my SX to at least 256MB...

C

[-- Attachment #2: Type: TEXT/PLAIN, Size: 10849 bytes --]

--- xc/programs/Xserver/hw/xfree86/SuperProbe/OS_Linux.c~	Fri Nov 10 21:25:57 2000
+++ xc/programs/Xserver/hw/xfree86/SuperProbe/OS_Linux.c	Fri Nov 10 21:26:26 2000
@@ -37,6 +37,9 @@
 #include <sys/mman.h>
 
 #ifdef __alpha__
+
+#include <sys/io.h>
+
 /*
  * The Jensen lacks dense memory, thus we have to address the bus via
  * the sparse addressing scheme.
--- xc/programs/Xserver/hw/xfree86/loader/loadmod.c~	Fri Nov 10 21:26:45 2000
+++ xc/programs/Xserver/hw/xfree86/loader/loadmod.c	Fri Nov 10 21:27:43 2000
@@ -1001,7 +1001,7 @@
 	 * memory before jumping to that code, you may
 	 * do it here.
 	 */
-#ifdef __alpha__
+#if defined(__alpha__) && !defined(linux)
 	istream_mem_barrier();
 #endif
 	return ret;
@@ -1045,7 +1045,7 @@
     TestFree (mod->name);
     TestFree (mod->filename);
     xfree (mod);
-#ifdef __alpha__
+#if defined(__alpha__) && !defined(linux)
 	istream_mem_barrier();
 #endif
 }
--- xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c~	Fri Nov 10 21:28:11 2000
+++ xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c	Fri Nov 10 21:28:44 2000
@@ -31,6 +31,10 @@
 #define LOADER_PRIVATE
 #include "loader.h"
 
+#if defined(__alpha__) && defined(linux)
+# include <sys/io.h>
+#endif
+
 /* XXX beware (or fix it) libc functions called here are the xf86 ones */
 
 #ifdef USE_MODULES
--- xc/config/cf/linux.cf~	Fri Nov 17 15:01:38 2000
+++ xc/config/cf/linux.cf	Fri Nov 17 15:01:39 2000
@@ -506,7 +506,7 @@
 # define OptimizedCDebugFlags	DefaultGcc2AxpOpt
 # define LinuxMachineDefines	-D__alpha__
 # define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME -DPART_NET
-# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
+# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64 -DJENSEN_SUPPORT
 # ifdef UseCompaqMathLibrary
 #  define MathLibrary		-lcpml -lm
 # endif
--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c~	Thu Nov 16 09:25:40 2000
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c	Thu Nov 16 09:36:19 2000
@@ -298,7 +298,7 @@
 	if (isJensen) {
 # ifndef JENSEN_SUPPORT
 	  FatalError("Jensen is not supported any more\n"
-		     "If you are interesetd in fixing Jensen support\n"
+		     "If you are interested in fixing Jensen support\n"
 		     "please contact xfree86@xfree86.org\n");
 # else
 	  xf86Msg(X_INFO,"Machine type is Jensen\n");
@@ -558,14 +558,21 @@
 		   strerror(errno));
       }
       /* This requirers linux-0.99.pl10 or above */
-      lnxBase = mmap((caddr_t)0, 0x100000000,
+      lnxBase = mmap((caddr_t)0, 0x100000000, /* 4GB!! */
 		     PROT_READ | PROT_WRITE,
 		     MAP_SHARED, fd,
 		     (off_t) _bus_base());
+#ifdef __alpha__
+      lnxSBase = mmap((caddr_t)0, 0x400000000, /* 16GB!! */
+		      PROT_READ | PROT_WRITE,
+		      MAP_SHARED, fd,
+		      (off_t) _bus_base_sparse());
+#else
       lnxSBase = mmap((caddr_t)0, 0x100000000,
 		      PROT_READ | PROT_WRITE,
 		      MAP_SHARED, fd,
 		      (off_t) _bus_base_sparse());
+#endif
       
       close(fd);
       
@@ -590,6 +597,7 @@
 
     Offset += (unsigned long)Base - (unsigned long)lnxBase;
     shift = (Offset & 0x3) << 3;
+#ifndef __alpha__
       if (Offset >= (1UL << 24)) {
         msb = Offset & 0xf8000000UL;
         Offset -= msb;
@@ -598,6 +606,7 @@
 	msb_set = msb;
 	}
       }
+#endif
 
     result = *(vuip) ((unsigned long)lnxSBase + (Offset << 5));
     result >>= shift;
@@ -612,6 +621,7 @@
 
     Offset += (unsigned long)Base - (unsigned long)lnxBase;
     shift = (Offset & 0x2) << 3;
+#ifndef __alpha__
     if (Offset >= (1UL << 24)) {
         msb = Offset & 0xf8000000UL;
         Offset -= msb;
@@ -620,6 +630,7 @@
 	msb_set = msb;
       }
     }
+#endif
     result = *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2)));
     result >>= shift;
     return 0xffffUL & result;
@@ -638,6 +649,7 @@
     register unsigned int b = Value & 0xffU;
 
     Offset += (unsigned long)Base - (unsigned long)lnxBase;
+#ifndef __alpha__
     if (Offset >= (1UL << 24)) {
       msb = Offset & 0xf8000000;
       Offset -= msb;
@@ -646,6 +658,7 @@
 	msb_set = msb;
       }
     }
+#endif
     *(vuip) ((unsigned long)lnxSBase + (Offset << 5)) = b * 0x01010101;
     mem_barrier();
 }
@@ -657,6 +670,7 @@
     register unsigned int w = Value & 0xffffU;
 
     Offset += (unsigned long)Base - (unsigned long)lnxBase;
+#ifndef __alpha__
     if (Offset >= (1UL << 24)) {
       msb = Offset & 0xf8000000;
       Offset -= msb;
@@ -667,6 +681,9 @@
     }
     *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) =
       w * 0x00010001;
+#else
+    *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x10001;
+#endif
     mem_barrier();
 
 }
@@ -686,6 +703,7 @@
     register unsigned int b = Value & 0xffU;
 
     Offset += (unsigned long)Base - (unsigned long)lnxBase;
+#ifndef __alpha__
     if (Offset >= (1UL << 24)) {
       msb = Offset & 0xf8000000;
       Offset -= msb;
@@ -694,6 +712,7 @@
 	msb_set = msb;
       }
     }
+#endif
     *(vuip) ((unsigned long)lnxSBase + (Offset << 5)) = b * 0x01010101;
 }
 
@@ -704,6 +723,7 @@
     register unsigned int w = Value & 0xffffU;
 
     Offset += (unsigned long)Base - (unsigned long)lnxBase;
+#ifndef __alpha__
     if (Offset >= (1UL << 24)) {
       msb = Offset & 0xf8000000;
       Offset -= msb;
@@ -714,6 +734,9 @@
     }
     *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) =
       w * 0x00010001;
+#else
+    *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x10001;
+#endif
 }
 
 static void
--- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c~	Thu Nov 16 09:11:27 2000
+++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c	Thu Nov 16 09:23:46 2000
@@ -216,11 +216,25 @@
 
     mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT;
 
+#ifdef __alpha__
+    /* map 8K instead of 4K, so PDIO is subsumed */
+    pNv->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
+                                      regBase+0x00680000, 0x00002000);
+#else
     pNv->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00680000, 0x00001000);
+#endif
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PRAMDAC %x\n", pNv->riva.PRAMDAC));
+#ifdef __alpha__
+    /* map 8K instead of 4K, so PDIO is subsumed */
+    pNv->riva.PFB     = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
+                                      regBase+0x00100000, 0x00002000);
+#else
     pNv->riva.PFB     = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00100000, 0x00001000);
+#endif
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PFB %x\n", pNv->riva.PFB));
     pNv->riva.PFIFO   = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00002000, 0x00002000);
@@ -228,11 +242,23 @@
     pNv->riva.PGRAPH  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00400000, 0x00002000);
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PGRAPH %x\n", pNv->riva.PGRAPH));
+#ifdef __alpha__
+    /* Done as part of PFB map of 8K (see above) */
+    pNv->riva.PEXTDEV = (U032 *)(((U008 *)pNv->riva.PFB) + 0x1000); /* HACK! SPARSE will fail! */
+#else
     pNv->riva.PEXTDEV = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00101000, 0x00001000);
+#endif
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PEXTDEV %x\n", pNv->riva.PEXTDEV));
+#ifdef __alpha__
+    /* Must map 8K or more on Alpha. */
+    pNv->riva.PTIMER  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
+                                      regBase+0x00008000, 0x00002000);
+    pNv->riva.PTIMER  = (U032*)(((U008 *)pNv->riva.PTIMER) + 0x1000);
+#else
     pNv->riva.PTIMER  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00009000, 0x00001000);
+#endif
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- PTIMER %x\n", pNv->riva.PTIMER));
     pNv->riva.PMC     = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                       regBase+0x00000000, 0x00001000);
@@ -245,12 +271,18 @@
      * These registers are read/write as 8 bit values.  Probably have to map
      * sparse on alpha.
      */
+#ifdef __alpha__
+    /* Done as part of PCRTC map of 8K (see below). */
+    pNv->riva.PCIO = (U008 *)pNv->riva.PCRTC + 0x1000;  /* HACK! SPARSE will fail! */
+    pNv->riva.PDIO = (U008 *)pNv->riva.PRAMDAC + 0x1000; /* HACK! SPARSE will fail! */
+#else
     pNv->riva.PCIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
                                            pNv->PciTag, regBase+0x00601000,
                                            0x00001000);
     pNv->riva.PDIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
                                            pNv->PciTag, regBase+0x00681000,
                                            0x00001000);
+#endif
     pNv->riva.PVIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
                                            pNv->PciTag, regBase+0x000C0000,
                                            0x00001000);
@@ -307,8 +339,14 @@
     mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT;
     pNv->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                      regBase+0x00710000, 0x00010000);
+#ifdef __alpha__
+    /* map 8K instead of 4K, so PCIO is subsumed. */
+    pNv->riva.PCRTC  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
+                                     regBase+0x00600000, 0x00002000);
+#else
     pNv->riva.PCRTC  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                      regBase+0x00600000, 0x00001000);
+#endif
 
     NVCommonSetup(pScrn);
 }
@@ -328,8 +366,14 @@
     mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT;
     pNv->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                      regBase+0x00710000, 0x00010000);
+#ifdef __alpha__
+    /* map 8K instead of 4K, so PCIO is subsumed. */
+    pNv->riva.PCRTC  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
+                                     regBase+0x00600000, 0x00002000);
+#else
     pNv->riva.PCRTC  = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pNv->PciTag,
                                      regBase+0x00600000, 0x00001000);
+#endif
 
     NVCommonSetup(pScrn);
 }

  reply	other threads:[~2000-11-26  6:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-25 23:51 DRI, Glide, and 2+ days of hacktivity (fixed!) Dave Gilbert
2000-11-26  3:11 ` Christopher C. Chimelis
2000-11-26  4:13 ` Peter Petrakis
2000-11-26  4:42   ` Christopher C. Chimelis
2000-11-26  4:56     ` Peter Petrakis
2000-11-26  6:00       ` Christopher C. Chimelis [this message]
2000-11-26  6:16   ` Alan Young
2000-11-26 15:32     ` Peter Petrakis
2000-11-27  2:58       ` Alan Young
2000-11-27  0:54     ` Rich Payne
  -- strict thread matches above, loose matches on Subject: below --
2000-11-26 21:07 Greg Meno
2000-11-27  9:50 ` Dr. David Gilbert
2000-11-27 10:56   ` Christian Iseli
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox