summaryrefslogtreecommitdiff
path: root/tools/intel_reg.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-11-20 15:58:59 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-11-21 11:57:49 +0000
commit538091ce7008b4281d912422d8bb676c541401a4 (patch)
tree406fa375e51a17d2d87500cd6c5aa8a2ee230abf /tools/intel_reg.c
parent9fb5344bab2540e3d12a7d3a94c2a3801a6fec36 (diff)
tools: Stop opening the driver just to find the debugfs
Since the tools want to work without the module loaded, remove the assumption that we want to load the driver to find debugfs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tools/intel_reg.c')
-rw-r--r--tools/intel_reg.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index d6f81840..00d2a4a1 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -58,7 +58,6 @@ struct config {
struct pci_device *pci_dev;
char *mmiofile;
uint32_t devid;
- int drm_fd;
/* read: number of registers to read */
uint32_t count;
@@ -411,7 +410,7 @@ static int intel_reg_read(struct config *config, int argc, char *argv[])
if (config->mmiofile)
intel_mmio_use_dump_file(config->mmiofile);
else
- intel_register_access_init(config->pci_dev, 0, config->drm_fd);
+ intel_register_access_init(config->pci_dev, 0, -1);
for (i = 1; i < argc; i++) {
struct reg reg;
@@ -441,7 +440,7 @@ static int intel_reg_write(struct config *config, int argc, char *argv[])
return EXIT_FAILURE;
}
- intel_register_access_init(config->pci_dev, 0, config->drm_fd);
+ intel_register_access_init(config->pci_dev, 0, -1);
for (i = 1; i < argc; i += 2) {
struct reg reg;
@@ -479,7 +478,7 @@ static int intel_reg_dump(struct config *config, int argc, char *argv[])
if (config->mmiofile)
intel_mmio_use_dump_file(config->mmiofile);
else
- intel_register_access_init(config->pci_dev, 0, config->drm_fd);
+ intel_register_access_init(config->pci_dev, 0, -1);
for (i = 0; i < config->regcount; i++) {
reg = &config->regs[i];
@@ -879,9 +878,6 @@ int main(int argc, char *argv[])
config.devid = config.pci_dev->device_id;
}
- /* Just to make sure we open the right debugfs files */
- config.drm_fd = __drm_open_driver(DRIVER_INTEL);
-
if (read_reg_spec(&config) < 0) {
return EXIT_FAILURE;
}