613 Commits

Author SHA1 Message Date
Jani Nikula
a734ac2058 rename global mmio variable to igt_global_mmio
Global variable names should reflect the fact that they are indeed
global, and at the very least they should not be as short as just
"mmio". Rename mmio to igt_global_mmio.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:13:43 +03:00
Jani Nikula
0bbbc6360f intel_vga_{read,write}: use INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
33c2e8b083 intel_display_poller: use INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
fb1515c170 intel_watermark: switch to INREG
Use INREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
12d785bcd4 intel_reg_{read,write}: switch to INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
87eb37c86b intel_reg_checker: switch to INREG
Use INREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
e9f4c5f9b9 intel_backlight: switch to INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Jani Nikula
510ac32db1 intel_reg: switch to INREG and OUTREG
Use INREG and OUTREG instead of using mmio directly.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:10:12 +03:00
Thomas Wood
40b45bace3 tools: add missing header to distributed sources
Make sure all the sources for intel_reg are included in the
distribution.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 17:34:41 +01:00
Thomas Wood
bad8834ee7 tools: update .gitignore
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-27 15:32:41 +01:00
Jani Nikula
dfda0b6aec intel_reg: introduce one intel_reg tool to rule them all
Three Tools for the Elven-kings under the sky,
	Seven for the Dwarf-lords in their halls of stone,
	Nine for Mortal Men doomed to die,
	One for the Dark Lord on his dark throne
	In the Land of Mordor where the Shadows lie.
	One Tool to rule them all, One Tool to find them,
	One Tool to bring them all and in the darkness bind them
	In the Land of Mordor where the Shadows lie.

		J.R.R. Tolkien's epigraph to The Lord of The Tools
		 | sed 's/Ring/Tool/g'

