CVS commit: xsrc/external/mit/MesaLib/dist/src/mesa/glapi

2010-01-24 Thread Rafal Boni
Module Name:xsrc
Committed By:   rafal
Date:   Sun Jan 24 15:38:47 UTC 2010

Modified Files:
xsrc/external/mit/MesaLib/dist/src/mesa/glapi: glapi.c glapi_getproc.c
glthread.c

Log Message:
Decorate some GL APIs with PUBLIC so they're available to link against;
otherwise e.g. the swrast DRI module can't find _glapi_check_multithread.

From http://people.freedesktop.org/~krh/glapi.patch with some tweaks.
ok phone@


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi.c \
xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glthread.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi_getproc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi.c:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi.c:1.1.1.2	Thu Jun 11 00:50:16 2009
+++ xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi.c	Sun Jan 24 15:38:47 2010
@@ -221,7 +221,7 @@
  * We should call this periodically from a function such as glXMakeCurrent
  * in order to test if multiple threads are being used.
  */
-void
+PUBLIC void
 _glapi_check_multithread(void)
 {
 #if defined(THREADS)  !defined(GLX_USE_TLS)
Index: xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glthread.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glthread.c:1.1.1.2 xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glthread.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glthread.c:1.1.1.2	Thu Jun 11 00:50:17 2009
+++ xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glthread.c	Sun Jan 24 15:38:47 2010
@@ -36,7 +36,7 @@
 #include stdlib.h
 #include stdio.h
 #include glthread.h
-
+#include main/glheader.h
 
 /*
  * This file should still compile even when THREADS is not defined.
@@ -71,7 +71,7 @@
  */
 #ifdef PTHREADS
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
return (unsigned long) pthread_self();
@@ -125,7 +125,7 @@
 #define USE_LOCK_FOR_KEY	/* undef this to try a version without
    lock for the global key... */
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
abort();   /* XXX not implemented yet */
@@ -203,7 +203,7 @@
DWORD dwErr=GetLastError();
 }
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
return GetCurrentThreadId();
@@ -304,7 +304,7 @@
  */
 #ifdef BEOS_THREADS
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
return (unsigned long) find_thread(NULL);
@@ -346,7 +346,7 @@
  * no-op functions
  */
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
return 0;

Index: xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi_getproc.c
diff -u xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi_getproc.c:1.1.1.1 xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi_getproc.c:1.2
--- xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi_getproc.c:1.1.1.1	Thu Jun 11 00:50:16 2009
+++ xsrc/external/mit/MesaLib/dist/src/mesa/glapi/glapi_getproc.c	Sun Jan 24 15:38:47 2010
@@ -563,7 +563,7 @@
  * in the name of static functions, try generating a new API entrypoint on
  * the fly with assembly language.
  */
