summaryrefslogtreecommitdiff
path: root/lib/intel_batchbuffer.c
AgeCommit message (Collapse)Author
2019-04-18lib/intel_batchbuffer: Make blitter asserts more usefulVille Syrjälä
Use igt_assert_lt/lte for the blitter coord/stride asserts so that we can see what the offending value was. gcc likes to optimize the values away so gdb often doesn't help as much as one would like. v2: Remove the duplicate CHECK_RANGE() definitions (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-26lib/intel_batchbuffer: Media VME kernel is valid only for Gen11Tvrtko Ursulin
Do not use it on older gens. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109612 Cc: Tony Ye <tony.ye@intel.com> Reviewed-by: Tony Ye <tony.ye@intel.com>
2019-02-05tests/gem_media_vme: Simple test to exercise the VME blockTony Ye
Simple test which exercises the VME fixed function block. v2: (Tvrtko Ursulin) * Small cleanups like copyright date, tabs, remove unused bits. v3: (Tony Ye) * Added curbe data entry for dst surface. * Read the dst surface after the VME kernel being executed. v4: (Tony Ye) * Added the media_vme.gxa kernel source code and compile instructions. v5: (Tvrtko Ursulin) * Added hang detector. v6: (Tvrtko Ursulin) * Replace gem_read with gem_sync. (Chris Wilson) Signed-off-by: Tony Ye <tony.ye@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Tony Ye <tony.ye@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-11-20lib/batchbuffer: Set bpp in igt_buf.Maarten Lankhorst
We want to allow bpp = 8 or 16, so make sure we set the bpp in igt_buf. This way we can extend rendercopy to support other values for bpp. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Fix double ;; (Ville] Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-10-15libs: Add rendercopy support for GEN11Kalamarz, Lukasz
This patch introduces a render copy shader for GEN11. The plumbing is same as with GEN9, so we can reuse it, extracting the common parts, and wrapping it in GEN-specific helpers. v2: Added gen11 shader source path next to its binary form Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-09-26lib/gpgpu_fill: Implement gpgpu_fillfunc for Gen11Katarzyna Dec
Added gen11_gpgpu_fillfunc to have gpgpu_fill passing on Gen11. Gpgpu shader was generated using IGA (Intel Graphics Assembler) based on binary found in lib/gpgpu_fill.c to match the changes in Gen11 HW: Changed 'mul' instruction to 'shl' (since Gen11 'mul' does not support integer values for both src and dest). Changed SEND message descriptor (it should have length 2 not 3). Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Tested-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Acked-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-09-26lib: Reuse Gen9 mediafill on Gen11Daniele Ceraolo Spurio
We can reuse gen9 mediafill function, because no changes are required to support Gen11. Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Tested-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Katarzyna Dec <katarzyna.dec@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-07-18lib/rendercopy: Add gen4/5 rendercopyLukasz Kalamarz
Add rendercopy implementation for gen4/5. Basic structure copied from the gen6 implementation, and the gen4/5 specific bits were mostly lifted from sna. v2: Renamed registers definitions, which are GEN4 specific to include that prefix (Lukasz) v3: Rebase and checkpatch Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-05lib: Constify igt_bufVille Syrjälä
No one generally needs to modify the igt_bufs we pass around, so make them const. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-16igt: Drop Intel from the name in docs and pathsArkadiusz Hiler
This is just a simple change to reflect the actual state. No rewording yet, just a simple substitution in most visible places - docs, README and paths. There are probably some leftovers here and there, but we can let them be for now, this is already well overdue. v2: fixed couple of obvious leftovers pointed out by Petri Cc: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-05-15lib/media_spin: Remove gen8lp_media_spin functionKatarzyna Dec
Gen8lp function are duplicates of Gen8 with difference in emit_media_objects - we cannot perform media_state_flush on CHT. Similar changes were done previously for gpgpu_fill and media_fill. v2: replaced IS_BRW and IS_CHT with IS_GEN8 v3: removed remaining 8lp spin function Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-08lib/intel_batchbuffer: Minor cosmetic change in copyright headerAntonio Argenziano
Removed some trailing white spaces. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-04-24lib/intel_batchbuffer: Move batch functions from media/render/gpgpu libsKalamarz, Lukasz
Batch functions were copy/pasted across several libs. With moving it into intel_batchbuffer lib test can now be easly maintained without worrying that we forgot to modify older version of lib. v2: Added documentation into lib and rebased patch v3: Fixed typos and rebased patch v4: Fixed documentation issues v5: Rename, clean up of leftovers from previous version and documentation polishing v6: Fixing assert Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-04-18lib/intel_batchbuffer: Reuse gen9_media_fill on Gen 10Katarzyna Dec
Media fill function can be reused on Gen10. Code has not changed. Let's reuse gen9. Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Reviewed-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
2018-04-12lib: Remove duplications in gpu_fill libraryKatarzyna Dec
After moving all functions needed for gpgpu and media fill testing there is a lot of duplications which can be removed: Library media_fill_gen8 and media_fill_gen8lp for CHT was removed, media state flush for !CHT was added to gen7_emit_media_objects. Many gen8 functions were replaced with gen7 version with devid parameter (gen7_fill_curbe_load, gen7_emit_interface_descriptor, gen7_fill_binding_table, gen7_emit_media_objects). Unified fill kernel function so it is applicable to all gens and both media and gpgpu (merged gen7_fill_media_kernel and gen8_fill_media_kernel). Duplicated constants like GEN8_MEDIA_VFE_STATE, GEN8_MEDIA_CURBE_LOAD, GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD, GEN8_MEDIA_OBJECT were replaced by GEN7 version. However this constants were not removed from gen8_media.h library, because they are used by other tests for Gen8+. More refactoring in this gen*_media.h libraries is needed. It seems that further unification of *_fillfunc functions will introduce more confusion in understanding what the tests are doing and what were changes between Gens. v2: Moved some reduntant changes from Move gpgpu/media fill to gpu_fill... to this patch. Applied comments from review. v3: rebase Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2018-02-01lib/intel_batchbuffer: Add src/dst delta arguments to igt_blitter_fast_copy tooMaarten Lankhorst
Nothing uses this currently, but other copy functions have the same delta now. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-02-01lib/intel_batchbuffer: Add delta argument to igt_blitter_fast_copy__raw, v2.Maarten Lankhorst
Adding a delta offset will allow us to copy planar framebuffers with this function. Changes since v1: - Set src and destination addresses to the delta, in case BO is mapped at offset 0. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> #v1
2017-12-11igt_fb: Add support for drawing to non-32bit Y/Yf tiled FBsImre Deak
When drawing with cairo to Y/Yf tiled FBs we use a temporary linear buffer which is mapped to the CPU, but the fast blit needed for this only expects 32 bpp FBs. Add support for other bpps too. This is needed for upcoming patches testing non-32bit bpp formats with Y/Yf tiling. Thanks to Ville for explaining why we need the temporary buffer. (Looks like for Y tiling we could do without, but that's a separate topic.) Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Imre Deak <imre.deak@intel.com>
2017-06-30lib/intel_batchbuffer: Add Gen10 support for render_copy and gpgpu_fillfunc.Rodrigo Vivi
None of the fields we use on render_copy and gpgpu_fill has changed when compared to gen9. So let's reuse them. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2017-01-02lib: Mass conversion to to_user_pointer()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-08lib: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib/gpgpu_fill: Add SKL supportDominik Zeromski
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-20lib/gpgpu_fill: Add BDW supportDominik Zeromski
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-20lib: Move gpgpu_fill code to separate fileDominik Zeromski
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-02docs: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-27doc: Remove i-g-t/intel prefixes and capitalize section titlesDamien Lespiau
Looks better! Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-04-14lib: add a define for test failure exit statusThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-25lib: Add media spinJeff McGee
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-18lib/batch: Fix range checks for blitsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-18lib/batch: Trivial compile fix for 32-bit buildsChris Wilson
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-12lib: small documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-12lib: Provide a raw version of the gen9 fast copy blitsDamien Lespiau
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-12lib: Split two helpers to build fast copy's dword0 and dword1Damien Lespiau
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-12lib: Don't give a struct igt_buf * to fast_copy_pitch()Damien Lespiau
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-12lib/skl: Add gen9 specific igt_blitter_fast_copy()Damien Lespiau
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>
2014-12-04lib: Add GPGPU fillZhenyu Wang
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-04lib: rename igt_media_fillfunc_t typedef to igt_fillfunc_tZhenyu Wang
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-11-25lib: fix symbol names in documentation commentsThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30lib/skl: Return the render copy and media fill functionsXiang, Haihao
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-09igt/gem_ppgtt: Create secondary contexts and mmChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-09test: Exercise full ppgtt switching between multiple fdChris Wilson
Load up both rings with lots of fighting between multiple contexts. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-30batch: Specify number of relocations to accommodateChris Wilson
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-29Prepare for 64bit relocation addressesChris Wilson
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-29lib/batchbuffer: Guard intel_blt_copy with even more assertsChris Wilson
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-29lib/batchbuffer: Store the gen in a local variableChris Wilson
Reduce lookups and improve code clarity. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26lib: Use igt macros moreDaniel Vetter
Stragglers. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-06lib/chv: CHV media pipeline command sequenceSean V Kelley
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-03-26lib/igt_kms/bf: doc skeletonDaniel Vetter
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-23lib/intel_batchbuffer: document header dependenciesDaniel Vetter
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-23lib: Use @include tag for include filesDaniel Vetter
Occasionally useful to read documentation ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>