tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Xserver works on bebox with s3



Hi! all,


I support Xserver with s3 on bebox.
However, screens are a bit dark, and some black vertical lines have crossed
the screen to it.  It thinks about the possibility that s3_drv.o doesn't
set all registers.
It is likely to be able to refer to this patch with ibmnws and prep.
However, s3_drv.o did not support 'Vision 864' though I tried the support
with s3 on my prep.  I am looking at the source-code of old X now.

In addition, submodules not resolve some symbols, and I gave up this though
I tried the support of mga.  Should I use XORG?

Thanks,
--
kiyohara
Index: libexec/ld.elf_so/rtld.c
===================================================================
RCS file: /cvsroot/src/libexec/ld.elf_so/rtld.c,v
retrieving revision 1.120
diff -u -r1.120 rtld.c
--- libexec/ld.elf_so/rtld.c    24 Jul 2008 04:39:25 -0000      1.120
+++ libexec/ld.elf_so/rtld.c    22 Nov 2008 17:17:04 -0000
@@ -813,6 +813,12 @@
        return(NULL);
 }
 
+static void *
+hackish_return_address(void)
+{
+       return __builtin_return_address(1);
+}
+
 __strong_alias(__dlsym,dlsym)
 void *
 dlsym(void *handle, const char *name)
@@ -832,7 +838,8 @@
        case (intptr_t)RTLD_NEXT:
        case (intptr_t)RTLD_DEFAULT:
        case (intptr_t)RTLD_SELF:
-               retaddr = __builtin_return_address(0); /* __GNUC__ only */
+               /* retaddr = __builtin_return_address(0);*/ /* __GNUC__ only */
+               retaddr = hackish_return_address();
                if ((obj = _rtld_obj_from_addr(retaddr)) == NULL) {
                        _rtld_error("Cannot determine caller's shared object");
                        return NULL;
Index: share/mk/bsd.x11.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.x11.mk,v
retrieving revision 1.67
diff -u -r1.67 bsd.x11.mk
--- share/mk/bsd.x11.mk 15 Sep 2008 18:21:48 -0000      1.67
+++ share/mk/bsd.x11.mk 22 Nov 2008 17:18:28 -0000
@@ -116,11 +116,13 @@
 .endif
 
 .if ${MACHINE} == "amd64"      || \
+    ${MACHINE} == "bebox"      || \
     ${MACHINE} == "cats"       || \
     ${MACHINE} == "i386"       || \
     ${MACHINE} == "macppc"     || \
     ${MACHINE} == "netwinder"  || \
     ${MACHINE} == "ofppc"      || \
+    ${MACHINE} == "prep"       || \
     ${MACHINE} == "sgimips"    || \
     ${MACHINE} == "sparc64"    || \
     ${MACHINE} == "sparc"      || \
Index: sys/arch/bebox/bebox/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/bebox/bebox/mainbus.c,v
retrieving revision 1.23
diff -u -r1.23 mainbus.c
--- sys/arch/bebox/bebox/mainbus.c      16 Mar 2008 17:39:56 -0000      1.23
+++ sys/arch/bebox/bebox/mainbus.c      22 Nov 2008 17:19:03 -0000
@@ -134,7 +134,11 @@
 #ifdef PCI_NETBSD_CONFIGURE
        ioext  = extent_create("pciio",  0x00008000, 0x0000ffff, M_DEVBUF,
            NULL, 0, EX_NOWAIT);
-       memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF,
+       /*
+        * We evade the misunderstanding of a lot of applications by
+        * allocating the space from 0x08000000.
+        */
+       memext = extent_create("pcimem", 0x08000000, 0x0fffffff, M_DEVBUF,
            NULL, 0, EX_NOWAIT);
 
        pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE);
