summaryrefslogtreecommitdiff
path: root/tools/intel_forcewaked.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_forcewaked.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_forcewaked.c')
-rw-r--r--tools/intel_forcewaked.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/intel_forcewaked.c b/tools/intel_forcewaked.c
index aa8e3f8b..02fbf888 100644
--- a/tools/intel_forcewaked.c
+++ b/tools/intel_forcewaked.c
@@ -64,7 +64,6 @@ is_alive(void) {
int main(int argc, char *argv[])
{
- int drm_fd;
int ret;
if (argc > 2 || (argc == 2 && !strncmp(argv[1], "-h", 2))) {
@@ -81,10 +80,7 @@ int main(int argc, char *argv[])
INFO_PRINT("started daemon");
}
- /* Just to make sure we open the right debugfs files */
- drm_fd = drm_open_driver_master(DRIVER_INTEL);
-
- ret = intel_register_access_init(intel_get_pci_device(), 1, drm_fd);
+ ret = intel_register_access_init(intel_get_pci_device(), 1, -1);
if (ret) {
INFO_PRINT("Couldn't init register access\n");
exit(1);
@@ -95,14 +91,13 @@ int main(int argc, char *argv[])
if (!is_alive()) {
INFO_PRINT("gpu reset? restarting daemon\n");
intel_register_access_fini();
- ret = intel_register_access_init(intel_get_pci_device(), 1, drm_fd);
+ ret = intel_register_access_init(intel_get_pci_device(), 1, -1);
if (ret)
INFO_PRINT("Reg access init fail\n");
}
sleep(1);
}
intel_register_access_fini();
- close(drm_fd);
INFO_PRINT("Forcewake unlock\n");
if (daemonized) {