-_glapi_proc
+PUBLIC _glapi_proc
 _glapi_get_proc_address(const char *funcName)
 {
struct _glapi_function * entry;



CVS commit: src/sys/compat

2009-11-05 Thread Rafal Boni
Module Name:src
Committed By:   rafal
Date:   Thu Nov  5 18:39:38 UTC 2009

Modified Files:
src/sys/compat/svr4: svr4_misc.c
src/sys/compat/svr4_32: svr4_32_misc.c

Log Message:
Fix fallout from do_sys_wait changes (hi, rmind!)


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/compat/svr4/svr4_misc.c
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/svr4_32/svr4_32_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/svr4/svr4_misc.c
diff -u src/sys/compat/svr4/svr4_misc.c:1.147 src/sys/compat/svr4/svr4_misc.c:1.148
--- src/sys/compat/svr4/svr4_misc.c:1.147	Wed Nov  4 21:23:03 2009
+++ src/sys/compat/svr4/svr4_misc.c	Thu Nov  5 18:39:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_misc.c,v 1.147 2009/11/04 21:23:03 rmind Exp $	 */
+/*	$NetBSD: svr4_misc.c,v 1.148 2009/11/05 18:39:38 rafal Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: svr4_misc.c,v 1.147 2009/11/04 21:23:03 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: svr4_misc.c,v 1.148 2009/11/05 18:39:38 rafal Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -999,7 +999,6 @@
 {
 	int options, status;
 	int error;
-	int was_zombie;
 	struct rusage ru;
 	svr4_siginfo_t i;
 	int id = SCARG(uap, id);
@@ -1037,8 +1036,7 @@
 	 SCARG(uap, grp), id,
 		 SCARG(uap, info), SCARG(uap, options)));
 
-	error = do_sys_wait(l, id, status, options, ru,
-	was_zombie);
+	error = do_sys_wait(id, status, options, ru);
 
 	retval[0] = id;
 	if (error != 0)

Index: src/sys/compat/svr4_32/svr4_32_misc.c
diff -u src/sys/compat/svr4_32/svr4_32_misc.c:1.66 src/sys/compat/svr4_32/svr4_32_misc.c:1.67
--- src/sys/compat/svr4_32/svr4_32_misc.c:1.66	Wed Nov  4 21:23:03 2009
+++ src/sys/compat/svr4_32/svr4_32_misc.c	Thu Nov  5 18:39:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_misc.c,v 1.66 2009/11/04 21:23:03 rmind Exp $	 */
+/*	$NetBSD: svr4_32_misc.c,v 1.67 2009/11/05 18:39:38 rafal Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: svr4_32_misc.c,v 1.66 2009/11/04 21:23:03 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: svr4_32_misc.c,v 1.67 2009/11/05 18:39:38 rafal Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1006,7 +1006,7 @@
 int
 svr4_32_sys_waitsys(struct lwp *l, const struct svr4_32_sys_waitsys_args *uap, register_t *retval)
 {
-	int options, error, status, was_zombie;;
+	int options, error, status;
 	struct rusage ru;
 	int id = SCARG(uap, id);
 
@@ -1041,8 +1041,7 @@
 	if (SCARG(uap, options)  (SVR4_WSTOPPED|SVR4_WCONTINUED))
 		options |= WUNTRACED;
 
-	error = do_sys_wait(l, id, status, options, ru,
-	was_zombie);
+	error = do_sys_wait(id, status, options, ru);
 
 	retval[0] = id;
 	if (error != 0)



CVS commit: src/sys/dev/drm

2009-04-20 Thread Rafal Boni
Module Name:src
Committed By:   rafal
Date:   Tue Apr 21 01:15:37 UTC 2009

Modified Files:
src/sys/dev/drm: drmP.h drm_drv.c drm_scatter.c

Log Message:
Rework scatter / gather page allocation inspired by r186295 of FreeBSD SVN:

rework drm_scatter.c which allocates scatter / gather pages for use by
ati pci gart to use bus_dma to handle the allocations.  This fixes
a garbled screen issue on at least some radeons (X1400 tested).  It is
also likely that this is the correct fix for PR# 119324, though that
is not confirmed yet.

Fixes similar issues on a Radeon Mobility X300, non-Mobility X800 (including
a hard-lock of the machine).

With feedback from ad@, ok mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/drm/drmP.h
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/drm/drm_drv.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/drm/drm_scatter.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/drm/drmP.h
diff -u src/sys/dev/drm/drmP.h:1.33 src/sys/dev/drm/drmP.h:1.34
--- src/sys/dev/drm/drmP.h:1.33	Sun Mar 29 17:00:50 2009
+++ src/sys/dev/drm/drmP.h	Tue Apr 21 01:15:37 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: drmP.h,v 1.33 2009/03/29 17:00:50 mrg Exp $ */
+/* $NetBSD: drmP.h,v 1.34 2009/04/21 01:15:37 rafal Exp $ */
 
 /* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
  * Created: Mon Jan  4 10:05:05 1999 by fa...@precisioninsight.com
@@ -706,11 +706,13 @@
 } drm_agp_head_t;
 
 typedef struct drm_sg_mem {
-	unsigned long   handle;
-	void*virtual;
-	int pages;
-	dma_addr_t	*busaddr;
-	drm_dma_handle_t *dmah;	/* Handle to PCI memory for ATI PCIGART table */
+	unsigned long		  handle;
+	void			 *virtual;
+	int			  pages;
+	dma_addr_t		 *busaddr;
+	struct drm_dma_handle	 *sg_dmah;	/* Handle for sg_pages   */
+	struct drm_dma_handle	 *dmah;		/* Handle to PCI memory  */
+		/* for ATI PCIGART table */
 } drm_sg_mem_t;
 
 typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
@@ -1065,6 +1067,7 @@
 
 /* Scatter Gather Support (drm_scatter.c) */
 void	drm_sg_cleanup(drm_sg_mem_t *entry);
+int	drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request);
 
 #if defined(__FreeBSD__) || defined (__NetBSD__)
 /* sysctl support (drm_sysctl.h) */
@@ -1139,8 +1142,8 @@
 int	drm_agp_bind_ioctl(DRM_IOCTL_ARGS);
 
 /* Scatter Gather Support (drm_scatter.c) */