Index: sys/arch/bebox/include/param.h
===================================================================
RCS file: /cvsroot/src/sys/arch/bebox/include/param.h,v
retrieving revision 1.10
diff -u -r1.10 param.h
--- sys/arch/bebox/include/param.h      17 Oct 2007 19:54:00 -0000      1.10
+++ sys/arch/bebox/include/param.h      22 Nov 2008 17:19:08 -0000
@@ -49,3 +49,6 @@
 #define        KERNBASE        0x3100
 
 #include <powerpc/param.h>
+
+/* at this offset we mmap() the PCI IO range in display drivers */
+#define PCI_MAGIC_IO_RANGE     0xf2000000
Index: sys/arch/bebox/stand/README
===================================================================
RCS file: /cvsroot/src/sys/arch/bebox/stand/README,v
retrieving revision 1.3
diff -u -r1.3 README
--- sys/arch/bebox/stand/README 25 May 2008 16:21:07 -0000      1.3
+++ sys/arch/bebox/stand/README 22 Nov 2008 17:19:08 -0000
@@ -34,7 +34,7 @@
        [insert formatted floppy disk]
        % mkbootimage/mkbootimage /tmp/boot.pef > /dev/rfd0a
 
-       % powerpc-mkbootimage -m bebox -b boot/boot \
+       % nbpowerpc-mkbootimage -m bebox -b boot/boot \
              -k ../compile/GENERIC/netbsd /tmp/fd.img
        % dd if=/tmp/fd.img of=/dev/rfd0a
 
Index: sys/arch/prep/include/param.h
===================================================================
RCS file: /cvsroot/src/sys/arch/prep/include/param.h,v
retrieving revision 1.4
diff -u -r1.4 param.h
--- sys/arch/prep/include/param.h       17 Jun 2001 16:01:29 -0000      1.4
+++ sys/arch/prep/include/param.h       22 Nov 2008 17:20:35 -0000
@@ -47,3 +47,6 @@
 #define        KERNBASE        0x100000
 
 #include <powerpc/param.h>
