quick_dump: Fix the danvet fallout.
PATCH 1/1 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.
--- tools/quick_dump/Makefile.am | 2 ++ tools/quick_dump/chipset.i | 5 +++-- tools/quick_dump/chipset_macro_wrap.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-)
tools/quick_dump/Makefile.am +2 -0
@@ -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 \
tools/quick_dump/chipset.i +3 -2
@@ -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);
tools/quick_dump/chipset_macro_wrap.c +14 -0
@@ -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 ; +} +
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 4 lines · Ben Widawsky
quick_dumpbuilt 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 onigt_auxmeans we have to pull in libdrm, which I do not want to do.
Why? libdrm is kinda something we need anyway ...
-Daniel
Quoted 85 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Ben Widawsky <[email protected]>--- tools/quick_dump/Makefile.am | 2 ++ tools/quick_dump/chipset.i | 5 +++-- tools/quick_dump/chipset_macro_wrap.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-)tools/quick_dump/Makefile.am +2
-0@@ -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 \tools/quick_dump/chipset.i +3
-2@@ -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);tools/quick_dump/chipset_macro_wrap.c +14
-0@@ -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 ; +} +Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Ben Widawsky
quick_dumpbuilt 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 onigt_auxmeans we have to pull in libdrm, which I do not want to do.Why? libdrm is kinda something we need anyway ...
-Daniel
The goal is to keep the dumper's dependencies and functionality to a bare minimum. We absolutely should not need libdrm for register dumps. If you want to do fancy stuff post process that requires libdrm, that's another thing.
Quoted 91 lines
Quoted 86 lines
Cc Ville Syrjälä <[email protected]>Signed-off-by Ben Widawsky <[email protected]>--- tools/quick_dump/Makefile.am | 2 ++ tools/quick_dump/chipset.i | 5 +++-- tools/quick_dump/chipset_macro_wrap.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-)tools/quick_dump/Makefile.am +2
-0@@ -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 \tools/quick_dump/chipset.i +3
-2@@ -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);tools/quick_dump/chipset_macro_wrap.c +14
-0@@ -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 ; +} +Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx