59 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
Dominik Zeromski
3676912970 lib/gpgpu_fill: Add SKL support
SKL changed state base address command.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Dominik Zeromski
a017c2905a lib/gpgpu_fill: Add BDW support
BDW changed structure of surface state and interface descriptors.
Commands like state base address, gpgpu walker were extended.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Dominik Zeromski
ed816d560c lib: Move gpgpu_fill code to separate file
The gpgpu fill utility functions are used in separate test so it's
logical to keep them in separate file. This is similar to what media
spin test did in the past.

Functionally only gpgpu kernel changed. Send instruction payload size
was reduced. Since offset is incremented by 0x10 bytes there is no point
in using larger writes.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com>
[Thomas: Fix typo of gpgpu_fill.h in Makefile.sources]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +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
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
Thomas Wood
b47032e191 lib: add a define for test failure exit status
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14 17:43:05 +01:00
Jeff McGee
aef4605f7c lib: Add media spin
The media spin utility is derived from media fill. The purpose
is to create a simple means to keep the render engine (media
pipeline) busy for a controlled amount of time. It does so by
emitting a batch with a single execution thread that spins in
a tight loop the requested number of times. Each spin increments
a counter whose final 32-bit value is written to the destination
buffer on completion for checking. The implementation supports
Gen8, Gen8lp, and Gen9.

v2: Apply the recommendations of igt.cocci.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Tested-by: Lei Liu <lei.a.liu@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-25 17:52:11 +00:00
Chris Wilson
d3e9316b44 lib/batch: Fix range checks for blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-18 08:37:33 +00:00
Chris Wilson
233808a58d lib/batch: Trivial compile fix for 32-bit builds
intel_batchbuffer.c: In function 'fill_object':
intel_batchbuffer.c:589:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  obj->relocs_ptr = (uint64_t)relocs;
                    ^
intel_batchbuffer.c: In function 'exec_blit':
intel_batchbuffer.c:598:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  exec.buffers_ptr = (uint64_t)objs;

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-18 08:37:33 +00:00
Thomas Wood
3b8e121552 lib: small documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-12 17:05:18 +00:00
Damien Lespiau
672e88acb7 lib: Provide a raw version of the gen9 fast copy blits
So we can use it with bare kernel types, without going through libdrm
bos.

v2: Don't forget the object handle. (Tvrtko)
    Correct surface pitch calculation. (Tvrtko)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2015-03-12 14:20:10 +00:00
Damien Lespiau
6533d113a9 lib: Split two helpers to build fast copy's dword0 and dword1
Again, these helpers will be useful for a raw version of the gen9 fast
copy.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-12 14:20:08 +00:00
Damien Lespiau
130221b3b5 lib: Don't give a struct igt_buf * to fast_copy_pitch()
So we can use this function in a "raw" (ie without igt_buf) version.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-12 14:19:57 +00:00
Damien Lespiau
cbd927cd35 lib/skl: Add gen9 specific igt_blitter_fast_copy()
v2: Adjust for BB handling changes. (Tvrtko Ursulin)
    Correct XY_FAST_COPY_DST_TILING_Yf. (Tvrtko Ursulin)

v3: New tiling modes are not defined in the kernel any more. (Tvrtko Ursulin)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2015-03-12 14:19:41 +00:00
Zhenyu Wang
10c6ad3805 lib: Add GPGPU fill
This is to add fill operation using GPGPU pipeline which is similar to
current media fill. This can be used to simply verify GPGPU pipeline
and help to enable it on newer HW, currently it works on Gen7 only and
will add support on later platform.

Now this sets very simply thread group dispatch for one thread per
thread group on SIMD16 dispatch. So the fill shader just uses thread
group ID for buffer offset.

