Re: drm@macppc, please test

2012-12-07 Thread Jasper Lievisse Adriaanse
On Fri, Dec 07, 2012 at 05:28:42AM +0100, J??r??mie Courr??ges-Anglas wrote:
 Hi,
 
 this is seems to work as expected, known issues included.
 glxgears runs OK but displays some artifacts, and the console is full of
 garbage after exiting X.
 
 I've put the dmesg, Xorg.0.log, etc here:
 
 http://autogeree.net/~jca/tmp/g4-drm/
 
 Thanks a lot, it's quite nice to have DRI. :)
 
 -- 
 J??r??mie Courr??ges-Anglas
 GPG Key fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494
Nice, I now get  750 FPS on my iBook g4:

memc0 at mainbus0: uni-n rev 0xd2
vgafb0 at pci0 dev 16 function 0 ATI Radeon Mobility 9550 rev 0x80, mmio

GL_RENDERER   = Mesa DRI R300 (RV350 4E56) AGP 4x  TCL

Though I'm observing the same artifcats as Jeremie is getting.
Still, great work Martin! 

-- 
Cheers,
Jasper

Stay Hungry. Stay Foolish



Re: drm@macppc, please test

2012-12-07 Thread Matthieu Herrb
On Thu, Dec 06, 2012 at 05:53:05PM +0100, Martin Pieuchot wrote:
 
 If it works for you, I would be pleased to hear it, otherwise try to
 rebuild a custom kernel with the DRMDEBUG option and send me your
 dmesg, Xorg.0.log and /var/log/messages with the drm vomit in it.

On my iBook G3 700 with 

mpcpcibr0 at mainbus0 pci: uni-north, Revision 0xff
pci0 at mpcpcibr0 bus 0
pchb0 at pci0 dev 11 function 0 Apple Pangea AGP rev 0x00
appleagp0 at pchb0
agp0 at appleagp0: aperture at 0x0, size 0x1000
vgafb0 at pci0 dev 16 function 0 ATI Radeon Mobility M7 rev 0x00, mmio
wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation)
radeondrm0 at vgafb0: irq 48
drm0 at radeondrm0

X fails to start, claiming that radeo_dri.so can't be loaded.  With
the patch below (to also build the r100 dri driver) X starts fine,
glxgears works and glxinfo reports

OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Mesa DRI R100 (RV200 4C57) AGP 2x  TCL
OpenGL version string: 1.3 Mesa 7.11.2
OpenGL extensions:

On exit text mode is not restored correctly though.

Index: Makefile
===
RCS file: /cvs/xenocara/lib/libGL/dri/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- Makefile29 Aug 2012 12:52:39 -  1.13
+++ Makefile7 Dec 2012 11:09:21 -
@@ -5,7 +5,7 @@
 .if ${MACHINE} == i386 || ${MACHINE} == amd64
 SUBDIR+= i810 i915 i965 radeon r200 r300 r600
 .elif ${MACHINE} == macppc
-SUBDIR+= r200 r300
+SUBDIR+= radeon r200 r300
 .endif
 
 build depend all install clean cleandir: _SUBDIRUSE

-- 
Matthieu Herrb



Re: drm@macppc, please test

2012-12-07 Thread Antoine Jacoutot
 Finally if you test this stuff, I would like to know which AGP revision
 and graphic card you are using, please include the output of the
 following command in your report:
 
$ dmesg |grep -e ^vgafb -e uni-n rev

PowerBook 17'
hw.model=7447A (Revision 0x101)
hw.product=PowerBook5,5

There are some display glitches with glxgears. All clutter based apps are all 
blue (which is a known issue iirc).
That said...

$ dmesg |grep -e ^vgafb -e uni-n rev
memc0 at mainbus0: uni-n rev 0xd2
vgafb0 at pci0 dev 16 function 0 ATI Radeon Mobility M10 rev 0x00, mmio