+
+/* at this offset we mmap() the PCI IO range in display drivers */
+#define PCI_MAGIC_IO_RANGE     0xf2000000
Index: x11/Xserver/Makefile.common
===================================================================
RCS file: /cvsroot/src/x11/Xserver/Makefile.common,v
retrieving revision 1.34
diff -u -r1.34 Makefile.common
--- x11/Xserver/Makefile.common 8 Mar 2008 10:38:59 -0000       1.34
+++ x11/Xserver/Makefile.common 22 Nov 2008 17:22:43 -0000
@@ -49,7 +49,8 @@
     ${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
     ${MACHINE} == "sgimips" || ${MACHINE} == "sparc64" || \
     ${MACHINE} == "sparc" || ${MACHINE} == "ofppc" || \
-    ${MACHINE} == "netwinder" || ${MACHINE} == "shark"
+    ${MACHINE} == "netwinder" || ${MACHINE} == "shark" || \
+    ${MACHINE} == "bebox" || ${MACHINE} == "prep"
 XSERVER_NEEDS_XFONT=   yes
 XSERVER_NEEDS_MIEXT=   yes
 XSERVER_XFREE86=       yes
Index: x11/Xserver/hw/xfree86/drivers/Makefile
===================================================================
RCS file: /cvsroot/src/x11/Xserver/hw/xfree86/drivers/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- x11/Xserver/hw/xfree86/drivers/Makefile     8 Mar 2008 10:38:59 -0000       
1.22
+++ x11/Xserver/hw/xfree86/drivers/Makefile     22 Nov 2008 17:22:46 -0000
@@ -11,7 +11,8 @@
 SUBDIR+=       i740 i810 neomagic via vmware
 .endif
 
-.if ${MACHINE} != "macppc" && ${MACHINE} != "sgimips" && ${MACHINE} != "ofppc"
+.if ${MACHINE} != "macppc" && ${MACHINE} != "sgimips" && \
+    ${MACHINE} != "ofppc" && ${MACHINE} != "bebox" && ${MACHINE} != "prep"
 SUBDIR+=       apm ark cirrus cyrix dummy i128 nsc \
                rendition siliconmotion tga tseng vesa
 .endif
Index: x11/Xserver/hw/xfree86/drivers/s3/Makefile
===================================================================
RCS file: /cvsroot/src/x11/Xserver/hw/xfree86/drivers/s3/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- x11/Xserver/hw/xfree86/drivers/s3/Makefile  7 Feb 2004 06:52:06 -0000       
1.2
+++ x11/Xserver/hw/xfree86/drivers/s3/Makefile  22 Nov 2008 17:22:49 -0000
@@ -45,6 +45,12 @@
 CPPFLAGS.s3_accel_pio.c=       -DS3_GENERIC
 CPPFLAGS.s3_video.c=           -DS3_NEWMMIO
 
+.if ${MACHINE} == "bebox"
+# BootROM(BeBox's firmware) initialize only for framebuffer mode.  In a word,
+# it doesn't have the space of 0xbffff from 0xa0000.
+CPPFLAGS+=     -DAVOID_INT10 -DAVOID_VGAHW_SAVEFONTS
+.endif
+
 .include <bsd.x11.mk>
 LIBDIR=        ${XMODULEDIR}
 .include "../../Makefile.drivermod"
Index: x11/Xserver/hw/xfree86/xf86/Makefile
===================================================================
RCS file: /cvsroot/src/x11/Xserver/hw/xfree86/xf86/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- x11/Xserver/hw/xfree86/xf86/Makefile        8 Mar 2008 10:39:00 -0000       
1.11
+++ x11/Xserver/hw/xfree86/xf86/Makefile        22 Nov 2008 17:22:57 -0000
@@ -22,7 +22,8 @@
 CPPFLAGS+=-DUSE_MODULAR_KBD
 .endif
 
-.if ${MACHINE} == "macppc" || ${MACHINE} == "ofppc"
+.if ${MACHINE} == "macppc" || ${MACHINE} == "ofppc" || \
+    ${MACHINE} == "bebox" || ${MACHINE} == "prep"
 CPPFLAGS+=-DUSE_MODULAR_KBD
 .endif
 
Index: x11/Xserver/hw/xfree86/xf86_os/Makefile
===================================================================
RCS file: /cvsroot/src/x11/Xserver/hw/xfree86/xf86_os/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- x11/Xserver/hw/xfree86/xf86_os/Makefile     23 Apr 2008 05:13:43 -0000      
1.19
+++ x11/Xserver/hw/xfree86/xf86_os/Makefile     22 Nov 2008 17:22:57 -0000
@@ -30,7 +30,8 @@
 .endfor
 .endif
 
-.if ${MACHINE} == "macppc" || ${MACHINE} == "ofppc"
+.if ${MACHINE} == "macppc" || ${MACHINE} == "ofppc" || \
+    ${MACHINE} == "bebox" || ${MACHINE} == "prep"
 SRCS.bsd+=     ppc_video.c bsdResource.c pm_noop.c lnx_agp.c
 .for _FN in ${SRCS.bsd}
 CPPFLAGS.${_FN}=       -DWSCONS_SUPPORT -DUSESTDRES -DHAVE_SYSV_IPC \
@@ -85,11 +86,13 @@
 .if ${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
     ${MACHINE} == "sgimips" || ${MACHINE} == "sparc64" || \
     ${MACHINE} == "sparc" || ${MACHINE} == "netwinder" || \
-    ${MACHINE} == "shark" || ${MACHINE} == "ofppc"
+    ${MACHINE} == "shark" || ${MACHINE} == "ofppc" || \
+    ${MACHINE} == "bebox" || ${MACHINE} == "prep"
 SRCS.bus+=     netbsdPci.c
 .endif
 
-.if ${MACHINE} == "macppc" || ${MACHINE} == "ofppc"
+.if ${MACHINE} == "macppc" || ${MACHINE} == "ofppc" || \
+    ${MACHINE} == "bebox" || ${MACHINE} == "prep"
 .for _FN in ${SRCS.bus}
 CPPFLAGS.${_FN}=       -DPCI_VIA_TTYE0
 .endfor
@@ -109,7 +112,8 @@
        ${MACHINE} == "cats" || ${MACHINE} == "sgimips" || \
        ${MACHINE} == "sparc64" || ${MACHINE} == "sparc" || \
        ${MACHINE} == "netwinder" || ${MACHINE} == "shark" || \
-       ${MACHINE} == "ofppc"
+       ${MACHINE} == "ofppc" || ${MACHINE} == "bebox" || \
+       ${MACHINE} == "prep"
 SRCS.misc+=    CBUSmemcpy.c CIODelay.c CSlowBcopy.c
 .endif
 
Index: xfree/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c
===================================================================
RCS file: 
/cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 s3_driver.c
--- xfree/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c 18 Mar 2005 
13:12:00 -0000      1.1.1.4
+++ xfree/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c 22 Nov 2008 
17:40:54 -0000
@@ -467,15 +667,19 @@
                 return FALSE;
         }
 
+#ifndef AVOID_INT10
        if (xf86LoadSubModule(pScrn, "int10")) {
                xf86LoaderReqSymLists(int10Symbols, NULL);
                pS3->pInt10 = xf86InitInt10(pEnt->index);
        }
+#endif
 
+#if !defined(__powerpc__)
        if (xf86LoadSubModule(pScrn, "vbe")) {
                xf86LoaderReqSymLists(vbeSymbols, NULL);
                pS3->pVBE = VBEInit(pS3->pInt10, pEnt->index);
        }
+#endif
        
        if (!xf86SetGamma(pScrn, gzeros))
                return FALSE;
@@ -887,7 +1098,11 @@
 
        save->clock = inb(0x3cc);
 
+#ifndef AVOID_VGAHW_SAVEFONTS
        vgaHWSave(pScrn, pVga, VGA_SR_ALL);
+#else
+       vgaHWSave(pScrn, pVga, VGA_SR_ALL & ~VGA_SR_FONTS);
+#endif
 
        if (pS3->RamDac->RamDacType == TI3025_RAMDAC) {
                outb(vgaCRIndex, 0x5c);
@@ -1654,7 +1869,11 @@
        for(i=4; i<8; i++)
                outb(vgaCRReg, restore->color_stack[i]);
 
+#ifndef AVOID_VGAHW_SAVEFONTS
         vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL);
+#else
+        vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL & ~VGA_SR_FONTS);
+#endif
 
        outb(0x3c2, restore->clock);
 