v2: No new fill func typedef but adapt to igt_fillfunc_t.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2014-12-04 10:17:16 +08:00
Zhenyu Wang
106f0bf965 lib: rename igt_media_fillfunc_t typedef to igt_fillfunc_t
This makes fill function more general to prepare for other
fill method using GPGPU pipeline.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2014-12-04 10:17:12 +08:00
Thomas Wood
ae3a946631 lib: fix symbol names in documentation comments
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-25 11:59:37 +00:00
Xiang, Haihao
781a0485ac lib/skl: Return the render copy and media fill functions
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
[Ben: Reordered if tree]
Signed-off-by: Ben Widawsky <benjamin.widawsky@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-30 12:21:03 +01:00
Chris Wilson
107151ce9f igt/gem_ppgtt: Create secondary contexts and mm
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-09 16:28:36 +01:00
Chris Wilson
961578f471 test: Exercise full ppgtt switching between multiple fd
Load up both rings with lots of fighting between multiple contexts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-09 14:52:35 +01:00
Chris Wilson
10552b5ca6 batch: Specify number of relocations to accommodate
Since relocations are variable size, depending upon generation, it is
easier to handle the resizing of the batch request inside the
BEGIN_BATCH macro. This still leaves us with having to resize commands
in a few places - which still need adaption for gen8+.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-30 11:44:51 +01:00
Chris Wilson
982f7eb238 Prepare for 64bit relocation addresses
This reveal that quite a few locations were writing relocation offsets
but only allowing for 32 bit addresses. To reveal such places in active
tests, we also now double check that we do not use more batch space than
declared.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 20:02:10 +01:00
Chris Wilson
fbfa754e8d lib/batchbuffer: Guard intel_blt_copy with even more asserts
Assert that the source/destination bounds are within the pitch and size
of the associated bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 19:55:30 +01:00
Chris Wilson
23d961e950 lib/batchbuffer: Store the gen in a local variable
Reduce lookups and improve code clarity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 19:39:25 +01:00
Daniel Vetter
257a51ec95 lib: Use igt macros more
Stragglers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-26 21:29:18 +02:00
Sean V Kelley
17d63e4968 lib/chv: CHV media pipeline command sequence
Enable gem_media_fill test for CHV platform.  In addition to differences in
media IP blocks from Broadwell, the command sequence also differs for
programming the media pipeline, e.g., should not send a MEDIA_STATE_FLUSH
right before the MI_BATCH_BUFFER_END of batch buffers using MEDIA_OBJECT.
Uses explicit IS_BROADWELL / IS_CHERRYVIEW to distinguish in gen8 media
fill handling.

Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-06 18:04:14 +02:00
Daniel Vetter
c6c2b2bb70 lib/igt_kms/bf: doc skeleton
igt_kms docs are just skeleton and also added igt_fb to make sure the
linking works correctly.

Next up: Actually documenting igt_fb.

Also fix that depency spelling fumble I've copied around to a few too
many places.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26 18:50:28 +01:00
Daniel Vetter
816c947236 lib/intel_batchbuffer: document header dependencies
At least with the core library headers the situation is now fairly
sane. There's still fun stuff going on around *_reg.h and most of the
source files just have a cargo-culted list of headers ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23 15:14:16 +01: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
cd6d5a61b3 lib: add #include "foo.h" lines like in manpages
Should help in alleviating the header mess we have atm.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 19:39:47 +01:00
Daniel Vetter
7754c4dd76 lib/intel_batchbuffer: api documentation for render copy/media fill
Also fix a fumble in the documentation for intel_blt_copy. One thing
we might want to do is unify the parameter ordering here a bit ...

Again gtkdoc fails to pick up the documentation for struct igt_buf :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 19:36:50 +01:00
Daniel Vetter
53a4d9e982 lib/intel_batchbuffer: igt_ prefix for rendercopy/mediafill funcs
Now everything is prepared to pour some neat api docs over this all.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:49:02 +01:00
Daniel Vetter
83a4c7d3eb lib/intel_batchbuffer: igt_ namespace for the buffer structure
Step one to properly namespace the rendercpy/mediafill functions. Als
give the buf_height/width helpers a proper igt_ prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:44:48 +01:00
Daniel Vetter
82c6dffe9f lib/intel_batchbuffer: un-inline buf_height/width
gtkdoc won't pick them up otherwise.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:41:42 +01:00
Daniel Vetter
aaebbc513a lib: make media_fill.h an internal header
Same deal as with rendercopy.h.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:39:29 +01:00
Daniel Vetter
7dc0001f3d lib: make rendercopy.h an internal header
And move the public interfaces into intel_batchbuffer.[hc].

