OSDN Git Service

exynos: fimg2d: fix return codes
[android-x86/external-libdrm.git] / tests / drmstat.c
index 8c691c4..023aa06 100644 (file)
  * 
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -39,6 +43,9 @@
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
 #include "xf86drm.h"
 
 int sigio_fd;
@@ -69,23 +76,17 @@ static void getversion(int fd)
        printf( "No driver available\n" );
     }
 }
-       
-void handler(int fd, void *oldctx, void *newctx)
-{
-    printf("Got fd %d\n", fd);
-}
 
-void process_sigio(char *device)
+static void process_sigio(char *device)
 {
     int              fd;
 
     if ((fd = open(device, 0)) < 0) {
-       drmError(-errno, __FUNCTION__);
+       drmError(-errno, __func__);
        exit(1);
     }
 
     sigio_fd = fd;
-    drmInstallSIGIOHandler(fd, handler);
     for (;;) sleep(60);
 }
 
@@ -94,13 +95,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;
@@ -314,7 +315,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");
@@ -414,3 +415,5 @@ int main(int argc, char **argv)
 
     return r; 
 }
+
+int xf86ConfigDRI[10];