-int	drm_sg_alloc(DRM_IOCTL_ARGS);
-int	drm_sg_free(DRM_IOCTL_ARGS);
+int	drm_sg_alloc_ioctl(DRM_IOCTL_ARGS);
+int	drm_sg_free_ioctl(DRM_IOCTL_ARGS);
 
 /* consistent PCI memory functions (drm_pci.c) */
 drm_dma_handle_t *drm_pci_alloc(drm_device_t *dev, size_t size, size_t align,

Index: src/sys/dev/drm/drm_drv.c
diff -u src/sys/dev/drm/drm_drv.c:1.23 src/sys/dev/drm/drm_drv.c:1.24
--- src/sys/dev/drm/drm_drv.c:1.23	Fri Apr 17 19:02:33 2009
+++ src/sys/dev/drm/drm_drv.c	Tue Apr 21 01:15:37 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_drv.c,v 1.23 2009/04/17 19:02:33 joerg Exp $ */
+/* $NetBSD: drm_drv.c,v 1.24 2009/04/21 01:15:37 rafal Exp $ */
 
 /* drm_drv.h -- Generic driver template -*- linux-c -*-
  * Created: Thu Nov 23 03:10:50 2000 by gar...@valinux.com
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: drm_drv.c,v 1.23 2009/04/17 19:02:33 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: drm_drv.c,v 1.24 2009/04/21 01:15:37 rafal Exp $);
 /*
 __FBSDID($FreeBSD: src/sys/dev/drm/drm_drv.c,v 1.6 2006/09/07 23:04:47 anholt Exp $);
 */
@@ -114,8 +114,8 @@
 	[DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)]  = { drm_agp_bind_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
 	[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)]= { drm_agp_unbind_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
 
-	[DRM_IOCTL_NR(DRM_IOCTL_SG_ALLOC)]  = { drm_sg_alloc,DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
-	[DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)]   = { drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
+	[DRM_IOCTL_NR(DRM_IOCTL_SG_ALLOC)]  = { drm_sg_alloc_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
+	[DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)]   = { drm_sg_free_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
 
 	[DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK)]   = { drm_wait_vblank, 0 },
 };

Index: src/sys/dev/drm/drm_scatter.c
diff -u src/sys/dev/drm/drm_scatter.c:1.7 src/sys/dev/drm/drm_scatter.c:1.8
--- src/sys/dev/drm/drm_scatter.c:1.7	Mon Jul  7 00:33:23 2008
+++ src/sys/dev/drm/drm_scatter.c	Tue Apr 21 01:15:37 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_scatter.c,v 1.7 2008/07/07 00:33:23 mrg Exp $ */
+/* $NetBSD: drm_scatter.c,v 1.8 2009/04/21 01:15:37 rafal Exp $ */
 
 /* drm_scatter.h -- IOCTLs to manage scatter/gather memory -*- linux-c -*-
  * Created: Mon Dec 18 23:20:54 2000 by gar...@valinux.com */
@@ -32,73 +32,107 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: drm_scatter.c,v 1.7 2008/07/07 00:33:23 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: drm_scatter.c,v 1.8 2009/04/21 01:15:37 

CVS commit: src/external/mit/xorg/server/drivers/xf86-video-r128

2009-04-20 Thread Rafal Boni
Module Name:src
Committed By:   rafal
Date:   Tue Apr 21 02:45:25 UTC 2009

Modified Files:
src/external/mit/xorg/server/drivers/xf86-video-r128: Makefile

Log Message:
Fix part of xsrc/40322: r128 driver does not restore VGA state on exit from X.

radeon driver still needs looking at, it restores the console mode OK, but
the font is a very dark gray making it appear as if the screen is blank as
well.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile:1.1 src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile:1.2
--- src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile:1.1	Mon Oct 13 11:12:33 2008
+++ src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile	Tue Apr 21 02:45:25 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2008/10/13 11:12:33 rtr Exp $
+#	$NetBSD: Makefile,v 1.2 2009/04/21 02:45:25 rafal Exp $
 
 DRIVER=		xf86-video-r128
 DRIVER_NAME=	r128_drv
@@ -8,4 +8,9 @@
 
 MAN=	r128.4
 
+# Enable VGA support (esp. hw state save/restore) on i386 / amd64 platforms
+.if ${MACHINE} == amd64 || ${MACHINE} == i386
+CPPFLAGS+=	-DWITH_VGAHW
+.endif
+
 .include ../Makefile.xf86-driver