summaryrefslogtreecommitdiff
path: root/tools/intel_gpu_top.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/intel_gpu_top.c')
-rw-r--r--tools/intel_gpu_top.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 4f327c6d..78488764 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -46,6 +46,7 @@
#include "instdone.h"
#include "intel_reg.h"
#include "intel_chipset.h"
+#include "drmtest.h"
#define FORCEWAKE 0xA18C
#define FORCEWAKE_ACK 0x130090
@@ -410,6 +411,7 @@ usage(const char *appname)
int main(int argc, char **argv)
{
uint32_t devid;
+ int drm_fd;
struct pci_device *pci_dev;
struct ring render_ring = {
.name = "render",
@@ -510,8 +512,11 @@ int main(int argc, char **argv)
top_bits_sorted[i] = &top_bits[i];
}
+ /* Just to make sure we open the right debugfs files */
+ drm_fd = drm_open_driver_master(DRIVER_INTEL);
+
/* Grab access to the registers */
- intel_register_access_init(pci_dev, 0);
+ intel_register_access_init(pci_dev, 0, drm_fd);
ring_init(&render_ring);
if (IS_GEN4(devid) || IS_GEN5(devid))
@@ -714,5 +719,6 @@ int main(int argc, char **argv)
fclose(output);
intel_register_access_fini();
+ close(drm_fd);
return 0;
}