$ glxgears -info
* before
Software Rasterizer 38.148 FPS
* after
Mesa DRI R300 (RV350 4E50) AGP Ax TCL   1462.029 FPS

Impressive :-)

-- 
Antoine



Re: drm@macppc, please test

2012-12-07 Thread Martin Pieuchot
On 07/12/12(Fri) 12:10, Matthieu Herrb wrote:
 On Thu, Dec 06, 2012 at 05:53:05PM +0100, Martin Pieuchot wrote:
  
  If it works for you, I would be pleased to hear it, otherwise try to
  rebuild a custom kernel with the DRMDEBUG option and send me your
  dmesg, Xorg.0.log and /var/log/messages with the drm vomit in it.
 
 On my iBook G3 700 with 
 
 mpcpcibr0 at mainbus0 pci: uni-north, Revision 0xff
 pci0 at mpcpcibr0 bus 0
 pchb0 at pci0 dev 11 function 0 Apple Pangea AGP rev 0x00
 appleagp0 at pchb0
 agp0 at appleagp0: aperture at 0x0, size 0x1000
 vgafb0 at pci0 dev 16 function 0 ATI Radeon Mobility M7 rev 0x00, mmio
 wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation)
 radeondrm0 at vgafb0: irq 48
 drm0 at radeondrm0
 
 X fails to start, claiming that radeo_dri.so can't be loaded.  With
 the patch below (to also build the r100 dri driver) X starts fine,
 glxgears works and glxinfo reports
 
 OpenGL vendor string: Tungsten Graphics, Inc.
 OpenGL renderer string: Mesa DRI R100 (RV200 4C57) AGP 2x  TCL
 OpenGL version string: 1.3 Mesa 7.11.2
 OpenGL extensions:
 
 On exit text mode is not restored correctly though.

Ok, so it looks like only the r200 restore it correctly. Can you tell
what is the output of:

$ dmesg |grep uni-n rev

Because the version given above is not always correct.

 Index: Makefile
 ===
 RCS file: /cvs/xenocara/lib/libGL/dri/Makefile,v
 retrieving revision 1.13
 diff -u -r1.13 Makefile
 --- Makefile  29 Aug 2012 12:52:39 -  1.13
 +++ Makefile  7 Dec 2012 11:09:21 -
 @@ -5,7 +5,7 @@
  .if ${MACHINE} == i386 || ${MACHINE} == amd64
  SUBDIR+= i810 i915 i965 radeon r200 r300 r600
  .elif ${MACHINE} == macppc
 -SUBDIR+= r200 r300
 +SUBDIR+= radeon r200 r300
  .endif
  
  build depend all install clean cleandir: _SUBDIRUSE

Please, commit this change, ok mpi@



Sendbug getenv

2012-12-07 Thread Maxime Villard
Hi,
== src/usr.bin/sendbug/sendbug.c ==
Tell me if I'm wrong, but in the main() function, we call
getenv() two times (l. 113  134) without holding the result
of the first call.

According to man getenv:
 The string pointed to may be overwritten by a subsequent
  call to getenv()

After the second call, main() could launch hwdump() which
uses the return value of the first call, which could have been
overwritten by the second one.

We should hold the return value in a char instead of a pointer,
with something like:


--- sendbug.c   2012-07-21 21:55:17.0 +0200
+++ sendbug.c   2012-12-07 19:04:04.770853812 +0100
@@ -83,7 +83,7 @@
 {
int ch, c, fd, ret = 1;
struct stat sb;
-   char *pr_form;
+   char *pr_form, *tmp;
time_t mtime;
FILE *fp;
 
@@ -110,7 +110,8 @@
if (argc  0)
usage();
 
-   if ((tmpdir = getenv(TMPDIR)) == NULL || tmpdir[0] == '\0')
+   if ((tmp = getenv(TMPDIR)) == NULL || tmp[0] == '\0' ||
+   (tmpdir = strdup(tmp)) == NULL)
tmpdir = _PATH_TMP;
 
if (Pflag) {



Shouldn't we ?