Xavier Bachelot wrote:
Actually, your xorg server is not compiled against libpciaccess, so you're not testing the new code. But thanks for testing anyway.
Yep, you are right. So I build a new xorg server with libpciaccess, with a little help from http://www.x.org/wiki/Development/git. I pulled new versions from git for libpciaccess, mesa, libdrm and xserver.
Then I rebuild the openchrome-driver.First problem: configure didn't find my xorg-server.h, because I've build it in /usr/X11R7. The xorg_cflags.patch fixes this. The patch also sets the minversion of pciaccess to 0.10.0, because thats the current development-version which is needed by the current xserver.
Next problem: the driver uses xf86memcpy, but this function is removed from xserver with the removal of the libc_wrapper in hw/xfree86/os-support.
The xf86memcpy.patch replaces xf86memcpy with memcpy.Last problem: the size of the videoram wasn't detected for my CLE266. I've added detection for it. Extra complication was that pciReadByte is also from hw/xfree86/os-support/bus/Pci.c with the libpciwork.
So I've added an entry for my CLE266, see the detect_videoram.patchResult: I can start xorg, with direct rendering. Glxgears runs, even a little bit faster than before, but with the bottom part of the window distorted. Moving the window around or trying to kill it sometimes crashes the xserver.
Returning to console shows this error:error setting MTRR (base = 0xdc000000, size = 0x00009000, type = 1) Invalid argument
In my sys.log I see these: mtrr: no MTRR for dc000000,9000 found mtrr: base(0xdc000000) is not aligned on a size(0x9000) boundary And after the last crash I saw this: [drm:investigate_hazard] *ERROR* Illegal DMA data: 0x75158165 One last item that may be of interest: cat /proc/mtrr reg00: base=0x00000000 ( 0MB), size= 512MB: write-back, count=1 reg01: base=0x1e000000 ( 480MB), size= 32MB: uncachable, count=1 reg02: base=0xd0000000 (3328MB), size= 128MB: write-combining, count=1 reg03: base=0xd8000000 (3456MB), size= 8MB: write-combining, count=1 Hope this is useful for you. Bye Erik-Jan
Xorg.0.log.gz
Description: application/gzip
--- openchrome-pci-20071208-orig/src/via_driver.c 2007-12-21
23:51:22.000000000 +0100
+++ openchrome-pci-20071208/src/via_driver.c 2007-12-22 01:53:39.000000000
+0100
@@ -868,6 +868,10 @@
vgaHWPtr hwp;
int i, bMemSize = 0;
+#if XSERVER_LIBPCIACCESS
+ struct pci_device *bridge = via_host_bridge ();
+#endif
+
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAPreInit\n"));
if (pScrn->numEntities > 1)
@@ -1070,7 +1074,7 @@
else {
/* Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip revision
*/
#if XSERVER_LIBPCIACCESS
- struct pci_device *bridge = via_host_bridge ();
+// struct pci_device *bridge = via_host_bridge ();
pci_device_cfg_read_u32 (bridge, & pVia->ChipRev, 0xF6);
#else
@@ -1538,6 +1542,9 @@
/* Detect the amount of installed RAM */
switch (pVia->Chipset) {
case VIA_CLE266:
+ pci_device_cfg_read_u32 (bridge, & pScrn->videoRam, 0xE1);
+ pScrn->videoRam = (1 << ( ( pScrn->videoRam & 0x70) >> 4 )) << 10 ;
+ break;
case VIA_KM400:
pScrn->videoRam = ( 1 << ( ( pciReadByte(pciTag(0, 0, 0), 0xE1) &
0x70 ) >> 4 ) ) << 10 ;
break;
--- openchrome-pci-20071208-orig/src/via_memcpy.c 2007-12-08
21:11:30.000000000 +0100
+++ openchrome-pci-20071208/src/via_memcpy.c 2007-12-22 00:49:46.000000000
+0100
@@ -329,7 +329,7 @@
if ( yuv422 ) w <<= 1;
if (dstPitch == w) {
int size = h*((yuv422) ? w : (w + (w >> 1)));
- xf86memcpy(dst, src, size);
+ memcpy(dst, src, size);
return;
} else {
int count;
@@ -338,7 +338,7 @@
count = h;
while(count--) {
- xf86memcpy(dst, src, w);
+ memcpy(dst, src, w);
src += w;
dst += dstPitch;
}
@@ -354,7 +354,7 @@
count = h;
while(count--) {
- xf86memcpy(dst, src, w);
+ memcpy(dst, src, w);
src += w;
dst += dstPitch;
}
diff -Naur openchrome-pci-20071208-orig/configure.ac
openchrome-pci-20071208/configure.ac
--- openchrome-pci-20071208-orig/configure.ac 2007-12-08 21:11:30.000000000
+0100
+++ openchrome-pci-20071208/configure.ac 2007-12-21 22:48:25.465407987
+0100
@@ -77,13 +77,17 @@
# Checks for header files.
AC_HEADER_STDC
+
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $XORG_CFLAGS"
AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include
"xorg-server.h"])
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
- [#include "xorg/xorg-server.h"])
+ [#include "xorg-server.h"])
+CFLAGS="$SAVE_CFLAGS"
if test x$XSERVER_LIBPCIACCESS = xyes; then
- PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+ PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10.0])
fi
if test "$DRI" != no; then
_______________________________________________ openchrome-users mailing list [email protected] http://wiki.openchrome.org/mailman/listinfo/openchrome-users Main page: http://www.openchrome.org Wiki: http://wiki.openchrome.org User Forum: http://wiki.openchrome.org/tikiwiki/tiki-view_forum.php?forumId=1
