intel_reg: Intel graphics register multitool
cover intel_reg: Intel graphics register multitool
Hi all, this is v1 after the RFC [1], with polish applied and too many small changes to list. Go ahead and play with it!
The 2nd patch has a man page written in RST, with conversion done using rst2man. It lacks proper configure checks for rst2man to push, and I'm not sure if I'm up for the task. Included for reference anyway; the tool has some help incorporated anyway.
I was considering Daniel's suggestion to replace the old tools immediately, but perhaps one IGT release with both the old and new tools coexisting, old tools deprecated, would be a better idea?
BR,
Jani.
[1] http://mid.gmane.org/[email protected]
Jani Nikula (2):
intel_reg: introduce one intel_reg tool to rule them all
man: add man page for intel_reg in rst format
man/Makefile.am | 12 +- man/intel_reg.rst | 229 ++++ tools/Makefile.sources | 6 + tools/intel_reg.c | 899 +++++++++++++++ tools/intel_reg_decode.c | 2713 ++++++++++++++++++++++++++++++++++++++++++++++ tools/intel_reg_spec.c | 345 ++++++ tools/intel_reg_spec.h | 77 ++ 7 files changed, 4280 insertions(+), 1 deletion(-) create mode 100644 man/intel_reg.rst create mode 100644 tools/intel_reg.c create mode 100644 tools/intel_reg_decode.c create mode 100644 tools/intel_reg_spec.c create mode 100644 tools/intel_reg_spec.h
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/2 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.
--- tools/Makefile.sources | 6 + tools/intel_reg.c | 899 +++++++++++++++ tools/intel_reg_decode.c | 2713 ++++++++++++++++++++++++++++++++++++++++++++++ tools/intel_reg_spec.c | 345 ++++++ tools/intel_reg_spec.h | 77 ++ 5 files changed, 4040 insertions(+) create mode 100644 tools/intel_reg.c create mode 100644 tools/intel_reg_decode.c create mode 100644 tools/intel_reg_spec.c create mode 100644 tools/intel_reg_spec.h
tools/Makefile.sources +6 -0
@@ -5,6 +5,7 @@ noinst_PROGRAMS = \ bin_PROGRAMS = \ intel_audio_dump \ + intel_reg \ intel_backlight \ intel_bios_dumper \ intel_bios_reader \
@@ -40,6 +41,11 @@ dist_bin_SCRIPTS = intel_gpu_abrt intel_dump_decode_SOURCES = \ intel_dump_decode.c +intel_reg_SOURCES = \ + intel_reg.c \ + intel_reg_decode.c \ + intel_reg_spec.c + intel_error_decode_SOURCES = \ intel_error_decode.c
tools/intel_reg.c new file +899 -0
899 lines not on this page · raw message
tools/intel_reg_decode.c new file +2713 -0
2,083 lines not on this page · raw message
tools/intel_reg_spec.c new file +345 -0
345 lines not on this page · raw message
tools/intel_reg_spec.h new file +77 -0
77 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Part of the diff is not shown here. View the raw message.
PATCH 2/2 man: add man page for intel_reg in rst format
In reply to Jani NikulaProduce the man page from rst using rst2man.
FIXME: configure support for checking rst2man.
--- man/Makefile.am | 12 ++- man/intel_reg.rst | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 240 insertions(+), 1 deletion(-) create mode 100644 man/intel_reg.rst
man/Makefile.am +11 -1
@@ -19,7 +19,12 @@ appman_PRE = \ intel_upload_blit_large_map.man \ intel_upload_blit_small.man -appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) +appman_RST = \ + intel_reg.rst + +appman_DATA = \ + $(appman_PRE:man=$(APP_MAN_SUFFIX)) \ + $(appman_RST:rst=$(APP_MAN_SUFFIX)) EXTRA_DIST = $(appman_PRE) CLEANFILES = $(appman_DATA)
@@ -29,3 +34,8 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ + +# FIXME: check for rst2man in configure.ac +# FIXME: handle MAN_SUBST in rst +.rst.$(APP_MAN_SUFFIX): + $(AM_V_GEN)rst2man < $< > $@
man/intel_reg.rst new file +229 -0
229 lines not on this page · raw message
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] man: add man page for intel_reg in rst format
Quoted 3 lines · Jani Nikula
Produce the man page from rst using rst2man.
FIXME: configure support for checking rst2man.
I think this can be done with a fairly straightforward AC_CHECK_PROG and AM_CONDITIONAL in configure.ac:
AC_CHECK_PROG(RST2MAN, rst2man, yes, no) AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes])
and then surround the relevant parts in Makefile.am with: if HAVE_RST2MAN … endif.
Quoted 271 lines
Signed-off-by Jani Nikula <[email protected]>--- man/Makefile.am | 12 ++- man/intel_reg.rst | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 240 insertions(+), 1 deletion(-) create mode 100644 man/intel_reg.rstman/Makefile.am +11
-1@@ -19,7 +19,12 @@ appman_PRE = \ intel_upload_blit_large_map.man \ intel_upload_blit_small.man -appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX)) +appman_RST = \ + intel_reg.rst + +appman_DATA = \ + $(appman_PRE:man=$(APP_MAN_SUFFIX)) \ + $(appman_RST:rst=$(APP_MAN_SUFFIX)) EXTRA_DIST = $(appman_PRE) CLEANFILES = $(appman_DATA)@@ -29,3 +34,8 @@ SUFFIXES = .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ + +# FIXME: check for rst2man in configure.ac +# FIXME: handle MAN_SUBST in rst +.rst.$(APP_MAN_SUFFIX): + $(AM_V_GEN)rst2man < $< > $@man/intel_reg.rst new file +229
-1@@ -0,0 +1,229 @@ +========= +intel_reg +========= + +--------------------------------- +Intel graphics register multitool +--------------------------------- + +:Author: Jani Nikula <[email protected]> +:Date: 2015-04-14 +:Version: intel-gpu-tools +:Copyright: 2015 Intel Corporation +:Manual section: 1 +:Manual group: General Commands Manual + +SYNOPSIS +======== + +**intel_reg** [*option* ...] *command* + +DESCRIPTION +=========== + +Intel graphics register multitool. Read, write, dump, and decode Intel graphics +MMIO and sideband registers, and more. + +OPTIONS +======= + +Some options are global, and some specific to commands. + +--verbose +--------- + +Increase verbosity. + +--quiet +------- + +Decrease verbosity. + +--count=N +--------- + +Read N registers. + +--binary +-------- + +Output binary values. + +--all +----- + +Decode registers for all known platforms. + +--mmio=FILE +----------- + +Use MMIO bar from FILE. + +--devid=DEVID +------------- + +Pretend to be PCI ID DEVID. Useful with MMIO bar snapshots from other machines. + +--spec=PATH +----------- + +Read register spec from directory or file specified by PATH; see REGISTER SPEC +DEFINITIONS below for details. + +--help +------ + +Show brief help. + +COMMANDS +======== + +See REGISTER REFERENCES below on how to describe registers for the commands. + +read [--count=N] REGISTER [...] +------------------------------- + +Dump each specified REGISTER, or N registers starting from each REGISTER. + +write REGISTER VALUE [REGISTER VALUE ...] +----------------------------------------- + +Write each VALUE to corresponding REGISTER. + +dump [--mmio=FILE --devid=DEVID] +-------------------------------- + +Dump all registers specified in the register spec. + +decode REGISTER VALUE +--------------------- + +Decode REGISTER VALUE. + +snapshot +-------- + +Output the MMIO bar to stdout. The output can be used for a later invocation of +dump or read with the --mmio=FILE and --devid=DEVID parameters. + +list +---- + +List the known registers. + +help +---- + +Display brief help. + + +REGISTER REFERENCES +=================== + +Registers are defined as [(PORTNAME|PORTNUM|MMIO-OFFSET):](REGNAME|REGADDR). + +PORTNAME +-------- + +The register access method, most often MMIO, which is the default. The methods +supported on all platforms are "mmio", "portio-vga", and "mmio-vga". + +On BYT and CHV, the sideband ports "bunit", "punit", "nc", "dpio", "gpio-nc", +"cck", "ccu", "dpio2", and "flisdsi" are also supported. + +PORTNUM +------- + +Port number for the sideband ports supported on BYT and CHV. Only numbers mapped +to the supported ports are allowed, arbitrary numbers are not accepted. + +Numbers above 0xff are automatically interpreted as MMIO offsets, not port +numbers. + +MMIO-OFFSET +----------- + +Use MMIO, and add this offset to the register address. + +Numbers equal to or below 0xff are automatically interpreted as port numbers, +not MMIO offsets. + +REGNAME +------- + +Name of the register as defined in the register spec. + +If MMIO offset is not specified, it is picked up from the register +spec. However, ports are not; the port is a namespace for the register names. + +REGADDR +------- + +Register address. The corresponding register name need not be specified in the +register spec. + +ENVIRONMENT +=========== + +INTEL_REG_SPEC +-------------- + +Path to a directory or a file containing register spec definitions. + +REGISTER SPEC DEFINITIONS +========================= + +A register spec associates register names with addresses. The spec is searched +for in this order: + +#. Directory or file specified by the --spec option. + +#. Directory or file specified by the INTEL_REG_SPEC environment variable. + +#. Builtin register spec. Also used as fallback with a warning if the above are + used but fail. + +If a directory is specified using --spec option or INTEL_REG_SPEC environment +variable, the directory is scanned for a spec file in this order: + +#. File named after the PCI device id. For example, "0412". + +#. File named after the code name in lowercase, without punctuation. For + example, "valleyview". + +#. File named after generation. For example, "gen7" (note that this matches + valleyview, ivybridge and haswell!). + +Register Spec File Format +------------------------- + +The register spec format is compatible with the quick_dump.py format, briefly +described below: + +* Empty lines and lines beginning with "#", ";", or "//" are ignored. + +* Lines *not* beginning with "(" are interpreted as file names, absolute or + relative, to be included. + +* Lines beginning with "(" are interpreted as register definitions. + +Registers are defined as tuples ('REGNAME', 'REGADDR', +'PORTNAME|PORTNUM|MMIO-OFFSET'), as in REGISTER REFERENCES above. The port +description may also be an empty string to denote MMIO. + +Examples: + +* # this is a comment, below is an include + +* vlv_pipe_a.txt + +* ('GEN6_PMINTRMSK', '0x0000a168', '') + +* ('MIPIA_PORT_CTRL', '0x61190', '0x180000') + +* ('PLL1_DW0', '0x8000', 'DPIO') + +BUGS +==== + +Reading some registers may hang the GPU or the machine. --
Quoted 2 lines
2.1.4
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 2 lines · Jani Nikula
Hi all, this is v1 after the RFC [1], with polish applied and too many small changes to list. Go ahead and play with it!
Thomas, sorry for missing i-g-t in the subject; apparently git send-email won't add it regardless of the --subject-prefix if the patches were already produced with git format-patch.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx