From e408d569973b610ba4aafdba016c48b25e563468 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Wed, 27 Mar 2019 20:52:52 +0200 Subject: Revert "lib/igt_device: Move intel_get_pci_device under igt_device" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One significant usecase for intel_reg/etc. is to be able to examine the hardware state *before* loading the driver. If the tool forces the driver to load we've totally lost that capability. This reverts commit 8ae86621d6fff60b6e20c6b0f9b336785c935b0f. Cc: Michał Winiarski Cc: Chris Wilson Signed-off-by: Ville Syrjälä Acked-by: Jani Nikula Acked-by: Michał Winiarski --- tools/intel_backlight.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'tools/intel_backlight.c') diff --git a/tools/intel_backlight.c b/tools/intel_backlight.c index fc45d985..067fd418 100644 --- a/tools/intel_backlight.c +++ b/tools/intel_backlight.c @@ -30,9 +30,8 @@ #include #include -#include "drmtest.h" -#include "igt_device.h" #include "intel_io.h" +#include "intel_chipset.h" #include "intel_reg.h" /* XXX PCH only today */ @@ -40,11 +39,8 @@ int main(int argc, char** argv) { uint32_t current, max; - int fd; - fd = drm_open_driver(DRIVER_INTEL); - intel_mmio_use_pci_bar(igt_device_get_pci_device(fd)); - close(fd); + intel_mmio_use_pci_bar(intel_get_pci_device()); current = INREG(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; max = INREG(BLC_PWM_PCH_CTL2) >> 16; -- cgit v1.2.3