summaryrefslogtreecommitdiff
path: root/tools/intel_panel_fitter.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2019-03-12 13:48:13 +0100
committerMichał Winiarski <michal.winiarski@intel.com>2019-03-20 10:36:36 +0100
commit8ae86621d6fff60b6e20c6b0f9b336785c935b0f (patch)
tree12d83d267f5dafb16bcef5edec173ff57cf4dfbd /tools/intel_panel_fitter.c
parent1bbe0b11a40cbb8433a3863745b7023e54c36ae3 (diff)
lib/igt_device: Move intel_get_pci_device under igt_device
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools/intel_panel_fitter.c')
-rw-r--r--tools/intel_panel_fitter.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/intel_panel_fitter.c b/tools/intel_panel_fitter.c
index 137ef61a..06f4ac59 100644
--- a/tools/intel_panel_fitter.c
+++ b/tools/intel_panel_fitter.c
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include "igt_device.h"
#include "intel_io.h"
#include "intel_chipset.h"
#include "intel_reg.h"
@@ -273,13 +274,17 @@ int main (int argc, char *argv[])
bool do_disable = false, do_dump = false, do_usage = false;
struct pci_device *pci_dev;
uint32_t devid;
+ int fd;
printf("WARNING:\n"
"This tool is a workaround for people that don't have a Kernel "
"with overscan compensation properties: it is just a temporary "
"solution that may or may not work. Use it at your own risk.\n");
- pci_dev = intel_get_pci_device();
+ fd = drm_open_driver(DRIVER_INTEL);
+ pci_dev = igt_device_get_pci_device(fd);
+ close(fd);
+
intel_register_access_init(pci_dev, 0, -1);
devid = pci_dev->device_id;
@@ -343,5 +348,6 @@ int main (int argc, char *argv[])
out:
intel_register_access_fini();
+
return ret;
}