/* drmstat.c -- DRM device status and testing program
* Created: Tue Jan 5 08:19:24 1999 by faith@precisioninsight.com
- * Revised: Sun Feb 13 23:35:00 2000 by kevin@precisioninsight.com
*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmstat.c,v 1.28 1999/08/04 18:12:11 faith Exp $
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmstat.c,v 1.5 2000/02/14 06:27:27 martin Exp $
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
#include "xf86drm.h"
+/* Support gcc's __FUNCTION__ for people using other compilers */
+#if !defined(__GNUC__) && !defined(__FUNCTION__)
+# define __FUNCTION__ __func__ /* C99 */
+#endif
+
int sigio_fd;
static double usec(struct timeval *end, struct timeval *start)
}
sigio_fd = fd;
- drmInstallSIGIOHandler(fd, handler);
+ /* drmInstallSIGIOHandler(fd, handler); */
for (;;) sleep(60);
}
int c;
int r = 0;
int fd = -1;
- drmHandle handle;
+ drm_handle_t handle;
void *address;
char *pt;
unsigned long count;
unsigned long offset;
unsigned long size;
- drmContext context;
+ drm_context_t context;
int loops;
char buf[1024];
int i;
case 'b':
count = strtoul(optarg, &pt, 0);
size = strtoul(pt+1, NULL, 0);
- if ((r = drmAddBufs(fd, count, size, 0)) < 0) {
+ if ((r = drmAddBufs(fd, count, size, 0, 65536)) < 0) {
drmError(r, argv[0]);
return 1;
}
printf("===== /proc/%d/maps =====\n", getpid());
sprintf(buf, "cat /proc/%d/maps", getpid());
system(buf);
- printf("===== /proc/grphics/0/mem =====\n");
+ printf("===== /proc/dri/0/mem =====\n");
sprintf(buf, "cat /proc/dri/0/mem");
system(buf);
printf("===== /proc/dri/0/vma =====\n");
return r;
}
+
+void DRM_PRINTFLIKE(4, 0)
+xf86VDrvMsgVerb(int scrnIndex, int type, int verb, const char *format,
+ va_list args)
+{
+ vfprintf(stderr, format, args);
+}
+
+int xf86ConfigDRI[10];