39 Commits

Author SHA1 Message Date
Thomas Wood
f0381d1abe lib: various documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Thomas Wood
d01ebbd97d docs: various documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Thomas Wood
5d80872009 docs: override section id to avoid '/' in filenames
The section id is generated from the section title and is used to create
the html output filename, which therefore causes problems if it includes
a '/' character.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Damien Lespiau
4dca31b2d6 docs: Fix a "libraray" typo
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
6ebd8c2dc3 doc: Remove i-g-t/intel prefixes and capitalize section titles
Looks better!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Daniel Vetter
aa720ffaf5 lib/mmio: One more s/OUTRET/OUTREG/
A those typos ...

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-05-06 11:38:06 +02:00
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
23b7f08920 lib: add 16 and 8 bit versions of INREG and OUTREG
Add INREG8, INREG16, OUTREG8, and OUTREG16. While at it, cleanup doc
comments of INREG and OUTREG.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05 13:08:34 +03:00
Daniel Vetter
3cd45dec2e lib/igt_gt: Document and consolidate
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.

Also push the intel_gen call into igt_hang_ring while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Thomas Wood
519f377ddd doc: various spelling and typo fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30 17:54:02 +01:00
Daniel Vetter
71ac5de5a4 lib/intel_* Use igt checks and macros
Various stuff all over. Most done with the igt.cocci spatch, but
with a few fixups by hand. And add igt_core.h includes where needed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-26 15:16:01 +02:00
Daniel Vetter
7bb40944e2 lib: Use @include tag for include files
Occasionally useful to read documentation ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23 14:45:13 +01:00
Daniel Vetter
95e89f0ede lib/intel_io: api documentation
As usual de-inline functions for gtkdoc to see them.

I've decided to exclude the register map stuff since that's not
terribly interesting.

Aside: gtkdoc falls over when the title of a section contains a slash,
hence why it reads "IO" instead of "I/O". The fun ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 22:41:28 +01:00
Daniel Vetter
2d4656fb69 lib/intel_io: rename mmio setup functions
Makes their intent a bit clearer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 22:23:04 +01:00
Daniel Vetter
c03c6ceb29 lib: rename intel_gpu_tools.h to intel_io.h
With the header cleanup we can now give this header a suitable name,
since it now really only contains register access and other I/O
functions and assorted definitions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:34:29 +01:00
Daniel Vetter
6cfcd71589 lib: remove uncessary #includes from headers
Only include what the header itself needs. The big fish here is
intel-gpu-tools.h. More will follow.

One ugly thing removed here is the duplicated GEN6_TD_CTL #define, one
of which was broken.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 20:08:13 +01:00
Daniel Vetter
ea18fc16cd lib: extract igt_open_forcewake_handle
... and I immediately regret that I've killed the return value
for igt_debugfs_init, since we have callers which need to work
without the forcewake stuff, e.g. the reg dumper needs to work
without i915 loaded.

Put this new helper to good use in the mmio code and the pm_pc8
testcase.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14 16:00:22 +01:00
Jesse Barnes
670a717b5b mmio: drop unused i915_loaded fn
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-28 13:58:23 -08:00
Jesse Barnes
5ecac45ff0 mmio: allow register init even if debugfs isn't available and i915 isn't loaded
This lets us dump regs even if modeset=0 for example.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-27 10:27:20 -08:00
Daniel Vetter
d65d19d4f4 lib/intel_mmio: Remove unused label
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Ben Widawsky
a85548910c lib/intel_mmio: Fix the fixed fix (register access)
When I moved code around here:
commit 57bc7631e161a7bdcf7f68e1a46049dcb49c2256
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu May 23 11:09:55 2013 -0700

    lib/intel_mmio: Fix the fix

I accidently dropped the intel_gen() for the PCI id.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67289
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-07-27 15:30:41 -07:00
Ben Widawsky
57bc7631e1 lib/intel_mmio: Fix the fix
commit 16e44f5499e1754dfb10fc62b22675f5aa6ac781
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Apr 3 00:22:41 2013 +0200

    lib: fixup register access on gen2/3

THis fix was incorrect for a few reasons:
1. It didn't reflect the state in mmio_data.safe
2. It skipped forcewake on gen6+ which is both incorrect and
unnecessary (for gen<6).
3. It had 2 goto done, the second of which was impossible to hit.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-05-23 11:12:32 -07:00
Ben Widawsky
8be812b86c intel_mmio: Add intel_register_access_needs_fakewake
I screwed this up in my recent patch:
commit c7b6ec50007e2e524a208572c34faf1380eeab1b
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Wed Apr 24 19:05:18 2013 -0700

    clean warnings: Silence unused (or private) functions