Introduce intel_reg as the one Intel graphics register multitool to
replace intel_reg_read, intel_reg_write, intel_iosf_sb_read,
intel_iosf_sb_write, intel_vga_read, intel_vga_write, intel_reg_dumper,
intel_reg_snapshot, and quick_dump.py.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-04-23 01:09:59 +03:00
Tim Gore
20ad3e55fb tools/quick_dump/makefile.am: add -lrt to get clock_gettime
Attempting to build IGT on linux without libunwind fails
due to tools/quick_dump not linking the rt library,
causing an undefined symbol error for clock_gettime.
Adding -lrt to the list of libraries in Makefile.am fixes
this.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-22 18:00:42 +01:00
Ville Syrjälä
4271b15f3c quick_dump: Fix undefined symbols from libunwind
../../lib/.libs/libintel_tools.a(igt_core.o): In function `print_backtrace':
intel-gpu-tools/lib/igt_core.c:981: undefined reference to `_Ux86_64_getcontext'
intel-gpu-tools/lib/igt_core.c:982: undefined reference to `_ULx86_64_init_local'
intel-gpu-tools/lib/igt_core.c:983: undefined reference to `_ULx86_64_step'
intel-gpu-tools/lib/igt_core.c:987: undefined reference to `_ULx86_64_get_proc_name'

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-04-16 16:38:03 +03:00
Ville Syrjälä
3dff4af5e0 quick_dump: Don't allow undefined symbols in _chipset.so
Every time _chipset.so has undefined symbols we fail to notice it
at build time and then get to wonder why quick_dump fails to actually
work. Pass -Wl,--no-undefined to the linker to get a build time error
instead of the current runtime error.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-04-16 16:38:03 +03:00
Imre Deak
074d8b440e tools/intel_reg_dumper: fix PIPECONF decode
- decode the register for BXT too
- decode interlace on VLV/CHV too
- don't decode rotation and bpc on platforms where these fields are not defined

Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-04-08 15:29:44 +03:00
Imre Deak
07a58707c3 tools/intel_reg_dumper: fix DSPCNTR decode for BXT
Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-04-08 14:52:37 +03:00
Imre Deak
7027227ca2 tools/intel_bios_read: fix SSC freq for BXT
On BXT the SSC reference frequency is fixed 100MHz.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-04-08 14:52:37 +03:00
Imre Deak
1dc4884875 tools/intel_bios_reader: fix SSC freq for VLV/CHV
VLV/CHV has a fixed 100MHz SSC reference frequency.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-04-08 14:52:36 +03:00
Thomas Wood
277ca2b992 lib: print a stack trace when a test assertion fails
Add an optional dependency on libunwind to print stack traces when a
test assertion fails.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26 15:50:05 +00:00
Mika Kuoppala
559987fc01 tools/intel_error_decode: Add gen8+ fault data encodings
These two registers contains the 48bit fault address.

Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-03-26 10:00:34 +02:00
Mika Kuoppala
f96bfb8e8c tools/intel_error_decode: Add decodings for FAULT_REG
Add decodings for FAULT_REG

v2: fix fault encodings and ignore addr type for gen8+ (Michel)
    fix engine mask

Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-03-26 10:00:18 +02:00
Mika Kuoppala
0a2ef9c349 tools/intel_error_decode: Add ERROR decodings for gen8
Add ERROR decodings for gen8

Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-03-26 10:00:06 +02:00
Ville Syrjälä
1cfcca66ec tools: Update .gitignore
Ignore intel_watermark and unignore the, now extinct, intel_dpio_{read,write}.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-25 20:32:57 +02:00
Ville Syrjälä
4d2577e0dd tools/intel_watermark: Tool to decode watermark registers
The watermark registers on the gmch platform are a bit of a mess. Add
a tool to make some sense of them. While at it decode the ilk-bdw wm
registers as well. SKL+ is left out for now since it's a very different
beast.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
978881801e tools/intel_iosf_sb_read: Support different register strides
Some IOSF SB units ogranize their registers in a pecualiar way. Even
though the registers are 32 bits wide, the register offsets only
increment by one when going from one register to the next. Correctly
deal with this when dumping several consecutive registers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
bd692becf7 tools/intel_iosf_sb_read: Add -c command line option like intel_reg_read
Add a command line option '-c <count>' that can be used to read set of
consecutive registers without having to specify the offset for each of
them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
dcb3edf2a9 tools/intel_iosf_sb_*: Support reading/writing multiple registers at once
Allow the user to specify a list of registers to read, and register/value
pairs to write.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
0461e8cf43 tools/intel_iosf_sb_*: Use getopt() to parse the options
I want to add some command line options so switch to getopt() to make
that easier.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
38e3c58cba tools/intel_iosf_sb_*: Replace if ladder with an array and bsearch()
Replace the silly strcasecmp() if ladder with and array that maps the
unit names to port numbers. And keep the thing sorted so we can do
the lookup with bsearch() for extra speed :)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
29ebc68313 tools: Remove intel_dpio_{read,write} tools
intel_dpio_{read,write} as redundant as intel_iosf_sb_{read,write}
handle the same task.

The difference between the tools was the opcode used to read/write the
registers, but with DPIO both opcodes work just fine, so there's no need
for both sets of tools.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Ville Syrjälä
0129b02c7b toos/intel_iosf_sb_*: Fix DPIO IOSF SB port number
The correct port is 0x12, not 0x13 which is actually GPIO_NC.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-03-24 15:30:20 +02:00
Damien Lespiau
06a9c35664 quick_dump/skl: Add power well registers
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-24 11:58:57 +00:00
Thomas Wood
595575b9cb Remove old entries from .gitignore files
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-12 16:32:17 +00:00
Mika Kuoppala
043f586958 tools/intel_gtt: Add support for gen8
Add 64bit ptes and 8MB mmiobar offset for gen8

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Acked-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-03-04 12:31:26 +02:00
Lu, Han
e8e28931b1 tools/intel_audio_dump: add support for Skylake
This patch adds support for dumping audio registers of Skylake.

Signed-off-by: Lu, Han <han.lu@intel.com>
2015-02-16 12:35:40 +08:00
Damien Lespiau
cd6644230b quick_dump: Add interrupt and PPAT registers to the SKL dump
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-02-13 17:00:15 +00:00
Libin Yang
ebd8b32bc6 tools/intel_audio_dump: add details dump for Cherryview
This patch adds the details dump for audio registers of Cherryview.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2015-01-26 16:06:46 +08:00
Tim Gore
20d6e0f41b tools/intel_gpu_frequency: remove use of getsubopt
getsubopt is not available in android. The "get" option
doesn't really need sub-options, just display all the
current frequency settings (as per discussion with
Ben Widawsky)

Ben v2: Remove the -geff example in the header
Fixed another typo for the --set while there (found by Dave Gordon)

Signed-off-by: Tim Gore <tim.gore@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-01-16 10:23:34 -08:00
Thomas Wood
6e2fd6f64d tools: add intel_gpu_frequency to .gitignore
intel_gpu_frequency was added in commit 5fb26d1 (intel_gpu_frequency: A
tool to manipulate Intel GPU frequency), but wasn't added to .gitignore.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 11:30:39 +00:00
Thomas Wood
c1d8293cc7 intel_gpu_frequency: fix array bounds warning
Add a parameter for the size of the act_upon array in the parse function
since its size cannot be calculated with ARRAY_SIZE from just the
pointer.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-01-15 11:30:39 +00:00
Ben Widawsky
5fb26d1469 intel_gpu_frequency: A tool to manipulate Intel GPU frequency
WARNING: very minimally tested

In general you should not need this tool. Its primary purpose is for
benchmarking, and for debugging performance issues.

For many kernel releases now sysfs has supported reading and writing the GPU
frequency. Therefore, this tool provides no new functionality. What it does
provide is an easy to package (for distros) tool that handles the most common
scenarios.

v2:
Get rid of -f from the usage message (Jordan)
Add space before [-s (Jordan)
Add a -c/--custom example (Jordan)
Add a setting for resetting to hardware default (Ken)
Replicate examples in commit message in the source code. (me)

v3:
Its not It's (me)
Add --help/-h to usage
Add Version + man page
Rename tool to intel_gpu_frequency, from intel_frequency
Remove "sudo" from the examples

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>

Here are some sample usages:
$ intel_gpu_frequency --get=cur,min,max,eff
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency -g
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency -geff
RP1: 200 MHz

$ intel_gpu_frequency --set min=300
$ intel_gpu_frequency --get min
cur: 300 MHz
min: 300 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency --custom max=900
$ intel_gpu_frequency --get max
cur: 300 MHz
min: 300 MHz
RP1: 200 MHz
max: 900 MHz

$ intel_gpu_frequency --max
$ intel_gpu_frequency -g
cur: 1200 MHz
min: 1200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency -e
$ intel_gpu_frequency -g
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 200 MHz

$ intel_gpu_frequency --max
$ intel_gpu_frequency -g
cur: 1200 MHz
min: 1200 MHz
RP1: 200 MHz
max: 1200 MHz

$ intel_gpu_frequency --min
$ intel_gpu_frequency -g
cur: 200 MHz
min: 200 MHz
RP1: 200 MHz
max: 200 MHz
2015-01-12 15:58:21 -08:00
Yang, Libin
9917744176 tools/intel_audio_dump: add support for Cherryview
This patch adds support for dumping audio registers of Cherryview.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2015-01-12 14:44:12 +08:00
Ben Widawsky
67eb20c8a3 tools/Makefile: Alphabetize the list
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-01-11 19:32:27 -08:00
Vincent Cheng
cb512b6470 tools/intel_gpu_abrt: Fix bashism
intel-gpu-tools ships a #!/bin/sh script that has bash-specific syntax
(which breaks on distros such as Debian and Ubuntu where /bin/sh is a
symlink to something other than bash).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87888
2014-12-31 10:42:38 +00:00
Tim Gore
a11117e42f Android.mk: replace std=c99 with std=gnu99
The android makefiles were passing the -std=c99 flag to the
compiler which disables the typeof keyword. This causes a
build fail for a recent addition to igt_aux.h.
Change this to -std=gnu99, which is the flag used in the
linux build

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-12 12:18:22 +00:00
Thomas Wood
bdbf78db01 tools: add missing copyright headers
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-10 15:55:58 +00:00
Jani Nikula
c252c77dbf tools: terminate getopt_long long option arrays properly
The last element of the long options array has to be filled with zeros.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2014-12-09 15:49:10 +02:00
Chris Wilson
b64704673e intel_error_decode: Decode the ERROR register on Sandybridge and Ivybridge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-05 11:28:04 +00:00
Thomas Wood
86bb6072a6 tools/quick_dump: don't include generated sources in the distribution
This also ensures that "make dist" works even if SWIG is not available.

BUILT_SOURCES is not required because the files are already explicit
dependencies of other rules.

v2: make sure SWIG is not invoked with the incorrect output filename

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06 10:21:50 +00:00
Daniel Vetter
9d6a2cacf6 Move watermark code from tests to tools
They're now igt tests, and so if you blindly run lib/igt.cocci with
spatch on tests/*c they get mangled. Move them away, but still keep
them as noinst targets.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-10-29 13:29:32 +01:00