A bit messy since we are fairly inconsistent with our header #include
handling.

Also exclude rendercopy.h from the documentation.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 15:31:15 +01:00
Daniel Vetter
eaccd444f7 lib: switch intel_copy_bo to directly take a size
Instead of a width/height combination. Since I've been lazy with the
math this now only accepts page-aligned copy operations, but that's
all we need really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13 18:07:22 +01:00
Daniel Vetter
ec5f9e8788 lib: api docs for intel_batchbuffer
- I didn't bother to document the BLIT batch header macros - I'm not
  too happy with them and they're fairly obscure.
- intel_copy_bo could use some interface love, added a FIXME comment
  for now.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13 18:07:22 +01:00
Xiang, Haihao
4570e1b3de lib: Clean the batch buffer store after reset
Otherwise the stale data in the buffer

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-12-06 13:00:22 +00:00
Daniel Vetter
e39f2dbf98 tests/gem_cs_prefetch: Fix bdw damage
v2: Fix more.

Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-14 18:14:38 +01:00
Ben Widawsky
f4dfa37e85 bdw: Update obvious missing blit support
This provides a macro that allows us to update all the arbitrary blit
commands we have stuck throughout the code. It assumes we don't actually
use 64b relocs (which is currently true). This also allows us to easily find
all the areas we need to update later when we really use the upper dword.

This block was done mostly with a sed job, and represents the easier
in test blit implementations.

v2 by Oscar: s/OUT_BATCH/BEGIN_BATCH in BLIT_COPY_BATCH_START

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
2013-11-06 09:34:35 -08:00
Imre Deak
4f496bafea lib: fix the fix for gen5 workaround emmision
Fix the regression introduced in

commit bfbe813f8fb587017c4e1d73c51395c2837eb395
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue May 29 22:14:06 2012 +0200

    lib: fix gen5 workaround emission

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-09-04 17:02:19 +03:00
Imre Deak
caf4608809 lib/intel_batchbuffer: remove code w/o effect
Introduced when refactoring the patch in

commit c1ee0bb53269ded7b79966d081518d689639bac7
Author: Imre Deak <imre.deak@intel.com>
Date:   Mon Jul 29 16:43:31 2013 +0300

    intel_batchbuffer: add support for non-32bit blt copies

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-09-04 17:07:28 +03:00
Imre Deak
c1ee0bb532 intel_batchbuffer: add support for non-32bit blt copies
Needed by an upcoming patch fixing kms_render's blits for fbs that have
other than 32bpp formats.

Based on the corresponding SNA function.

v2:
- fix random ordering of src, dst parameters (Chris)
- pass pitch in bytes rather than pixels (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-07-29 18:40:00 +03:00
Damien Lespiau
cf4efd1597 lib: Remove old dead code intel_batchbuffer_emit_mi_flush()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:48:55 +01:00
Daniel Vetter
434be47f12 shut up the compiler a bit
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-07-23 09:52:10 +02:00
Ben Widawsky
a635a5ac3b context: libdrm wrappers
This wraps libdrm functionality to exec with contexts. This patch
shouldn't be applied until libdrm for contexts is updated.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-06-29 11:24:52 -07:00
Daniel Vetter
bfbe813f8f lib: fix gen5 workaround emission
Using BEGIN_BATCH can lead to a nice inf recursion through require_space
-> flush_batch -> BEGIN_BATCH.

Also fix things up to always require BATCH_RESERVED. We need 2 dwords
for the gen5 workaround and 2 dwords for MI_BB_END.
2012-05-29 22:14:06 +02:00
Chris Wilson
b7bd1837cc Make the assertions guarding syscalls (drmIoctl in particular) verbose
Currently all we see is gem_read: ret == 0 failed, where it would help
to see the errno and/or the ret.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-29 12:50:07 +01:00