I've clarified the functions now, and added the proper call from the
python script.

Time to get a regression tester for our tools?

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-26 14:34:48 -07:00
Ben Widawsky
c7b6ec5000 clean warnings: Silence unused (or private) functions
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-24 19:11:03 -07:00
Ben Widawsky
f60dd51535 intel_mmio: a query for forcewake requirement
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-16 14:06:02 -07:00
Ben Widawsky
8904d29416 intel_mmio: Allow mmio without debugfs
With the introduction of the forcewake dance:

commit cac8f8b52621f246a7cff412f340a7db28cb1b99
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu Jul 28 13:40:19 2011 -0700

    forcewake: Add mmio code to do proper forcewake stuff for gen6

We lost the ability to do register access when either debugfs isn't
mounted, or when the driver isn't loaded. The latter can be beneficial
in debugging situations.

This patch will allow the driver to still do mmio (leaving forcewake
management up to the callers) provided that the i915 driver appears to
not be loaded (according to sysfs)

Requested by Jesse.

Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-04-16 14:06:02 -07:00
Daniel Vetter
16e44f5499 lib: fixup register access on gen2/3
This wreaked havoc with intel_reg_dumper since it's been broken in

commit c6fe31bc473a7ae44bc42bad7da5faca3c924821
Author: Eugeni Dodonov <eugeni.dodonov@intel.com>
Date:   Thu Jun 21 14:31:34 2012 -0300

    intel_reg_dumper: use intel_register_access_init/fini

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-04-03 00:22:41 +02:00
Daniel Vetter
50d46750d9 lib/mmio: gen2 has a bigger register window, too
It's split up into two parts, with the gtt pte range in between.
Without this I couldn't read the ADPA register ...
2012-10-12 10:45:52 +02:00
Chris Wilson
7a02aa4cbf mmio: Limit the uc- mapping to only map the registers
In the future, we may like to enable wc mapping of at least the GATT,
and so causing a conflict if we attempt to map the entire bar as uc-
here. Obviously we need a better fallback plan, but for the moment only
attempt to map the portion of the pci space that we use for register
access.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-08-27 09:34:33 +02:00
Kenneth Graunke
6cfd16648d Remove pointless Android ifdefs for sys/fcntl.h.
On my system, sys/fcntl.h contains exactly one line:

   #include <fcntl.h>

So there's really no need to #ifdef it.  Also, intel_mmio.c already
included <fcntl.h>; there's no need to include it twice.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-11 11:48:02 +01:00
Sateesh Kavuri
b39a74ba4e Added support for Android
Added the Android.mk file as per Android make system. Also had to modify
 the headers with the proper location for fcntl.h as per the Android
 bionic headers location

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-10 18:43:53 +01:00
Ben Widawsky
4c20525b7f mmio: refactor reg init/fini
Rearrange register access init and fini so that we properly accomodate
platforms without forcewake.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-01-25 21:04:16 -08:00
Daniel Vetter
137f4d467e lib: forcewake is gen6+
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-24 09:37:51 +01:00
Daniel Vetter
1be3fd7eee lib: fixup new compiler warnings
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-09 23:42:19 +01:00
Alan Coopersmith
4e3c85f153 include <fcntl.h> in lib/intel_mmio.c for open() prototype on Solaris
<fcntl.h> is the POSIX standard specified header for open(), so should
be available on all platforms.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-01-08 21:49:03 +01:00
Ben Widawsky
abd7038e5a intel-gpu-tools/range handling: register range handling
Hooks to allow safe accesses from userspace. Can revert to old behavior
by using unsafe access.
2011-07-28 13:48:51 -07:00
Ben Widawsky
cac8f8b526 forcewake: Add mmio code to do proper forcewake stuff for gen6 2011-07-28 13:48:51 -07:00
Chris Wilson
41570d9bf5 Remove confusing use of IS_9XX
... and test for what we mean instead.

Reported-by: Diego Celix <dcelix@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-14 15:57:40 +00:00
Chris Wilson
95374225e8 Enable compilation on non-Intel, non-DRM systems.
A few of the tools can be performed post-mortem from a different system,
so it is useful to be able to compile those tools on those foreign
systems. Obviously, any program to interact with the PCI device or talk
to GEM will fail on a non-Intel system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-08 12:17:31 +01:00