From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 1364 invoked from network); 18 Apr 2000 09:42:33 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 18 Apr 2000 09:42:33 -0000 Received: from pc12.civ.hw.ac.uk (root@pc12.civ.hw.ac.uk [137.195.49.67]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id FAA10450 for ; Tue, 18 Apr 2000 05:42:32 -0400 Received: from civ.hw.ac.uk (IDENT:civhr@localhost.localdomain [127.0.0.1]) by pc12.civ.hw.ac.uk (8.9.3/8.9.3) with ESMTP id KAA00872 for ; Tue, 18 Apr 2000 10:42:30 +0100 Sender: civhr@pc12.civ.hw.ac.uk Message-ID: <38FC2E06.8CB49810@civ.hw.ac.uk> Date: Tue, 18 Apr 2000 10:42:30 +0100 From: Hannes Reinecke Organization: Heriot Watt University, Edinburgh X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.3.99-pre4 i586) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: XFree86 4.0 References: <38D24644.B5B3747F@civ.hw.ac.uk> Content-Type: multipart/mixed; boundary="------------34C7DD897363F122F233A32E" This is a multi-part message in MIME format. --------------34C7DD897363F122F233A32E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hiya, > I have problem whith XFree86 4.0 on my PWS433a debian 2.2 kernel 2.2.14 > whith a Matrox Millenium II 4MB. > > When i start XFree86 the computer reboots :( Oh well, we know that one. It most likely due to incorrect setting of the MMIO-areas for pyxis chipsets. Try the attached patch. Unfortunately it didn't make it into the distribution because a) its quite ugly and b) Egbert couldn't agree with himself about the framework for handling these cases. (This is not to slight you, Egbert. I'll be happy to help in any way.) (Once I got a new HD. 'scsi error: Medium Error; additional sense: Scan head positioning error'. Grrr.) Cheers, Hannes -- Hannes Reinecke Fluid Loading and Instrumentation Center Tel: (+44) 131 449 5111 x4430 Dept. of Civil & Offshore Engineering Fax: (+44) 131 451 3154 Heriot Watt University, Edinburgh EH14 4AS --------------34C7DD897363F122F233A32E Content-Type: text/plain; charset=us-ascii; name="xfree.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xfree.diff" diff -u xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c.orig xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c --- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c.orig Sat Feb 26 05:43:53 2000 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c Thu Mar 16 23:28:15 2000 @@ -66,9 +66,8 @@ # define isJensen (!_bus_base()) # endif -# define needSparse (_bus_base_sparse() != 0) - -# define BUS_BASE _bus_base() +static unsigned long xf86_axp_IOBase; +# define BUS_BASE xf86_axp_IOBase #else @@ -83,6 +82,7 @@ static pointer mapVidMem(int, unsigned long, unsigned long); static void unmapVidMem(int, pointer, unsigned long); #if defined (__alpha__) +static int checkSparseVidMemBase( void ); static pointer mapVidMemSparse(int, unsigned long, unsigned long); static void unmapVidMemSparse(int, pointer, unsigned long); # if defined(JENSEN_SUPPORT) @@ -298,15 +298,15 @@ 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"); pVidMem->mapMem = mapVidMemJensen; pVidMem->unmapMem = unmapVidMemJensen; # endif /* JENSEN_SUPPORT */ - } else if (needSparse) { - xf86Msg(X_INFO,"Machine needs sparse mapping\n"); + } else if (checkSparseVidMemBase()) { + xf86Msg(X_INFO,"Machine needs sparse mapping\n"); pVidMem->mapMem = mapVidMemSparse; pVidMem->unmapMem = unmapVidMemSparse; } else { @@ -508,6 +508,82 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset); static void writeSparse32(int Value, pointer Base, register unsigned long Offset); + +static int checkSparseVidMemBase( void ) +{ + char buf[256]; + char cpu_model[64]; + char sys_type[64]; + char sys_var[64]; + FILE *info_fptr; + int has_bwx = 1; + int can_bwa = 1; + + if (_bus_base_sparse()) { + /* Open /proc/cpuinfo to find out about where we are running on */ + info_fptr = fopen("/proc/cpuinfo","r"); + if (!info_fptr) { + xf86Msg(X_WARNING, + "Could not open /proc/cpuinfo, falling back to default\n"); + xf86_axp_IOBase = _bus_base_sparse(); + return 1; + } + + *cpu_model = '\0'; + *sys_type = '\0'; + *sys_var = '\0'; + + while (!feof(info_fptr)) { + fgets(buf,255,info_fptr); + if (sscanf(buf,"cpu model : %s ",cpu_model) == 1) { + if (!strcmp(cpu_model,"EV3") || + !strcmp(cpu_model,"EV4") || + !strcmp(cpu_model,"Simulate") || + !strcmp(cpu_model,"LCA4") || + !strcmp(cpu_model,"EV5") || + !strcmp(cpu_model,"EV45") ) { + has_bwx = 0; + } + } + if (sscanf(buf,"system type : %s ",sys_type) == 1) { + if (strcmp(sys_type, "EB164")) { + can_bwa = 0; + } else { + can_bwa = 1; + } + } + if (sscanf(buf,"system variation : %s ",sys_var) == 1) { + if (!strcmp(sys_var,"EB164") || + !strcmp(sys_var,"PC164") ) { + can_bwa = 0; + } + } + } + fclose(info_fptr); + + xf86Msg(X_INFO,"Alpha %s cpu on a %s (variation %s)\n", + cpu_model, sys_type, + *sys_var?sys_var:"default"); + + if (!has_bwx) { + xf86Msg(X_INFO,"CPU does not support BWX extension\n"); + xf86_axp_IOBase = _bus_base_sparse(); + return 1; + } + + if (!can_bwa) { + xf86Msg(X_INFO, + "System does not support 21164 Byte/Word addressing\n"); + xf86_axp_IOBase = _bus_base_sparse(); + return 1; + } + xf86_axp_IOBase = _bus_base() + 0x200000000; + return 0; + } else { + xf86_axp_IOBase = _bus_base(); + return 0; + } +} static pointer mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size) --------------34C7DD897363F122F233A32E--