quick_dump: Fix the danvet fallout.

quick_dump built fine, but it could actually run, since a lot of the
linking happens at run time. There is one hack where we redefine the
environment stuff, since depending on igt_aux means we have to pull in
libdrm, which I do not want to do.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
Ben Widawsky 2014-03-25 11:35:23 -07:00
parent db25973c86
commit 785a0cd4ba
3 changed files with 19 additions and 2 deletions

View File

@ -8,6 +8,8 @@ bin_SCRIPTS = chipset.py
lib_LTLIBRARIES = I915ChipsetPython.la
I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) $(PCIACCESS_LIBS)
I915ChipsetPython_la_SOURCES = chipset_wrap_python.c chipset_macro_wrap.c \
$(top_srcdir)/lib/igt_core.c \
$(top_srcdir)/lib/igt_debugfs.c \
$(top_srcdir)/lib/intel_os.c \
$(top_srcdir)/lib/intel_chipset.c \
$(top_srcdir)/lib/intel_reg_map.c \

View File

@ -4,6 +4,7 @@
#include <pciaccess.h>
#include <stdint.h>
#include "intel_chipset.h"
#include "intel_io.h"
extern int is_sandybridge(unsigned short pciid);
extern int is_ivybridge(unsigned short pciid);
extern int is_valleyview(unsigned short pciid);
@ -12,7 +13,7 @@ extern int is_broadwell(unsigned short pciid);
extern struct pci_device *intel_get_pci_device();
extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
extern uint32_t intel_register_read(uint32_t reg);
extern uint32_t intel_register_write(uint32_t reg, uint32_t val);
extern void intel_register_write(uint32_t reg, uint32_t val);
extern void intel_register_access_fini();
extern int intel_register_access_needs_fakewake();
extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
@ -27,7 +28,7 @@ extern int is_broadwell(unsigned short pciid);
extern struct pci_device *intel_get_pci_device();
extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
extern uint32_t intel_register_read(uint32_t reg);
extern uint32_t intel_register_write(uint32_t reg, uint32_t val);
extern void intel_register_write(uint32_t reg, uint32_t val);
extern void intel_register_access_fini();
extern int intel_register_access_needs_fakewake();
extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);

View File

@ -1,3 +1,5 @@
#include <stdbool.h>
#include <stdlib.h>
#include <pciaccess.h>
#include "intel_chipset.h"
@ -31,3 +33,15 @@ unsigned short pcidev_to_devid(struct pci_device *pdev)
{
return pdev->device_id;
}
bool igt_check_boolean_env_var(const char *env_var, bool default_value)
{
char *val;
val = getenv(env_var);
if (!val)
return default_value;
return atoi(val) != 0;
}