diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-21 17:16:03 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-21 17:36:02 +0000 |
commit | 83884e97e18739e3588c6467a210838099d42073 (patch) | |
tree | 778bab4b309c852d3649cc901952267d0cbb5992 /tools/intel_panel_fitter.c | |
parent | 25fbae15262cf570e207e62f50e7c5233e06bc67 (diff) |
Restore "lib: Open debugfs files for the given DRM device"
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring
commit 301ad44cdf1b868b1ab89096721da91fa8541fdc
Author: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Thu Mar 2 10:37:11 2017 +0100
lib: Open debugfs files for the given DRM device
with fixes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools/intel_panel_fitter.c')
-rw-r--r-- | tools/intel_panel_fitter.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/intel_panel_fitter.c b/tools/intel_panel_fitter.c index 5519361e..48b2fd89 100644 --- a/tools/intel_panel_fitter.c +++ b/tools/intel_panel_fitter.c @@ -33,6 +33,7 @@ #include "intel_io.h" #include "intel_chipset.h" #include "intel_reg.h" +#include "drmtest.h" int gen; @@ -265,7 +266,7 @@ static void print_usage(void) int main (int argc, char *argv[]) { - int opt; + int opt, drm_fd; int ret = 0; char intel_pipe = '\0'; int x = 0, y = 0; @@ -278,8 +279,11 @@ int main (int argc, char *argv[]) "with overscan compensation properties: it is just a temporary " "solution that may or may not work. Use it at your own risk.\n"); + /* Just to make sure we open the right debugfs files */ + drm_fd = drm_open_driver_master(DRIVER_INTEL); + pci_dev = intel_get_pci_device(); - intel_register_access_init(pci_dev, 0); + intel_register_access_init(pci_dev, 0, drm_fd); devid = pci_dev->device_id; if (!HAS_PCH_SPLIT(devid)) { @@ -342,5 +346,6 @@ int main (int argc, char *argv[]) out: intel_register_access_fini(); + close(drm_fd); return ret; } |