Section "ServerLayout"
        Identifier     "XFree86 Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        RgbPath      "/usr/X11R6/lib/X11/rgb"
        ModulePath   "/usr/X11R6/lib/modules"
        FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
        FontPath     "/usr/X11R6/lib/X11/fonts/Speedo/"
        FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
        FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
        FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
        FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection
Section "Module"
        Load  "dbe"
        Load  "extmod"
        Load  "glx"
        Load  "record"
        Load  "xtrap"
        Load  "speedo"
        Load  "type1"
EndSection
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "Protocol" "wskbd"
        Option      "Device" "/dev/wskbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "wsmouse"
        Option      "Device" "/dev/wsmouse"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        HorizSync    31.5 - 57.0
        VertRefresh  50.0 - 70.0
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "noaccel"                   # [<bool>]
        #Option     "swcursor"                  # [<bool>]
        #Option     "slow_dram_refresh"         # [<bool>]
        #Option     "slow_dram"                 # [<bool>]
        #Option     "slow_edodram"              # [<bool>]
        #Option     "slow_vram"                 # [<bool>]
        Identifier  "Card0"
        Driver      "s3"
        VendorName  "S3 Inc."
        BoardName   "86c764/765 [Trio32/64/64V+] rev 68"
        BusID       "PCI:0:0:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth     16
#       DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
                Modes    "800x600"
#               Modes    "1024x768"
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
#               Modes    "1024x768"
        EndSubSection
EndSection



Home | Main Index | Thread Index | Old Index