exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input
[platform/upstream/libdrm.git] / tests / drmstat.c
index 7af8fcc..c51cbc6 100644 (file)
@@ -1,8 +1,8 @@
 /* drmstat.c -- DRM device status and testing program
  * Created: Tue Jan  5 08:19:24 1999 by faith@precisioninsight.com
- * Revised: Mon Dec  6 10:33:46 1999 by faith@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.1 1999/09/25 14:37:59 dawes 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)
@@ -86,7 +95,7 @@ void process_sigio(char *device)
     }
 
     sigio_fd = fd;
-    drmInstallSIGIOHandler(fd, handler);
+    /*  drmInstallSIGIOHandler(fd, handler); */
     for (;;) sleep(60);
 }
 
@@ -95,13 +104,13 @@ int main(int argc, char **argv)
     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;
@@ -188,7 +197,7 @@ int main(int argc, char **argv)
        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;
            }
@@ -315,7 +324,7 @@ int main(int argc, char **argv)
            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");
@@ -415,3 +424,12 @@ int main(int argc, char **argv)
 
     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];