#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include "../../../xf86drm.h"
-#include "../xf86drmRandom.c"
-#include "../xf86drmHash.c"
-#include "../xf86drm.c"
+#include "xf86drm.h"
+#include "xf86drmRandom.c"
+#include "xf86drmHash.c"
+#include "xf86drm.c"
#define DRM_VERSION 0x00000001
#define DRM_MEMORY 0x00000002
int i;
const char *typename;
char flagname[33];
- drmHandle offset;
+ drm_handle_t offset;
drmSize size;
drmMapType type;
drmMapFlags flags;
- drmHandle handle;
+ drm_handle_t handle;
int mtrr;
printf(" VM map information:\n");
flagname[6] = '\0';
printf(" %4d 0x%08lx 0x%08lx %3.3s %6.6s 0x%08lx ",
- i, offset, (unsigned long)size, typename, flagname, handle);
+ i, (unsigned long)offset, (unsigned long)size,
+ typename, flagname, (unsigned long)handle);
if (mtrr < 0) printf("none\n");
else printf("%4d\n", mtrr);
}
for (i = 0; !drmGetClient(fd, i, &auth, &pid, &uid, &magic, &iocs); i++) {
sprintf(buf, "/proc/%d/cmdline", pid);
- memset(cmd, sizeof(cmd), 0);
+ memset(cmd, 0, sizeof(cmd));
if ((procfd = open(buf, O_RDONLY, 0)) >= 0) {
read(procfd, cmd, sizeof(cmd)-1);
close(procfd);
case 'i': interval = strtol(optarg, NULL, 0); break;
case 'M': minor = strtol(optarg, NULL, 0); break;
default:
- fprintf( stderr, "Usage: dristat [options]\n" );
+ fprintf( stderr, "Usage: dristat [options]\n\n" );
+ fprintf( stderr, "Displays DRM information. Use with no arguments to display available cards.\n\n" );
+ fprintf( stderr, " -a Show all available information\n" );
+ fprintf( stderr, " -b Show DRM bus ID's\n" );
+ fprintf( stderr, " -c Display information about DRM clients\n" );
+ fprintf( stderr, " -i [interval] Continuously display statistics every [interval] seconds\n" );
+ fprintf( stderr, " -v Display DRM module and card version information\n" );
+ fprintf( stderr, " -m Display memory use information\n" );
+ fprintf( stderr, " -s Display DRM statistics\n" );
+ fprintf( stderr, " -M [minor] Select card by minor number\n" );
return 1;
}
for (i = 0; i < 16; i++) if (!minor || i == minor) {
sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, i);
- fd = drmOpenMinor(i, 1);
+ fd = drmOpenMinor(i, 1, DRM_NODE_RENDER);
if (fd >= 0) {
printf("%s\n", buf);
if (mask & DRM_BUSID) getbusid(fd);