Remove compile time depencencies on libdrm_intel.
cover Remove compile time depencencies on libdrm_intel.
From: Robert Foss <[email protected]>
Hey,
I've been looking at the possibilty of removing the compile time depency on libdrm_intel. There are two technical solutions to this problem as far as I can see; stubs and conditional compilation.
I'd like to compare the two approaches to provide an overview.
Conditional compilation:
+ Programs that will not work on a given platform are not built.
+ Faster compilation (especially helpful on slow platforms like the RPi2).
- Combinatorial complexity of different environments (what to build if we have libpciaccess and libdrm_vc4 but no libintel_drm for example), that that quickly will get worse with more configurations.
- Currently some sources like igt_aux/igt_kms partially depend on libdrm_intel, to avoid #ifdef hell, configuraiton specific functionality should have to be extracted into new files.
Stubs:
+ Relatively straight forward to implement, as can be seen from these patches.
+ Can easily be extended for any depency.
- Duplicating defines/structs/functions is a maintenance burden.
- Some built binaries will always skip, and are essentially useless.
- Little compilation speedup.
Robert Foss (9):
configure.ac: Test for libdrm_intel and build for it if present. benchmarks/Makefile: Don't build benchmarks that depend on
libdrm_intel.
tools/Makefile: Don't build tools that depend on libdrm_intel. demos/Makefile: Don't build tools that depend on libdrm_intel. tests/gem_ppgtt: Switched to new aliases of intel specific functions. tests/gem_render_tiled_blits: Switched to new aliases of intel
specific functions.
lib/intel_drm_stubs: Add stubs for functionality from libdrm_intel.
lib: Replace intel specific header includes with intel_drm_stubs.h.
tests: Replace intel specific header includes with intel_drm_stubs.h.
benchmarks/Makefile.sources | 15 +- configure.ac | 14 +- demos/Makefile.am | 5 +- demos/Makefile.sources | 7 + lib/Makefile.sources | 2 + lib/drmtest.c | 2 +- lib/gpgpu_fill.c | 7 +- lib/igt_aux.c | 2 +- lib/igt_aux.h | 3 +- lib/igt_debugfs.c | 4 +- lib/igt_draw.h | 3 +- lib/igt_fb.h | 3 +- lib/igt_kms.c | 3 +- lib/intel_batchbuffer.c | 4 - lib/intel_batchbuffer.h | 3 +- lib/intel_chipset.c | 2 +- lib/intel_drm_stubs.c | 258 +++++++++ lib/intel_drm_stubs.h | 999 +++++++++++++++++++++++++++++++++ lib/ioctl_wrappers.c | 1 - lib/ioctl_wrappers.h | 4 +- lib/media_fill_gen7.c | 3 +- lib/media_fill_gen8.c | 4 +- lib/media_fill_gen8lp.c | 6 +- lib/media_fill_gen9.c | 4 +- lib/media_spin.c | 2 - lib/rendercopy_gen6.c | 5 +- lib/rendercopy_gen7.c | 4 +- lib/rendercopy_gen8.c | 4 +- lib/rendercopy_gen9.c | 5 +- lib/rendercopy_i830.c | 5 +- lib/rendercopy_i915.c | 9 +- tests/core_auth.c | 2 +- tests/core_get_client_auth.c | 2 +- tests/core_getclient.c | 3 +- tests/drm_import_export.c | 7 +- tests/drm_read.c | 5 +- tests/drm_vma_limiter.c | 6 +- tests/drm_vma_limiter_cached.c | 6 +- tests/drm_vma_limiter_cpu.c | 6 +- tests/drm_vma_limiter_gtt.c | 6 +- tests/drv_getparams_basic.c | 6 +- tests/gem_alive.c | 4 +- tests/gem_bad_address.c | 6 +- tests/gem_bad_batch.c | 6 +- tests/gem_bad_blit.c | 6 +- tests/gem_bad_length.c | 2 +- tests/gem_bad_reloc.c | 2 +- tests/gem_basic.c | 2 +- tests/gem_caching.c | 5 +- tests/gem_close_race.c | 2 +- tests/gem_concurrent_all.c | 5 +- tests/gem_cpu_reloc.c | 4 +- tests/gem_create.c | 8 +- tests/gem_ctx_bad_exec.c | 3 +- tests/gem_ctx_basic.c | 8 +- tests/gem_double_irq_loop.c | 7 +- tests/gem_evict_everything.c | 2 +- tests/gem_exec_bad_domains.c | 7 +- tests/gem_exec_big.c | 2 +- tests/gem_exec_blt.c | 2 +- tests/gem_exec_faulting_reloc.c | 2 +- tests/gem_exec_lut_handle.c | 2 +- tests/gem_exec_nop.c | 2 +- tests/gem_exec_params.c | 2 +- tests/gem_fence_thrash.c | 2 +- tests/gem_fence_upload.c | 7 +- tests/gem_flink_basic.c | 2 +- tests/gem_flink_race.c | 4 +- tests/gem_gpgpu_fill.c | 7 +- tests/gem_gtt_cpu_tlb.c | 2 +- tests/gem_gtt_speed.c | 2 +- tests/gem_hang.c | 6 +- tests/gem_hangcheck_forcewake.c | 7 +- tests/gem_largeobject.c | 2 +- tests/gem_lut_handle.c | 2 +- tests/gem_madvise.c | 3 +- tests/gem_media_fill.c | 7 +- tests/gem_mmap.c | 2 +- tests/gem_mmap_gtt.c | 2 +- tests/gem_mmap_offset_exhaustion.c | 2 +- tests/gem_mmap_wc.c | 2 +- tests/gem_non_secure_batch.c | 5 +- tests/gem_partial_pwrite_pread.c | 1 - tests/gem_persistent_relocs.c | 1 - tests/gem_pin.c | 1 - tests/gem_pipe_control_store_loop.c | 7 +- tests/gem_ppgtt.c | 24 +- tests/gem_pread.c | 2 +- tests/gem_pread_after_blit.c | 1 - tests/gem_pwrite.c | 2 +- tests/gem_pwrite_pread.c | 7 +- tests/gem_pwrite_snooped.c | 2 +- tests/gem_read_read_speed.c | 5 +- tests/gem_readwrite.c | 2 +- tests/gem_reloc_overflow.c | 2 +- tests/gem_reloc_vs_gpu.c | 1 - tests/gem_render_copy.c | 5 +- tests/gem_render_copy_redux.c | 7 +- tests/gem_render_linear_blits.c | 5 +- tests/gem_render_tiled_blits.c | 9 +- tests/gem_request_retire.c | 8 +- tests/gem_seqno_wrap.c | 4 +- tests/gem_set_tiling_vs_blt.c | 7 +- tests/gem_set_tiling_vs_gtt.c | 2 +- tests/gem_set_tiling_vs_pwrite.c | 2 +- tests/gem_stolen.c | 14 +- tests/gem_storedw_batches_loop.c | 7 +- tests/gem_storedw_loop.c | 2 +- tests/gem_streaming_writes.c | 2 +- tests/gem_stress.c | 6 +- tests/gem_threaded_access_tiled.c | 4 +- tests/gem_tiled_blits.c | 1 - tests/gem_tiled_fence_blits.c | 5 +- tests/gem_tiled_partial_pwrite_pread.c | 1 - tests/gem_tiled_pread_basic.c | 2 +- tests/gem_tiled_pread_pwrite.c | 1 - tests/gem_tiled_swapping.c | 1 - tests/gem_tiled_wb.c | 2 +- tests/gem_tiled_wc.c | 2 +- tests/gem_tiling_max_stride.c | 2 +- tests/gem_unfence_active_buffers.c | 7 +- tests/gem_unref_active_buffers.c | 7 +- tests/gem_userptr_blits.c | 8 +- tests/gem_wait.c | 5 +- tests/gem_write_read_ring_switch.c | 1 - tests/gen3_mixed_blits.c | 2 +- tests/gen3_render_linear_blits.c | 2 +- tests/gen3_render_mixed_blits.c | 2 +- tests/gen3_render_tiledx_blits.c | 2 +- tests/gen3_render_tiledy_blits.c | 2 +- tests/gen7_forcewake_mt.c | 3 +- tests/kms_addfb_basic.c | 3 +- tests/kms_atomic.c | 5 +- tests/kms_mmap_write_crc.c | 2 +- tests/kms_psr_sink_crc.c | 4 +- tests/kms_render.c | 4 +- tests/kms_setmode.c | 4 +- tests/kms_vblank.c | 5 +- tests/pm_rpm.c | 1 - tests/pm_rps.c | 4 +- tests/pm_sseu.c | 6 +- tests/prime_mmap.c | 5 +- tests/prime_nv_api.c | 4 +- tests/prime_nv_pcopy.c | 4 +- tests/prime_nv_test.c | 4 +- tests/prime_self_import.c | 3 +- tests/prime_udl.c | 7 +- tests/vc4_create_bo.c | 5 +- tests/vc4_wait_bo.c | 5 +- tests/vc4_wait_seqno.c | 3 +- tools/Makefile.sources | 50 +- 151 files changed, 1588 insertions(+), 338 deletions(-) create mode 100644 demos/Makefile.sources create mode 100644 lib/intel_drm_stubs.c create mode 100644 lib/intel_drm_stubs.h
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 1/9 configure.ac: Test for libdrm_intel and build for it if present.
From: Robert Foss <[email protected]>
Test for libdrm_intel and build for it if present.
Also expose the HAVE_INTEL #define to allow code to be conditionally compiled.
--- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
configure.ac +13 -1
@@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in
@@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], + [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) + # for dma-buf tests AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], [Enable use of nouveau API for prime tests (default: auto)]),
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 1/9] configure.ac: Test for libdrm_intel and build for it if present.
Quoted 29 lines · On Fri, May 20, 2016 at 06:59:25PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
Test for
libdrm_inteland build for it if present.
Also expose theHAVE_INTEL#define to allow code to be conditionally compiled.Signed-off-by Robert Foss <[email protected]>--- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)configure.ac +2
-1@@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in@@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],
configure.ac PKG_CHECK_MODULES(GLIB, glib-2.0) · line 163
Quoted 10 lines
configure.ac +10
-0+ [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
HAVE_INTEL caused quite a bit of confusion when reading the later build patches.
Please use HAVE_LIBDRM_INTEL instead
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 1/9] configure.ac: Test for libdrm_intel and build for it if present.
Quoted 44 lines · Chris Wilson
Quoted 29 lines · On Fri, May 20, 2016 at 06:59:25PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
Test for
libdrm_inteland build for it if present.
Also expose theHAVE_INTEL#define to allow code to be conditionally compiled.Signed-off-by Robert Foss <[email protected]>--- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)configure.ac +2
-1@@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in@@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],configure.ac PKG_CHECK_MODULES(GLIB, glib-2.0) · line 163
Quoted 10 lines
configure.ac +10
-0+ [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
HAVE_INTELcaused quite a bit of confusion when reading the later build patches.
Quoted 3 lines
Please use
HAVE_LIBDRM_INTELinstead
-Chris
That is definitely better, I've added it to v2.
Thanks for the suggestion.
Rob.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? ?==?utf-8?q? [RFC i-g-t 1/9]?==?utf-8?q? configure.ac: Test for libdrm_intel and build for it if present.
In reply to Chris WilsonQuoted 44 lines · Chris Wilson
Quoted 29 lines · On Fri, May 20, 2016 at 06:59:25PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
Test for
libdrm_inteland build for it if present.
Also expose theHAVE_INTEL#define to allow code to be conditionally compiled.Signed-off-by Robert Foss <[email protected]>--- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)configure.ac +2
-1@@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in@@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],configure.ac PKG_CHECK_MODULES(GLIB, glib-2.0) · line 163
Quoted 10 lines
configure.ac +10
-0+ [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
HAVE_INTELcaused quite a bit of confusion when reading the later build patches.
Quoted 1 line
Please use
HAVE_LIBDRM_INTELinstead
As a counter argument, one could, should really, use --enable-intel to replace the 'x86' parts in commit bccc0ec6a3fdae880e14770c2ff5770fb86ea6fc. Perhaps HAVE_INTEL isn't that bad when we take that into consideration ?
Regards,
Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 1/9] configure.ac: Test for libdrm_intel and build for it if present.
Quoted 46 lines · Emil Velikov
Quoted 45 lines · Chris Wilson
Quoted 30 lines · On Fri, May 20, 2016 at 06:59:25PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
Test for
libdrm_inteland build for it if present.
Also expose theHAVE_INTEL#define to allow code to be conditionally compiled.Signed-off-by Robert Foss <[email protected]>--- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)configure.ac +3
-1@@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in@@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], + [Enable building of intel specific parts (default: auto)]),configure.ac PKG_CHECK_MODULES(GLIB, glib-2.0) · line 164
Quoted 10 lines
configure.ac +9
-0+ [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_INTEL, 1, [Have intel support]) +fi +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
HAVE_INTELcaused quite a bit of confusion when reading the later build patches.
Quoted 3 lines
Quoted 1 line
Please use
HAVE_LIBDRM_INTELinsteadAs a counter argument, one could, should really, use --enable-intel to replace the 'x86' parts in commit
bccc0ec6a3fdae880e14770c2ff5770fb86ea6fc. PerhapsHAVE_INTELisn't that bad when we take that into consideration ?
The purpose of HAVE_INTEL isn't really to avoid building x86 code on non-x86 platforms, but rather to avoid a build dependency where it can be avoided.
That being said using a BUILD_X86 or something like it to avoid building irrelevant binaries would be very useful.
Either way, HAVE_LIBDRM_INTEL more clearly defines what the flag is about.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 2/9 benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
In reply to [email protected]From: Robert Foss <[email protected]>
Use the HAS_INTEL automake flag to avoid building benchmarks that won't compile unless libdrm_intel is available in the build system.
--- benchmarks/Makefile.sources | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
benchmarks/Makefile.sources +10 -5
@@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx \
@@ -16,6 +12,15 @@ benchmarks_PROGRAMS = \ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +if HAVE_INTEL + benchmarks_PROGRAMS += \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \ + intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) +endif
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 2/9] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
Quoted 32 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Use the
HAS_INTELautomake flag to avoid building benchmarks that won't compile unlesslibdrm_intelis available in the build system.Signed-off-by Robert Foss <[email protected]>--- benchmarks/Makefile.sources | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)benchmarks/Makefile.sources +0
-5@@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx \@@ -16,6 +12,15 @@ benchmarks_PROGRAMS = \ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL)
benchmarks/Makefile.sources benchmarks_PROGRAMS = \ · line 26
Quoted 10 lines
benchmarks/Makefile.sources +10
-0+ +if HAVE_INTEL + benchmarks_PROGRAMS += \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \ + intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) +endif
Some suggestions:
- Please don't use conditionals in the Makefile.sources - you'll break the other build (Android)
- instead of ^^ use separate variable and combine them in the Makefile.am/Android.mk
- Don't double-indent, don't think any other place does so.
Thanks
Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 2/9] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
Quoted 39 lines · Emil Velikov
Quoted 38 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Use the
HAS_INTELautomake flag to avoid building benchmarks that won't compile unlesslibdrm_intelis available in the build system.Signed-off-by Robert Foss <[email protected]>--- benchmarks/Makefile.sources | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)benchmarks/Makefile.sources +6
-5@@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx \@@ -16,6 +12,15 @@ benchmarks_PROGRAMS = \ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +if HAVE_INTEL + benchmarks_PROGRAMS += \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \
Quoted 8 lines
benchmarks/Makefile.sources benchmarks_PROGRAMS = \ · line 26
Quoted 4 lines
benchmarks/Makefile.sources +4
-0+ intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) +endifSome suggestions:
- Please don't use conditionals in the Makefile.sources - you'll break the other build (Android)
- instead of ^^ use separate variable and combine them in theMakefile.am/Android.mk
- Don't double-indent, don't think any other place does so.
Atm the other build is Intel-only, so I don't think it's that bad really - if we add a #define HAVE_INTEL there before including Makefile.sources (or whatever the make magic for this is). If someone wants to build igt on other Android machines that needs some extensions, but hey not my problem when Android wants to reinvent half of autoconf ;-)
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 2/9] benchmarks/Makefile: Don't build benchmarks that depend on libdrm_intel.
Quoted 49 lines · Daniel Vetter
Quoted 39 lines · Emil Velikov
Quoted 38 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Use the
HAS_INTELautomake flag to avoid building benchmarks that won't compile unlesslibdrm_intelis available in the build system.Signed-off-by Robert Foss <[email protected]>--- benchmarks/Makefile.sources | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)benchmarks/Makefile.sources +6
-5@@ -1,10 +1,6 @@ benchmarksdir=$(libexecdir)/intel-gpu-tools/benchmarks benchmarks_PROGRAMS = \ - intel_upload_blit_large \ - intel_upload_blit_large_gtt \ - intel_upload_blit_large_map \ - intel_upload_blit_small \ gem_blt \ gem_create \ gem_exec_ctx \@@ -16,6 +12,15 @@ benchmarks_PROGRAMS = \ gem_prw \ gem_set_domain \ gem_syslatency \ - gem_userptr_benchmark \ kms_vblank \ $(NULL) + +if HAVE_INTEL + benchmarks_PROGRAMS += \ + intel_upload_blit_large \ + intel_upload_blit_large_gtt \ + intel_upload_blit_large_map \Quoted 8 lines
benchmarks/Makefile.sources benchmarks_PROGRAMS = \ · line 26
Quoted 4 lines
benchmarks/Makefile.sources +4
-0+ intel_upload_blit_small \ + gem_userptr_benchmark \ + $(NULL) +endifSome suggestions:
- Please don't use conditionals in the Makefile.sources - you'll break the other build (Android)
- instead of ^^ use separate variable and combine them in theMakefile.am/Android.mk
- Don't double-indent, don't think any other place does so.
Quoted 7 lines
Atm the other build is Intel-only, so I don't think it's that bad really - if we add a #define
HAVE_INTELthere before including Makefile.sources (or whatever the make magic for this is). If someone wants to build igt on other Android machines that needs some extensions, but hey not my problem when Android wants to reinvent half of autoconf ;-)
-Daniel
For v2 I've implemented the changes as suggested by Emil, I've also added the (hopefully) equivalent changes to Arduino.mk.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 3/9 tools/Makefile: Don't build tools that depend on libdrm_intel.
In reply to [email protected]From: Robert Foss <[email protected]>
Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system.
--- tools/Makefile.sources | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-)
tools/Makefile.sources +29 -21
@@ -1,42 +1,54 @@ -noinst_PROGRAMS = \ - hsw_compute_wrpll \ - skl_compute_wrpll \ - skl_ddb_allocation \ +noinst_PROGRAMS = \ + hsw_compute_wrpll \ + skl_compute_wrpll \ + skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ +bin_PROGRAMS = \ igt_stats \ - intel_audio_dump \ + intel_audio_dump \ intel_reg \ intel_backlight \ intel_bios_dumper \ intel_bios_reader \ intel_display_crc \ intel_display_poller \ - intel_dump_decode \ - intel_error_decode \ intel_forcewaked \ intel_gpu_frequency \ - intel_framebuffer_dump \ intel_firmware_decode \ - intel_gpu_time \ - intel_gpu_top \ - intel_gtt \ + intel_gpu_time \ + intel_gpu_top \ + intel_gtt \ intel_infoframes \ intel_l3_parity \ intel_lid \ intel_opregion_decode \ intel_panel_fitter \ - intel_perf_counters \ - intel_reg_checker \ + intel_reg_checker \ intel_residency \ - intel_stepping \ + intel_stepping \ intel_watermark dist_bin_SCRIPTS = intel_gpu_abrt -intel_dump_decode_SOURCES = \ - intel_dump_decode.c +if HAVE_INTEL + bin_PROGRAMS += \ + intel_dump_decode \ + intel_error_decode \ + intel_framebuffer_dump \ + intel_perf_counters \ + $(NULL) + + intel_dump_decode_SOURCES = \ + intel_dump_decode.c \ + $(NULL) + + intel_error_decode_SOURCES = \ + intel_error_decode.c \ + $(NULL) + + intel_error_decode_LDFLAGS = -lz +endif intel_reg_SOURCES = \ intel_reg.c \
@@ -44,10 +56,6 @@ intel_reg_SOURCES = \ intel_reg_spec.c \ intel_reg_spec.h -intel_error_decode_SOURCES = \ - intel_error_decode.c -intel_error_decode_LDFLAGS = -lz - intel_bios_reader_SOURCES = \ intel_bios_reader.c \ intel_bios.h
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 3/9] tools/Makefile: Don't build tools that depend on libdrm_intel.
Quoted 49 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Use the
HAS_INTELautomake flag to avoid building tools that won't compile unlesslibdrm_intelis available in the build system.Signed-off-by Robert Foss <[email protected]>--- tools/Makefile.sources | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-)tools/Makefile.sources +9
-12@@ -1,42 +1,54 @@ -noinst_PROGRAMS = \ - hsw_compute_wrpll \ - skl_compute_wrpll \ - skl_ddb_allocation \ +noinst_PROGRAMS = \ + hsw_compute_wrpll \ + skl_compute_wrpll \ + skl_ddb_allocation \ $(NULL) -bin_PROGRAMS = \ +bin_PROGRAMS = \ igt_stats \ - intel_audio_dump \ + intel_audio_dump \ intel_reg \ intel_backlight \ intel_bios_dumper \ intel_bios_reader \ intel_display_crc \ intel_display_poller \ - intel_dump_decode \ - intel_error_decode \ intel_forcewaked \ intel_gpu_frequency \ - intel_framebuffer_dump \ intel_firmware_decode \ - intel_gpu_time \ - intel_gpu_top \ - intel_gtt \ + intel_gpu_time \ + intel_gpu_top \ + intel_gtt \ intel_infoframes \
tools/Makefile.sources line 29
Quoted 10 lines
tools/Makefile.sources +2
-3intel_l3_parity \ intel_lid \ intel_opregion_decode \ intel_panel_fitter \ - intel_perf_counters \ - intel_reg_checker \ + intel_reg_checker \ intel_residency \ - intel_stepping \ + intel_stepping \
Please don't mix functionality and cosmetic changes. Apply the whitespace polish as a separate patch ?
Quoted 13 lines
tools/Makefile.sources +7
-2intel_watermark dist_bin_SCRIPTS = intel_gpu_abrt -intel_dump_decode_SOURCES = \ - intel_dump_decode.c +if HAVE_INTEL + bin_PROGRAMS += \ + intel_dump_decode \ + intel_error_decode \ + intel_framebuffer_dump \ + intel_perf_counters \ + $(NULL)
tools/Makefile.sources line 50
Quoted 10 lines
tools/Makefile.sources +10
-0+ + intel_dump_decode_SOURCES = \ + intel_dump_decode.c \ + $(NULL) + + intel_error_decode_SOURCES = \ + intel_error_decode.c \ + $(NULL) + + intel_error_decode_LDFLAGS = -lz
Apart from than my earlier comments, LDFLAGS variables should not live in this file. Please move it to Makefile.am.
Thanks
Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 4/9 demos/Makefile: Don't build tools that depend on libdrm_intel.
In reply to [email protected]From: Robert Foss <[email protected]>
Use the HAS_INTEL automake flag to avoid building tools that won't compile unless libdrm_intel is available in the build system.
--- demos/Makefile.am | 5 ++--- demos/Makefile.sources | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 demos/Makefile.sources
demos/Makefile.am +2 -3
@@ -1,6 +1,5 @@ -bin_PROGRAMS = \ - intel_sprite_on \ - $(NULL) + +include Makefile.sources AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS)
demos/Makefile.sources new file +7 -0
@@ -0,0 +1,7 @@ +bin_PROGRAMS = \ + $(NULL) + +if HAVE_INTEL + bin_PROGRAMS += \ + intel_sprite_on \ +endif
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 5/9 tests/gem_ppgtt: Switched to new aliases of intel specific functions.
In reply to [email protected]From: Robert Foss <[email protected]>
Switched from drm_XXX aliases drm_intel_XXX aliases for symbols where that switch is possible.
--- tests/gem_ppgtt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
tests/gem_ppgtt.c +9 -9
@@ -74,11 +74,11 @@ static void scratch_buf_init(struct igt_buf *buf,static void scratch_buf_fini (struct igt_buf *buf) { -dri_bo_unreference (buf->bo); +drm_intel_bo_unreference (buf->bo);memset (buf,0 ,sizeof (*buf)); } -static void fork_rcs_copy(int target, dri_bo **dst, int count, unsigned flags) +static void fork_rcs_copy(int target, drm_intel_bo **dst, int count, unsigned flags)#define CREATE_CONTEXT 0x1 {igt_render_copyfunc_t render_copy;
@@ -143,7 +143,7 @@ static void fork_rcs_copy(int target, dri_bo **dst, int count, unsigned flags) } } -static void fork_bcs_copy (int target,dri_bo **dst,int count) +static void fork_bcs_copy (int target,drm_intel_bo **dst,int count) {int devid;
@@ -167,7 +167,7 @@ static void fork_bcs_copy(int target, dri_bo **dst, int count)igt_assert (batch);for (int i =0 ; i <= target; i++) { -dri_bo *src[2 ]; +drm_intel_bo *src[2 ]; src[0 ] =create_bo (dst[child]->bufmgr, ~0 );
@@ -177,13 +177,13 @@ static void fork_bcs_copy(int target, dri_bo **dst, int count)intel_copy_bo (batch, src[0 ], src[1 ],SIZE );intel_copy_bo (batch, dst[child], src[0 ],SIZE ); -dri_bo_unreference (src[1 ]); -dri_bo_unreference (src[0 ]); +drm_intel_bo_unreference (src[1 ]); +drm_intel_bo_unreference (src[0 ]); } } } -static void surfaces_check (dri_bo **bo,int count,uint32_t expected) +static void surfaces_check (drm_intel_bo **bo,int count,uint32_t expected) {for (int child =0 ; child < count; child++) {uint32_t *ptr;
@@ -322,7 +322,7 @@ int main(int argc, char **argv)igt_subtest_init (argc, argv); igt_subtest("blt-vs-render-ctx0") { -dri_bo *bcs[1 ], *rcs[N_CHILD ]; +drm_intel_bo *bcs[1 ], *rcs[N_CHILD ];fork_bcs_copy (0x4000 , bcs,1 );fork_rcs_copy (0x8000 /N_CHILD , rcs,N_CHILD ,0 );
@@ -334,7 +334,7 @@ int main(int argc, char **argv) } igt_subtest("blt-vs-render-ctxN") { -dri_bo *bcs[1 ], *rcs[N_CHILD ]; +drm_intel_bo *bcs[1 ], *rcs[N_CHILD ];fork_rcs_copy (0x8000 /N_CHILD , rcs,N_CHILD ,CREATE_CONTEXT );fork_bcs_copy (0x4000 , bcs,1 );
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 5/9] tests/gem_ppgtt: Switched to new aliases of intel specific functions.
Quoted 10 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Switched from
drm_XXXaliasesdrm_intel_XXXaliases for symbols where that switch is possible.Signed-off-by Robert Foss <[email protected]>--- tests/gem_ppgtt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
I could swear I've sent a similar looking patch... actually I have it only locally.
-Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 5/9] tests/gem_ppgtt: Switched to new aliases of intel specific functions.
In reply to [email protected]Quoted 10 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Switched from
drm_XXXaliasesdrm_intel_XXXaliases for symbols where that switch is possible.Signed-off-by Robert Foss <[email protected]>--- tests/gem_ppgtt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
-Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [RFC i-g-t 5/9] tests/gem_ppgtt: Switched to new aliases of intel specific functions.
Quoted 6 lines · Emil Velikov
Quoted 5 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Switched from
drm_XXXaliasesdrm_intel_XXXaliases for symbols where that switch is possible.
Quoted 6 lines
Quoted 5 lines
Signed-off-by Robert Foss <[email protected]>--- tests/gem_ppgtt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)Reviewed-by Emil Velikov <[email protected]>
Applied, thanks.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 6/9 tests/gem_render_tiled_blits: Switched to new aliases of intel specific functions.
In reply to [email protected]From: Robert Foss <[email protected]>
Switched from drm_XXX aliases drm_intel_XXX aliases for symbols where that switch is possible.
--- tests/gem_render_tiled_blits.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/gem_render_tiled_blits.c +2 -2
@@ -72,7 +72,7 @@ check_bo(struct intel_batchbuffer *batch, struct igt_buf *buf, uint32_t val)render_copy (batch,NULL , buf,0 ,0 ,WIDTH ,HEIGHT , &tmp,0 ,0 );if (snoop) { -do_or_die (dri_bo_map (linear,0 )); +do_or_die (drm_intel_bo_map (linear,0 )); ptr = linear->virtual; }else {do_or_die (drm_intel_bo_get_subdata (linear,0 ,sizeof (data), data));
@@ -86,7 +86,7 @@ check_bo(struct intel_batchbuffer *batch, struct igt_buf *buf, uint32_t val) val++; }if (ptr != data) -dri_bo_unmap (linear); +drm_intel_bo_unmap (linear); }static void run_test (int fd,int count)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 6/9] tests/gem_render_tiled_blits: Switched to new aliases of intel specific functions.
Quoted 10 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Switched from
drm_XXXaliasesdrm_intel_XXXaliases for symbols where that switch is possible.Signed-off-by Robert Foss <[email protected]>--- tests/gem_render_tiled_blits.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Looks like I've replied to 5/9 twice instead of here :-\
-Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 6/9] tests/gem_render_tiled_blits: Switched to new aliases of intel specific functions.
Quoted 6 lines · Emil Velikov
Quoted 5 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Switched from
drm_XXXaliasesdrm_intel_XXXaliases for symbols where that switch is possible.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Robert Foss <[email protected]>--- tests/gem_render_tiled_blits.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Looks like I've replied to 5/9 twice instead of here :-\
Reviewed-by Emil Velikov <[email protected]>
Also applied, thanks.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 7/9 lib/intel_drm_stubs: Add stubs for functionality from libdrm_intel.
In reply to [email protected]From: Robert Foss <[email protected]>
This patch provides stubs for functionality otherwise provided by libdrm_intel.
The stubbed functions all fail with a call to igt_require(false). Defines and enums have been copied from libdrm_intel.
Due to the stubbed tests failing with an igt_require() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful.
--- lib/Makefile.sources | 2 + lib/intel_drm_stubs.c | 258 +++++++++++++ lib/intel_drm_stubs.h | 999 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1259 insertions(+) create mode 100644 lib/intel_drm_stubs.c create mode 100644 lib/intel_drm_stubs.h
lib/Makefile.sources +2 -0
@@ -21,6 +21,8 @@ libintel_tools_la_SOURCES = \ intel_batchbuffer.c \ intel_batchbuffer.h \ intel_chipset.h \ + intel_drm_stubs.c \ + intel_drm_stubs.h \ intel_os.c \ intel_io.h \ intel_mmio.c \
lib/intel_drm_stubs.c new file +258 -0
258 lines not on this page · raw message
lib/intel_drm_stubs.h new file +999 -0
999 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 7/9] lib/intel_drm_stubs: Add stubs for functionality from libdrm_intel.
lib/intel_drm_stubs.c
Quoted 2 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
lib/intel_drm_stubs.c new file +0
-0
Since this and the header file are stubs around intel_bufmgr, it might be better to call them intel_bufmgr_stubs.[ch]. In case "_stubs" in the name brings any confusion one could use _implementation/_internal and/or other.
lib/intel_drm_stubs.h line 7
Quoted 10 lines
lib/intel_drm_stubs.h new file +7
-0@@ -0,0 +1,999 @@ +#ifndef INTEL_DRM_STUBS_H +#define INTEL_DRM_STUBS_H + +#include <xf86drm.h> + +#include "igt_core.h" +
Please don't. There is nothing here that requires either of these includes. As-is this makes the already convoluted header inclusion worse.
lib/intel_drm_stubs.h line 12
Quoted 5 lines
lib/intel_drm_stubs.h new file +5
-0+#ifdef HAVE_INTEL +#include <i915_drm.h> +#include <intel_bufmgr.h> +#include <drm.h> +
Similarly, please drop the drm headers. They are provided by libdrm itself (as opposed to libdrm_intel) and thus they should be available everywhere.
lib/intel_drm_stubs.h line 17
Quoted 5 lines
lib/intel_drm_stubs.h new file +5
-0+ +#else +#define i915_execbuffer2_set_context_id (eb2, context) igt_require(false); +#define i915_execbuffer2_get_context_id (eb2) igt_require(false); +
Do we have (m)any test that don't any intel_bufmgr functionality and/or don't explicitly require intel drm device ? Afaict those will take precedense over the above two execbuf macros, thus one can omit the above.
For the rest of the patch you seems to be inlining i915_drm.h and intel_bufmgr.h which is a very bad idea imho. As-is it's fragile and hard to maintain.
If we drop the i915_drm.h changes, as suggested above, and copy/import the latter header as local_intel_bufmgr.h things will be better imho. It might be worth adding a note in the releasing document to sync the file with the latest libdrm_intel release.
Regards,
Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 7/9] lib/intel_drm_stubs: Add stubs for functionality from libdrm_intel.
In reply to [email protected]Quoted 6 lines · On Fri, May 20, 2016 at 06:59:31PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
This patch provides stubs for functionality otherwise provided by
libdrm_intel.The stubbed functions all fail with a call to
igt_require(false). Defines and enums have been copied fromlibdrm_intel.
For prettiness mayb igt_require_f(false, "Not compiled with libdrm_intel support\n"); or something similar.
-Daniel
Quoted 1,299 lines
Due to the stubbed tests failing with an
igt_require()call, these stubs are not well suited for non-tests, sincetools/benchmarks/etc'skipping' execution is unhelpful.Signed-off-by Robert Foss <[email protected]>--- lib/Makefile.sources | 2 + lib/intel_drm_stubs.c | 258 +++++++++++++ lib/intel_drm_stubs.h | 999 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1259 insertions(+) create mode 100644 lib/intel_drm_stubs.c create mode 100644 lib/intel_drm_stubs.hlib/Makefile.sources +2
-0@@ -21,6 +21,8 @@ libintel_tools_la_SOURCES = \ intel_batchbuffer.c \ intel_batchbuffer.h \ intel_chipset.h \ + intel_drm_stubs.c \ + intel_drm_stubs.h \ intel_os.c \ intel_io.h \ intel_mmio.c \lib/intel_drm_stubs.c new file +258
-0@@ -0,0 +1,258 @@ +#ifndef HAVE_INTEL + +#include "intel_drm_stubs.h" + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init (int fd,int batch_size) +{ +igt_require (false); +return (drm_intel_bufmgr *)NULL ; +} + +void drm_intel_bo_unreference (drm_intel_bo *bo) +{ +igt_require (false); +} + +drm_intel_bo *drm_intel_bo_alloc (drm_intel_bufmgr *bufmgr,const char *name, +unsigned long size,unsigned int alignment) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +int drm_intel_bo_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,const void *data) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_gem_bo_context_exec (drm_intel_bo *bo,drm_intel_context *ctx, +int used,unsigned int flags) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_emit_reloc (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo,uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_emit_reloc_fence (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo, +uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_get_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t * swizzle_mode) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_mrb_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 , +unsigned int flags) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bufmgr_gem_set_aub_annotations (drm_intel_bo *bo, +drm_intel_aub_annotation *annotations, +unsigned count) +{ +igt_require (false); +} + +void drm_intel_bufmgr_gem_enable_reuse (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +} + +int drm_intel_bo_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 ) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bufmgr_destroy (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +} + +void drm_intel_bo_wait_rendering (drm_intel_bo *bo) +{ +igt_require (false); +} + +int drm_intel_bo_get_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,void *data) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_map (drm_intel_bo *bo,int write_enable) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_gem_bo_map_gtt (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bufmgr_gem_enable_fenced_relocs (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +} + +int drm_intel_bo_unmap (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_flink (drm_intel_bo *bo,uint32_t * name) +{ +igt_require (false); +return 0 ; +} + +drm_intel_bo *drm_intel_bo_gem_create_from_name (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned int handle) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +int drm_intel_bo_gem_export_to_prime (drm_intel_bo *bo,int *prime_fd) +{ +igt_require (false); +return 0 ; +} + +drm_intel_bo *drm_intel_bo_gem_create_from_prime (drm_intel_bufmgr *bufmgr, +int prime_fd,int size) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +void drm_intel_bufmgr_gem_set_vma_cache_size (drm_intel_bufmgr *bufmgr, +int limit) +{ +igt_require (false); +} + +int drm_intel_gem_bo_unmap_gtt (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +drm_intel_context *drm_intel_gem_context_create (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +void drm_intel_gem_context_destroy (drm_intel_context *ctx) +{ +igt_require (false); +} + +drm_intel_bo *drm_intel_bo_alloc_tiled (drm_intel_bufmgr *bufmgr, +const char *name, +int x,int y,int cpp, +uint32_t *tiling_mode, +unsigned long *pitch, +unsigned long flags) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +void drm_intel_bufmgr_gem_set_aub_filename (drm_intel_bufmgr *bufmgr, +const char *filename) +{ +igt_require (false); +} + +void drm_intel_bufmgr_gem_set_aub_dump (drm_intel_bufmgr *bufmgr,int enable) +{ +igt_require (false); +} + +void drm_intel_gem_bo_aub_dump_bmp (drm_intel_bo *bo, +int x1,int y1,int width,int height, +enum aub_dump_bmp_format format, +int pitch,int offset) +{ +igt_require (false); +} + +void drm_intel_gem_bo_start_gtt_access (drm_intel_bo *bo,int write_enable) +{ +igt_require (false); +} + +int drm_intel_bo_set_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t stride) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_disable_reuse (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bo_reference (drm_intel_bo *bo) +{ +igt_require (false); +} + +int drm_intel_bufmgr_gem_get_devid (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +return 0 ; +} + +drm_intel_bo *drm_intel_bo_alloc_for_render (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned long size, +unsigned int alignment) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +int drm_intel_bo_references (drm_intel_bo *bo,drm_intel_bo *target_bo) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_gem_bo_wait (drm_intel_bo *bo,int64_t timeout_ns) +{ +igt_require (false); +return 0 ; +} + +#endif //HAVE_INTEL lib/intel_drm_stubs.h new file +999
-0@@ -0,0 +1,999 @@ +#ifndef INTEL_DRM_STUBS_H +#define INTEL_DRM_STUBS_H + +#include <xf86drm.h> + +#include "igt_core.h" + +#ifdef HAVE_INTEL +#include <i915_drm.h> +#include <intel_bufmgr.h> +#include <drm.h> + + +#else +#define i915_execbuffer2_set_context_id (eb2, context) igt_require(false); +#define i915_execbuffer2_get_context_id (eb2) igt_require(false); + +#define I915_EXEC_GEN7_SOL_RESET (1<<8) +#define I915_EXEC_SECURE (1<<9) +#define I915_EXEC_IS_PINNED (1<<10) +#define I915_EXEC_NO_RELOC (1<<11) +#define I915_EXEC_HANDLE_LUT (1<<12) +#define I915_EXEC_BSD_MASK (3<<13) +#define I915_EXEC_BSD_DEFAULT (0<<13)/* default ping-pong mode */ +#define I915_EXEC_BSD_RING1 (1<<13) +#define I915_EXEC_BSD_RING2 (2<<13) + +#define I915_MADV_WILLNEED 0 +#define I915_MADV_DONTNEED 1 + +#define I915_TILING_NONE 0 +#define I915_TILING_X 1 +#define I915_TILING_Y 2 + +#define I915_CACHING_NONE 0 +#define I915_CACHING_CACHED 1 +#define I915_CACHING_DISPLAY 2 + +#define I915_BIT_6_SWIZZLE_NONE 0 +#define I915_BIT_6_SWIZZLE_9 1 +#define I915_BIT_6_SWIZZLE_9_10 2 +#define I915_BIT_6_SWIZZLE_9_11 3 +#define I915_BIT_6_SWIZZLE_9_10_11 4 +#define I915_BIT_6_SWIZZLE_UNKNOWN 5 +#define I915_BIT_6_SWIZZLE_9_17 6 +#define I915_BIT_6_SWIZZLE_9_10_17 7 + +#define I915_PARAM_CHIPSET_ID 4 + +#define I915_PARAM_IRQ_ACTIVE 1 +#define I915_PARAM_ALLOW_BATCHBUFFER 2 +#define I915_PARAM_LAST_DISPATCH 3 +#define I915_PARAM_CHIPSET_ID 4 +#define I915_PARAM_HAS_GEM 5 +#define I915_PARAM_NUM_FENCES_AVAIL 6 +#define I915_PARAM_HAS_OVERLAY 7 +#define I915_PARAM_HAS_PAGEFLIPPING 8 +#define I915_PARAM_HAS_EXECBUF2 9 +#define I915_PARAM_HAS_BSD 10 +#define I915_PARAM_HAS_BLT 11 +#define I915_PARAM_HAS_RELAXED_FENCING 12 +#define I915_PARAM_HAS_COHERENT_RINGS 13 +#define I915_PARAM_HAS_EXEC_CONSTANTS 14 +#define I915_PARAM_HAS_RELAXED_DELTA 15 +#define I915_PARAM_HAS_GEN7_SOL_RESET 16 +#define I915_PARAM_HAS_LLC 17 +#define I915_PARAM_HAS_ALIASING_PPGTT 18 +#define I915_PARAM_HAS_WAIT_TIMEOUT 19 +#define I915_PARAM_HAS_SEMAPHORES 20 +#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 +#define I915_PARAM_HAS_VEBOX 22 +#define I915_PARAM_HAS_SECURE_BATCHES 23 +#define I915_PARAM_HAS_PINNED_BATCHES 24 +#define I915_PARAM_HAS_EXEC_NO_RELOC 25 +#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 +#define I915_PARAM_HAS_WT 27 +#define I915_PARAM_CMD_PARSER_VERSION 28 +#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 +#define I915_PARAM_MMAP_VERSION 30 +#define I915_PARAM_HAS_BSD2 31 +#define I915_PARAM_REVISION 32 +#define I915_PARAM_SUBSLICE_TOTAL 33 +#define I915_PARAM_EU_TOTAL 34 +#define I915_PARAM_HAS_GPU_RESET 35 +#define I915_PARAM_HAS_RESOURCE_STREAMER 36 +#define I915_PARAM_HAS_EXEC_SOFTPIN 37 + +#define I915_GEM_DOMAIN_CPU 0x00000001 +#define I915_GEM_DOMAIN_RENDER 0x00000002 +#define I915_GEM_DOMAIN_SAMPLER 0x00000004 +#define I915_GEM_DOMAIN_COMMAND 0x00000008 +#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010 +#define I915_GEM_DOMAIN_VERTEX 0x00000020 +#define I915_GEM_DOMAIN_GTT 0x00000040 + +#define DRM_I915_INIT 0x00 +#define DRM_I915_FLUSH 0x01 +#define DRM_I915_FLIP 0x02 +#define DRM_I915_BATCHBUFFER 0x03 +#define DRM_I915_IRQ_EMIT 0x04 +#define DRM_I915_IRQ_WAIT 0x05 +#define DRM_I915_GETPARAM 0x06 +#define DRM_I915_SETPARAM 0x07 +#define DRM_I915_ALLOC 0x08 +#define DRM_I915_FREE 0x09 +#define DRM_I915_INIT_HEAP 0x0a +#define DRM_I915_CMDBUFFER 0x0b +#define DRM_I915_DESTROY_HEAP 0x0c +#define DRM_I915_SET_VBLANK_PIPE 0x0d +#define DRM_I915_GET_VBLANK_PIPE 0x0e +#define DRM_I915_VBLANK_SWAP 0x0f +#define DRM_I915_HWS_ADDR 0x11 +#define DRM_I915_GEM_INIT 0x13 +#define DRM_I915_GEM_EXECBUFFER 0x14 +#define DRM_I915_GEM_PIN 0x15 +#define DRM_I915_GEM_UNPIN 0x16 +#define DRM_I915_GEM_BUSY 0x17 +#define DRM_I915_GEM_THROTTLE 0x18 +#define DRM_I915_GEM_ENTERVT 0x19 +#define DRM_I915_GEM_LEAVEVT 0x1a +#define DRM_I915_GEM_CREATE 0x1b +#define DRM_I915_GEM_PREAD 0x1c +#define DRM_I915_GEM_PWRITE 0x1d +#define DRM_I915_GEM_MMAP 0x1e +#define DRM_I915_GEM_SET_DOMAIN 0x1f +#define DRM_I915_GEM_SW_FINISH 0x20 +#define DRM_I915_GEM_SET_TILING 0x21 +#define DRM_I915_GEM_GET_TILING 0x22 +#define DRM_I915_GEM_GET_APERTURE 0x23 +#define DRM_I915_GEM_MMAP_GTT 0x24 +#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 +#define DRM_I915_GEM_MADVISE 0x26 +#define DRM_I915_OVERLAY_PUT_IMAGE 0x27 +#define DRM_I915_OVERLAY_ATTRS 0x28 +#define DRM_I915_GEM_EXECBUFFER2 0x29 +#define DRM_I915_GET_SPRITE_COLORKEY 0x2a +#define DRM_I915_SET_SPRITE_COLORKEY 0x2b +#define DRM_I915_GEM_WAIT 0x2c +#define DRM_I915_GEM_CONTEXT_CREATE 0x2d +#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e +#define DRM_I915_GEM_SET_CACHING 0x2f +#define DRM_I915_GEM_GET_CACHING 0x30 +#define DRM_I915_REG_READ 0x31 +#define DRM_I915_GET_RESET_STATS 0x32 +#define DRM_I915_GEM_USERPTR 0x33 +#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 +#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 + +#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) +#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) +#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) +#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) +#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) +#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) +#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) +#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) +#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) +#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) +#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) +#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) +#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t) +#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) +#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) +#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) +#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init) +#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) +#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) +#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) +#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) +#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) +#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) +#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching) +#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching) +#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE) +#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT) +#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT) +#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create) +#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread) +#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite) +#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap) +#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt) +#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain) +#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) +#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) +#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) +#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) +#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) +#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) +#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) +#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) +#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) +#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) +#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) +#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) +#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) +#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) +#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) +#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) + +enum aub_dump_bmp_format { +AUB_DUMP_BMP_FORMAT_8BIT =1 , +AUB_DUMP_BMP_FORMAT_ARGB_4444 =4 , +AUB_DUMP_BMP_FORMAT_ARGB_0888 =6 , +AUB_DUMP_BMP_FORMAT_ARGB_8888 =7 , +}; + +typedef struct _drm_intel_bo drm_intel_bo ; +typedef struct _drm_intel_bufmgr drm_intel_bufmgr ; +typedef struct _drm_intel_context drm_intel_context ; + +struct _drm_intel_context { +unsigned int ctx_id; +struct _drm_intel_bufmgr *bufmgr; +}; + +struct _drm_intel_bufmgr { +/** +* Allocate a buffer object. +* +* Buffer objects are not necessarily initially mapped into CPU virtual +* address space or graphics device aperture. They must be mapped +* using bo_map() or drm_intel_gem_bo_map_gtt() to be used by the CPU. +*/ +drm_intel_bo *(*bo_alloc) (drm_intel_bufmgr *bufmgr,const char *name, +unsigned long size,unsigned int alignment); + +/** +* Allocate a buffer object, hinting that it will be used as a +* render target. +* +* This is otherwise the same as bo_alloc. +*/ +drm_intel_bo *(*bo_alloc_for_render) (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned long size, +unsigned int alignment); + +/** +* Allocate a buffer object from an existing user accessible +* address malloc'd with the provided size. +* Alignment is used when mapping to the gtt. +* Flags may be I915_VMAP_READ_ONLY or I915_USERPTR_UNSYNCHRONIZED +*/ +drm_intel_bo *(*bo_alloc_userptr)(drm_intel_bufmgr *bufmgr, +const char *name,void *addr, +uint32_t tiling_mode,uint32_t stride, +unsigned long size, +unsigned long flags); + +/** +* Allocate a tiled buffer object. +* +* Alignment for tiled objects is set automatically; the 'flags' +* argument provides a hint about how the object will be used initially. +* +* Valid tiling formats are: +* I915_TILING_NONE +* I915_TILING_X +* I915_TILING_Y +* +* Note the tiling format may be rejected; callers should check the +* 'tiling_mode' field on return, as well as the pitch value, which +* may have been rounded up to accommodate for tiling restrictions. +*/ +drm_intel_bo *(*bo_alloc_tiled) (drm_intel_bufmgr *bufmgr, +const char *name, +int x,int y,int cpp, +uint32_t *tiling_mode, +unsigned long *pitch, +unsigned long flags); + +/** Takes a reference on a buffer object */ +void (*bo_reference) (drm_intel_bo *bo); + +/** +* Releases a reference on a buffer object, freeing the data if +* no references remain. +*/ +void (*bo_unreference) (drm_intel_bo *bo); + +/** +* Maps the buffer into userspace. +* +* This function will block waiting for any existing execution on the +* buffer to complete, first. The resulting mapping is available at +* buf->virtual. +*/ +int (*bo_map) (drm_intel_bo *bo,int write_enable); + +/** +* Reduces the refcount on the userspace mapping of the buffer +* object. +*/ +int (*bo_unmap) (drm_intel_bo *bo); + +/** +* Write data into an object. +* +* This is an optional function, if missing, +* drm_intel_bo will map/memcpy/unmap. +*/ +int (*bo_subdata) (drm_intel_bo *bo,unsigned long offset, +unsigned long size,const void *data); + +/** +* Read data from an object +* +* This is an optional function, if missing, +* drm_intel_bo will map/memcpy/unmap. +*/ +int (*bo_get_subdata) (drm_intel_bo *bo,unsigned long offset, +unsigned long size,void *data); + +/** +* Waits for rendering to an object by the GPU to have completed. +* +* This is not required for any access to the BO by bo_map, +* bo_subdata, etc. It is merely a way for the driver to implement +* glFinish. +*/ +void (*bo_wait_rendering) (drm_intel_bo *bo); + +/** +* Tears down the buffer manager instance. +*/ +void (*destroy) (drm_intel_bufmgr *bufmgr); + +/** +* Indicate if the buffer can be placed anywhere in the full ppgtt +* address range (2^48). +* +* Any resource used with flat/heapless (0x00000000-0xfffff000) +* General State Heap (GSH) or Intructions State Heap (ISH) must +* be in a 32-bit range. 48-bit range will only be used when explicitly +* requested. +* +* \param bo Buffer to set the use_48b_address_range flag. +* \param enable The flag value. +*/ +void (*bo_use_48b_address_range) (drm_intel_bo *bo,uint32_t enable); + +/** +* Add relocation entry in reloc_buf, which will be updated with the +* target buffer's real offset on on command submission. +* +* Relocations remain in place for the lifetime of the buffer object. +* +* \param bo Buffer to write the relocation into. +* \param offset Byte offset within reloc_bo of the pointer to +* target_bo. +* \param target_bo Buffer whose offset should be written into the +* relocation entry. +* \param target_offset Constant value to be added to target_bo's +* offset in relocation entry. +* \param read_domains GEM read domains which the buffer will be +* read into by the command that this relocation +* is part of. +* \param write_domains GEM read domains which the buffer will be +* dirtied in by the command that this +* relocation is part of. +*/ +int (*bo_emit_reloc) (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo,uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain); +int (*bo_emit_reloc_fence)(drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo, +uint32_t target_offset, +uint32_t read_domains, +uint32_t write_domain); + +/** Executes the command buffer pointed to by bo. */ +int (*bo_exec) (drm_intel_bo *bo,int used, +drm_clip_rect_t *cliprects,int num_cliprects, +int DR4 ); + +/** Executes the command buffer pointed to by bo on the selected +* ring buffer +*/ +int (*bo_mrb_exec) (drm_intel_bo *bo,int used, +drm_clip_rect_t *cliprects,int num_cliprects, +int DR4 ,unsigned flags); + +/** +* Pin a buffer to the aperture and fix the offset until unpinned +* +* \param buf Buffer to pin +* \param alignment Required alignment for aperture, in bytes +*/ +int (*bo_pin) (drm_intel_bo *bo,uint32_t alignment); + +/** +* Unpin a buffer from the aperture, allowing it to be removed +* +* \param buf Buffer to unpin +*/ +int (*bo_unpin) (drm_intel_bo *bo); + +/** +* Ask that the buffer be placed in tiling mode +* +* \param buf Buffer to set tiling mode for +* \param tiling_mode desired, and returned tiling mode +*/ +int (*bo_set_tiling) (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t stride); + +/** +* Get the current tiling (and resulting swizzling) mode for the bo. +* +* \param buf Buffer to get tiling mode for +* \param tiling_mode returned tiling mode +* \param swizzle_mode returned swizzling mode +*/ +int (*bo_get_tiling) (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t * swizzle_mode); + +/** +* Set the offset at which this buffer will be softpinned +* \param bo Buffer to set the softpin offset for +* \param offset Softpin offset +*/ +int (*bo_set_softpin_offset) (drm_intel_bo *bo,uint64_t offset); + +/** +* Create a visible name for a buffer which can be used by other apps +* +* \param buf Buffer to create a name for +* \param name Returned name +*/ +int (*bo_flink) (drm_intel_bo *bo,uint32_t * name); + +/** +* Returns 1 if mapping the buffer for write could cause the process +* to block, due to the object being active in the GPU. +*/ +int (*bo_busy) (drm_intel_bo *bo); + +/** +* Specify the volatility of the buffer. +* \param bo Buffer to create a name for +* \param madv The purgeable status +* +* Use I915_MADV_DONTNEED to mark the buffer as purgeable, and it will be +* reclaimed under memory pressure. If you subsequently require the buffer, +* then you must pass I915_MADV_WILLNEED to mark the buffer as required. +* +* Returns 1 if the buffer was retained, or 0 if it was discarded whilst +* marked as I915_MADV_DONTNEED. +*/ +int (*bo_madvise) (drm_intel_bo *bo,int madv); + +int (*check_aperture_space) (drm_intel_bo ** bo_array,int count); + +/** +* Disable buffer reuse for buffers which will be shared in some way, +* as with scanout buffers. When the buffer reference count goes to +* zero, it will be freed and not placed in the reuse list. +* +* \param bo Buffer to disable reuse for +*/ +int (*bo_disable_reuse) (drm_intel_bo *bo); + +/** +* Query whether a buffer is reusable. +* +* \param bo Buffer to query +*/ +int (*bo_is_reusable) (drm_intel_bo *bo); + +/** +* +* Return the pipe associated with a crtc_id so that vblank +* synchronization can use the correct data in the request. +* This is only supported for KMS and gem at this point, when +* unsupported, this function returns -1 and leaves the decision +* of what to do in that case to the caller +* +* \param bufmgr the associated buffer manager +* \param crtc_id the crtc identifier +*/ +int (*get_pipe_from_crtc_id) (drm_intel_bufmgr *bufmgr,int crtc_id); + +/** Returns true if target_bo is in the relocation tree rooted at bo. */ +int (*bo_references) (drm_intel_bo *bo,drm_intel_bo *target_bo); + +/**< Enables verbose debugging printouts */ +int debug; +}; + +struct _drm_intel_bo { +/** +* Size in bytes of the buffer object. +* +* The size may be larger than the size originally requested for the +* allocation, such as being aligned to page size. +*/ +unsigned long size; + +/** +* Alignment requirement for object +* +* Used for GTT mapping & pinning the object. +*/ +unsigned long align; + +/** +* Deprecated field containing (possibly the low 32-bits of) the last +* seen virtual card address. Use offset64 instead. +*/ +unsigned long offset; + +/** +* Virtual address for accessing the buffer data. Only valid while +* mapped. +*/ +#ifdef __cplusplus +void *virt; +#else +void *virtual; +#endif + +/** Buffer manager context associated with this buffer object */ +drm_intel_bufmgr *bufmgr; + +/** +* MM-specific handle for accessing object +*/ +int handle; + +/** +* Last seen card virtual address (offset from the beginning of the +* aperture) for the object. This should be used to fill relocation +* entries when calling drm_intel_bo_emit_reloc() +*/ +uint64_t offset64; +}; + +typedef struct drm_i915_getparam { +__s32 param; +/* +* WARNING: Using pointers instead of fixed-size u64 means we need to write +* compat32 code. Don't repeat this mistake. +*/ +int *value; +}drm_i915_getparam_t ; + +struct drm_i915_gem_execbuffer2 { +/** +* List of gem_exec_object2 structs +*/ +__u64 buffers_ptr; +__u32 buffer_count; + +/** Offset in the batchbuffer to start execution from. */ +__u32 batch_start_offset; +/** Bytes used in batchbuffer from batch_start_offset */ +__u32 batch_len; +__u32 DR1; +__u32 DR4; +__u32 num_cliprects; +/** This is a struct drm_clip_rect *cliprects */ +__u64 cliprects_ptr; +#define I915_EXEC_RING_MASK (7<<0) +#define I915_EXEC_DEFAULT (0<<0) +#define I915_EXEC_RENDER (1<<0) +#define I915_EXEC_BSD (2<<0) +#define I915_EXEC_BLT (3<<0) +#define I915_EXEC_VEBOX (4<<0) + +/* Used for switching the constants addressing mode on gen4+ RENDER ring. +* Gen6+ only supports relative addressing to dynamic state (default) and +* absolute addressing. +* +* These flags are ignored for the BSD and BLT rings. +*/ +#define I915_EXEC_CONSTANTS_MASK (3<<6) +#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6)/* default */ +#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) +#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6)/* gen4/5 only */ +__u64 flags; +__u64 rsvd1;/* now used for context info */ +__u64 rsvd2; +}; + +struct drm_i915_gem_exec_object2 { +/** +* User's handle for a buffer to be bound into the GTT for this +* operation. +*/ +__u32 handle; + +/** Number of relocations to be performed on this buffer */ +__u32 relocation_count; +/** +* Pointer to array of struct drm_i915_gem_relocation_entry containing +* the relocations to be performed in this buffer. +*/ +__u64 relocs_ptr; + +/** Required alignment in graphics aperture */ +__u64 alignment; + +/** +* When the EXEC_OBJECT_PINNED flag is specified this is populated by +* the user with the GTT offset at which this object will be pinned. +* When the I915_EXEC_NO_RELOC flag is specified this must contain the +* presumed_offset of the object. +* During execbuffer2 the kernel populates it with the value of the +* current GTT offset of the object, for future presumed_offset writes. +*/ +__u64 offset; + +#define EXEC_OBJECT_NEEDS_FENCE (1<<0) +#define EXEC_OBJECT_NEEDS_GTT (1<<1) +#define EXEC_OBJECT_WRITE (1<<2) +#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3) +#define EXEC_OBJECT_PINNED (1<<4) +#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PINNED<<1) +__u64 flags; + +__u64 rsvd1; +__u64 rsvd2; +}; + +struct drm_i915_gem_relocation_entry { +/** +* Handle of the buffer being pointed to by this relocation entry. +* +* It's appealing to make this be an index into the mm_validate_entry +* list to refer to the buffer, but this allows the driver to create +* a relocation list for state buffers and not re-write it per +* exec using the buffer. +*/ +__u32 target_handle; + +/** +* Value to be added to the offset of the target buffer to make up +* the relocation entry. +*/ +__u32 delta; + +/** Offset in the buffer the relocation entry will be written into */ +__u64 offset; + +/** +* Offset value of the target buffer that the relocation entry was last +* written as. +* +* If the buffer has the same offset as last time, we can skip syncing +* and writing the relocation. This value is written back out by +* the execbuffer ioctl when the relocation is written. +*/ +__u64 presumed_offset; + +/** +* Target memory domains read by this operation. +*/ +__u32 read_domains; + +/** +* Target memory domains written by this operation. +* +* Note that only one domain may be written by the whole +* execbuffer operation, so that where there are conflicts, +* the application will get -EINVAL back. +*/ +__u32 write_domain; +}; + +struct drm_i915_gem_get_tiling { +/** Handle of the buffer to get tiling state for. */ +__u32 handle; + +/** +* Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X, +* I915_TILING_Y). +*/ +__u32 tiling_mode; + +/** +* Returned address bit 6 swizzling required for CPU access through +* mmap mapping. +*/ +__u32 swizzle_mode; + +/** +* Returned address bit 6 swizzling required for CPU access through +* mmap mapping whilst bound. +*/ +__u32 phys_swizzle_mode; +}; + +struct drm_i915_gem_set_tiling { +/** Handle of the buffer to have its tiling state updated */ +__u32 handle; + +/** +* Tiling mode for the object (I915_TILING_NONE, I915_TILING_X, +* I915_TILING_Y). +* +* This value is to be set on request, and will be updated by the +* kernel on successful return with the actual chosen tiling layout. +* +* The tiling mode may be demoted to I915_TILING_NONE when the system +* has bit 6 swizzling that can't be managed correctly by GEM. +* +* Buffer contents become undefined when changing tiling_mode. +*/ +__u32 tiling_mode; + +/** +* Stride in bytes for the object when in I915_TILING_X or +* I915_TILING_Y. +*/ +__u32 stride; + +/** +* Returned address bit 6 swizzling required for CPU access through +* mmap mapping. +*/ +__u32 swizzle_mode; +}; + +struct drm_i915_gem_pwrite { +/** Handle for the object being written to. */ +__u32 handle; +__u32 pad; +/** Offset into the object to write to */ +__u64 offset; +/** Length of data to write */ +__u64 size; +/** +* Pointer to read the data from. +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 data_ptr; +}; + +struct drm_i915_gem_pread { +/** Handle for the object being read. */ +__u32 handle; +__u32 pad; +/** Offset into the object to read from */ +__u64 offset; +/** Length of data to read */ +__u64 size; +/** +* Pointer to write the data into. +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 data_ptr; +}; + +struct drm_i915_gem_set_domain { +/** Handle for the object */ +__u32 handle; + +/** New read domains */ +__u32 read_domains; + +/** New write domain */ +__u32 write_domain; +}; + +struct drm_i915_gem_wait { +/** Handle of BO we shall wait on */ +__u32 bo_handle; +__u32 flags; +/** Number of nanoseconds to wait, Returns time remaining. */ +__s64 timeout_ns; +}; + +struct drm_i915_gem_busy { +/** Handle of the buffer to check for busy */ +__u32 handle; + +/** Return busy status (1 if busy, 0 if idle). +* The high word is used to indicate on which rings the object +* currently resides: +* 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc) +*/ +__u32 busy; +}; + +struct drm_i915_gem_get_aperture { +/** Total size of the aperture used by i915_gem_execbuffer, in bytes */ +__u64 aper_size; + +/** +* Available space in the aperture used by i915_gem_execbuffer, in +* bytes +*/ +__u64 aper_available_size; +}; + +struct drm_i915_gem_create { +/** +* Requested size for the object. +* +* The (page-aligned) allocated size for the object will be returned. +*/ +__u64 size; +/** +* Returned handle for the object. +* +* Object handles are nonzero. +*/ +__u32 handle; +__u32 pad; +}; + +struct drm_i915_gem_mmap_gtt { +/** Handle for the object being mapped. */ +__u32 handle; +__u32 pad; +/** +* Fake offset to use for subsequent mmap call +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 offset; +}; + +struct drm_i915_gem_sw_finish { +/** Handle for the object */ +__u32 handle; +}; + +struct drm_i915_gem_mmap { +/** Handle for the object being mapped. */ +__u32 handle; +__u32 pad; +/** Offset in the object to map. */ +__u64 offset; +/** +* Length of data to map. +* +* The value will be page-aligned. +*/ +__u64 size; +/** +* Returned pointer the data was mapped at. +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 addr_ptr; + +/** +* Flags for extended behaviour. +* +* Added in version 2. +*/ +__u64 flags; +#define I915_MMAP_WC 0x1 +}; + +struct drm_i915_gem_madvise { +/** Handle of the buffer to change the backing store advice */ +__u32 handle; + +/* Advice: either the buffer will be needed again in the near future, +* or wont be and could be discarded under memory pressure. +*/ +__u32 madv; + +/** Whether the backing store still exists. */ +__u32 retained; +}; + +struct drm_i915_gem_context_create { +/* output: id of new context*/ +__u32 ctx_id; +__u32 pad; +}; + +struct drm_i915_gem_context_destroy { +__u32 ctx_id; +__u32 pad; +}; + +typedef struct _drm_intel_aub_annotation { +uint32_t type; +uint32_t subtype; +uint32_t ending_offset; +}drm_intel_aub_annotation ; + +struct drm_i915_gem_pin { +/** Handle of the buffer to be pinned. */ +__u32 handle; +__u32 pad; + +/** alignment required within the aperture */ +__u64 alignment; + +/** Returned GTT offset of the buffer. */ +__u64 offset; +}; + +#define I915_SET_COLORKEY_NONE (1<<0)/* disable color key matching */ +#define I915_SET_COLORKEY_DESTINATION (1<<1) +#define I915_SET_COLORKEY_SOURCE (1<<2) +struct drm_intel_sprite_colorkey { +__u32 plane_id; +__u32 min_value; +__u32 channel_mask; +__u32 max_value; +__u32 flags; +}; + +struct drm_i915_reg_read { +/* +* Register offset. +* For 64bit wide registers where the upper 32bits don't immediately +* follow the lower 32bits, the offset of the lower 32bits must +* be specified +*/ +__u64 offset; +__u64 val;/* Return value */ +}; + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init (int fd,int batch_size); +void drm_intel_bo_unreference (drm_intel_bo *bo); +drm_intel_bo *drm_intel_bo_alloc (drm_intel_bufmgr *bufmgr,const char *name, +unsigned long size,unsigned int alignment); +int drm_intel_bo_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,const void *data); +int drm_intel_gem_bo_context_exec (drm_intel_bo *bo,drm_intel_context *ctx, +int used,unsigned int flags); +int drm_intel_bo_emit_reloc (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo,uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain); +int drm_intel_bo_emit_reloc_fence (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo, +uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain); +int drm_intel_bo_get_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t * swizzle_mode); +int drm_intel_bo_mrb_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 , +unsigned int flags); +void drm_intel_bufmgr_gem_set_aub_annotations (drm_intel_bo *bo, +drm_intel_aub_annotation *annotations, +unsigned count); +void drm_intel_bufmgr_gem_enable_reuse (drm_intel_bufmgr *bufmgr); +int drm_intel_bo_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 ); +void drm_intel_bufmgr_destroy (drm_intel_bufmgr *bufmgr); +void drm_intel_bo_wait_rendering (drm_intel_bo *bo); +int drm_intel_bo_get_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,void *data); +int drm_intel_bo_map (drm_intel_bo *bo,int write_enable); +int drm_intel_gem_bo_map_gtt (drm_intel_bo *bo); +void drm_intel_bufmgr_gem_enable_fenced_relocs (drm_intel_bufmgr *bufmgr); +int drm_intel_bo_unmap (drm_intel_bo *bo); +int drm_intel_bo_flink (drm_intel_bo *bo,uint32_t * name); +drm_intel_bo *drm_intel_bo_gem_create_from_name (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned int handle); +int drm_intel_bo_gem_export_to_prime (drm_intel_bo *bo,int *prime_fd); +drm_intel_bo *drm_intel_bo_gem_create_from_prime (drm_intel_bufmgr *bufmgr, +int prime_fd,int size); +void drm_intel_bufmgr_gem_set_vma_cache_size (drm_intel_bufmgr *bufmgr, +int limit); +int drm_intel_gem_bo_unmap_gtt (drm_intel_bo *bo); +drm_intel_context *drm_intel_gem_context_create (drm_intel_bufmgr *bufmgr); +void drm_intel_gem_context_destroy (drm_intel_context *ctx); +drm_intel_bo *drm_intel_bo_alloc_tiled (drm_intel_bufmgr *bufmgr, +const char *name, +int x,int y,int cpp, +uint32_t *tiling_mode, +unsigned long *pitch, +unsigned long flags); +void drm_intel_bufmgr_gem_set_aub_filename (drm_intel_bufmgr *bufmgr, +const char *filename); +void drm_intel_bufmgr_gem_set_aub_dump (drm_intel_bufmgr *bufmgr,int enable); +void drm_intel_gem_bo_aub_dump_bmp (drm_intel_bo *bo, +int x1,int y1,int width,int height, +enum aub_dump_bmp_format format, +int pitch,int offset); +void drm_intel_gem_bo_start_gtt_access (drm_intel_bo *bo,int write_enable); +int drm_intel_bo_set_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t stride); +int drm_intel_bo_disable_reuse (drm_intel_bo *bo); +void drm_intel_bo_reference (drm_intel_bo *bo); +int drm_intel_bufmgr_gem_get_devid (drm_intel_bufmgr *bufmgr); +drm_intel_bo *drm_intel_bo_alloc_for_render (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned long size, +unsigned int alignment); +int drm_intel_bo_references (drm_intel_bo *bo,drm_intel_bo *target_bo); +int drm_intel_gem_bo_wait (drm_intel_bo *bo,int64_t timeout_ns); + +#endif + +#endif //INTEL_DRM_STUBS_H Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 7/9] lib/intel_drm_stubs: Add stubs for functionality from libdrm_intel.
Quoted 11 lines · Daniel Vetter
Quoted 6 lines · On Fri, May 20, 2016 at 06:59:31PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
This patch provides stubs for functionality otherwise provided by
libdrm_intel.The stubbed functions all fail with a call to
igt_require(false). Defines and enums have been copied fromlibdrm_intel.For prettiness mayb
igt_require_f(false, "Not compiled with libdrm_intel support\n"); or something similar.
-Daniel
Ack, added in v2.
Rob.
Quoted 1,292 lines
Quoted 1,292 lines
Due to the stubbed tests failing with an
igt_require()call, these stubs are not well suited for non-tests, sincetools/benchmarks/etc'skipping' execution is unhelpful.Signed-off-by Robert Foss <[email protected]>--- lib/Makefile.sources | 2 + lib/intel_drm_stubs.c | 258 +++++++++++++ lib/intel_drm_stubs.h | 999 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1259 insertions(+)create mode 100644
lib/intel_drm_stubs.c
create mode 100644lib/intel_drm_stubs.hlib/Makefile.sources +2
-0@@ -21,6 +21,8 @@ libintel_tools_la_SOURCES = \ intel_batchbuffer.c \ intel_batchbuffer.h \ intel_chipset.h \ + intel_drm_stubs.c \ + intel_drm_stubs.h \ intel_os.c \ intel_io.h \ intel_mmio.c \lib/intel_drm_stubs.c new file +258
-0@@ -0,0 +1,258 @@ +#ifndef HAVE_INTEL + +#include "intel_drm_stubs.h" + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init (int fd,int batch_size) +{ +igt_require (false); +return (drm_intel_bufmgr *)NULL ; +} + +void drm_intel_bo_unreference (drm_intel_bo *bo) +{ +igt_require (false); +} + +drm_intel_bo *drm_intel_bo_alloc (drm_intel_bufmgr *bufmgr,const char *name, +unsigned long size,unsigned int alignment) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +int drm_intel_bo_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,const void *data) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_gem_bo_context_exec (drm_intel_bo *bo,drm_intel_context *ctx, +int used,unsigned int flags) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_emit_reloc (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo,uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_emit_reloc_fence (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo, +uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_get_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t * swizzle_mode) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_mrb_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 , +unsigned int flags) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bufmgr_gem_set_aub_annotations (drm_intel_bo *bo, +drm_intel_aub_annotation *annotations, +unsigned count) +{ +igt_require (false); +} + +void drm_intel_bufmgr_gem_enable_reuse (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +} + +int drm_intel_bo_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 ) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bufmgr_destroy (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +} + +void drm_intel_bo_wait_rendering (drm_intel_bo *bo) +{ +igt_require (false); +} + +int drm_intel_bo_get_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,void *data) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_map (drm_intel_bo *bo,int write_enable) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_gem_bo_map_gtt (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bufmgr_gem_enable_fenced_relocs (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +} + +int drm_intel_bo_unmap (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_flink (drm_intel_bo *bo,uint32_t * name) +{ +igt_require (false); +return 0 ; +} + +drm_intel_bo *drm_intel_bo_gem_create_from_name (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned int handle) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +int drm_intel_bo_gem_export_to_prime (drm_intel_bo *bo,int *prime_fd) +{ +igt_require (false); +return 0 ; +} + +drm_intel_bo *drm_intel_bo_gem_create_from_prime (drm_intel_bufmgr *bufmgr, +int prime_fd,int size) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +void drm_intel_bufmgr_gem_set_vma_cache_size (drm_intel_bufmgr *bufmgr, +int limit) +{ +igt_require (false); +} + +int drm_intel_gem_bo_unmap_gtt (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +drm_intel_context *drm_intel_gem_context_create (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +void drm_intel_gem_context_destroy (drm_intel_context *ctx) +{ +igt_require (false); +} + +drm_intel_bo *drm_intel_bo_alloc_tiled (drm_intel_bufmgr *bufmgr, +const char *name, +int x,int y,int cpp, +uint32_t *tiling_mode, +unsigned long *pitch, +unsigned long flags) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +void drm_intel_bufmgr_gem_set_aub_filename (drm_intel_bufmgr *bufmgr, +const char *filename) +{ +igt_require (false); +} + +void drm_intel_bufmgr_gem_set_aub_dump (drm_intel_bufmgr *bufmgr,int enable) +{ +igt_require (false); +} + +void drm_intel_gem_bo_aub_dump_bmp (drm_intel_bo *bo, +int x1,int y1,int width,int height, +enum aub_dump_bmp_format format, +int pitch,int offset) +{ +igt_require (false); +} + +void drm_intel_gem_bo_start_gtt_access (drm_intel_bo *bo,int write_enable) +{ +igt_require (false); +} + +int drm_intel_bo_set_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t stride) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_bo_disable_reuse (drm_intel_bo *bo) +{ +igt_require (false); +return 0 ; +} + +void drm_intel_bo_reference (drm_intel_bo *bo) +{ +igt_require (false); +} + +int drm_intel_bufmgr_gem_get_devid (drm_intel_bufmgr *bufmgr) +{ +igt_require (false); +return 0 ; +} + +drm_intel_bo *drm_intel_bo_alloc_for_render (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned long size, +unsigned int alignment) +{ +igt_require (false); +return (drm_intel_bo *)NULL ; +} + +int drm_intel_bo_references (drm_intel_bo *bo,drm_intel_bo *target_bo) +{ +igt_require (false); +return 0 ; +} + +int drm_intel_gem_bo_wait (drm_intel_bo *bo,int64_t timeout_ns) +{ +igt_require (false); +return 0 ; +} + +#endif //HAVE_INTEL lib/intel_drm_stubs.h new file +994
-0@@ -0,0 +1,999 @@ +#ifndef INTEL_DRM_STUBS_H +#define INTEL_DRM_STUBS_H + +#include <xf86drm.h> + +#include "igt_core.h" + +#ifdef HAVE_INTEL +#include <i915_drm.h> +#include <intel_bufmgr.h> +#include <drm.h> + + +#else +#define i915_execbuffer2_set_context_id (eb2, context) igt_require(false); +#define i915_execbuffer2_get_context_id (eb2) igt_require(false); + +#define I915_EXEC_GEN7_SOL_RESET (1<<8) +#define I915_EXEC_SECURE (1<<9) +#define I915_EXEC_IS_PINNED (1<<10) +#define I915_EXEC_NO_RELOC (1<<11) +#define I915_EXEC_HANDLE_LUT (1<<12) +#define I915_EXEC_BSD_MASK (3<<13) +#define I915_EXEC_BSD_DEFAULT (0<<13)/* default ping-pong mode */ +#define I915_EXEC_BSD_RING1 (1<<13) +#define I915_EXEC_BSD_RING2 (2<<13) + +#define I915_MADV_WILLNEED 0 +#define I915_MADV_DONTNEED 1 + +#define I915_TILING_NONE 0 +#define I915_TILING_X 1 +#define I915_TILING_Y 2 + +#define I915_CACHING_NONE 0 +#define I915_CACHING_CACHED 1 +#define I915_CACHING_DISPLAY 2 + +#define I915_BIT_6_SWIZZLE_NONE 0 +#define I915_BIT_6_SWIZZLE_9 1 +#define I915_BIT_6_SWIZZLE_9_10 2 +#define I915_BIT_6_SWIZZLE_9_11 3 +#define I915_BIT_6_SWIZZLE_9_10_11 4 +#define I915_BIT_6_SWIZZLE_UNKNOWN 5 +#define I915_BIT_6_SWIZZLE_9_17 6 +#define I915_BIT_6_SWIZZLE_9_10_17 7 + +#define I915_PARAM_CHIPSET_ID 4 + +#define I915_PARAM_IRQ_ACTIVE 1 +#define I915_PARAM_ALLOW_BATCHBUFFER 2 +#define I915_PARAM_LAST_DISPATCH 3 +#define I915_PARAM_CHIPSET_ID 4 +#define I915_PARAM_HAS_GEM 5 +#define I915_PARAM_NUM_FENCES_AVAIL 6 +#define I915_PARAM_HAS_OVERLAY 7 +#define I915_PARAM_HAS_PAGEFLIPPING 8 +#define I915_PARAM_HAS_EXECBUF2 9 +#define I915_PARAM_HAS_BSD 10 +#define I915_PARAM_HAS_BLT 11 +#define I915_PARAM_HAS_RELAXED_FENCING 12 +#define I915_PARAM_HAS_COHERENT_RINGS 13 +#define I915_PARAM_HAS_EXEC_CONSTANTS 14 +#define I915_PARAM_HAS_RELAXED_DELTA 15 +#define I915_PARAM_HAS_GEN7_SOL_RESET 16 +#define I915_PARAM_HAS_LLC 17 +#define I915_PARAM_HAS_ALIASING_PPGTT 18 +#define I915_PARAM_HAS_WAIT_TIMEOUT 19 +#define I915_PARAM_HAS_SEMAPHORES 20 +#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 +#define I915_PARAM_HAS_VEBOX 22 +#define I915_PARAM_HAS_SECURE_BATCHES 23 +#define I915_PARAM_HAS_PINNED_BATCHES 24 +#define I915_PARAM_HAS_EXEC_NO_RELOC 25 +#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 +#define I915_PARAM_HAS_WT 27 +#define I915_PARAM_CMD_PARSER_VERSION 28 +#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 +#define I915_PARAM_MMAP_VERSION 30 +#define I915_PARAM_HAS_BSD2 31 +#define I915_PARAM_REVISION 32 +#define I915_PARAM_SUBSLICE_TOTAL 33 +#define I915_PARAM_EU_TOTAL 34 +#define I915_PARAM_HAS_GPU_RESET 35 +#define I915_PARAM_HAS_RESOURCE_STREAMER 36 +#define I915_PARAM_HAS_EXEC_SOFTPIN 37 + +#define I915_GEM_DOMAIN_CPU 0x00000001 +#define I915_GEM_DOMAIN_RENDER 0x00000002 +#define I915_GEM_DOMAIN_SAMPLER 0x00000004 +#define I915_GEM_DOMAIN_COMMAND 0x00000008 +#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010 +#define I915_GEM_DOMAIN_VERTEX 0x00000020 +#define I915_GEM_DOMAIN_GTT 0x00000040 + +#define DRM_I915_INIT 0x00 +#define DRM_I915_FLUSH 0x01 +#define DRM_I915_FLIP 0x02 +#define DRM_I915_BATCHBUFFER 0x03 +#define DRM_I915_IRQ_EMIT 0x04 +#define DRM_I915_IRQ_WAIT 0x05 +#define DRM_I915_GETPARAM 0x06 +#define DRM_I915_SETPARAM 0x07 +#define DRM_I915_ALLOC 0x08 +#define DRM_I915_FREE 0x09 +#define DRM_I915_INIT_HEAP 0x0a +#define DRM_I915_CMDBUFFER 0x0b +#define DRM_I915_DESTROY_HEAP 0x0c +#define DRM_I915_SET_VBLANK_PIPE 0x0d +#define DRM_I915_GET_VBLANK_PIPE 0x0e +#define DRM_I915_VBLANK_SWAP 0x0f +#define DRM_I915_HWS_ADDR 0x11 +#define DRM_I915_GEM_INIT 0x13 +#define DRM_I915_GEM_EXECBUFFER 0x14 +#define DRM_I915_GEM_PIN 0x15 +#define DRM_I915_GEM_UNPIN 0x16 +#define DRM_I915_GEM_BUSY 0x17 +#define DRM_I915_GEM_THROTTLE 0x18 +#define DRM_I915_GEM_ENTERVT 0x19 +#define DRM_I915_GEM_LEAVEVT 0x1a +#define DRM_I915_GEM_CREATE 0x1b +#define DRM_I915_GEM_PREAD 0x1c +#define DRM_I915_GEM_PWRITE 0x1d +#define DRM_I915_GEM_MMAP 0x1e +#define DRM_I915_GEM_SET_DOMAIN 0x1f +#define DRM_I915_GEM_SW_FINISH 0x20 +#define DRM_I915_GEM_SET_TILING 0x21 +#define DRM_I915_GEM_GET_TILING 0x22 +#define DRM_I915_GEM_GET_APERTURE 0x23 +#define DRM_I915_GEM_MMAP_GTT 0x24 +#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 +#define DRM_I915_GEM_MADVISE 0x26 +#define DRM_I915_OVERLAY_PUT_IMAGE 0x27 +#define DRM_I915_OVERLAY_ATTRS 0x28 +#define DRM_I915_GEM_EXECBUFFER2 0x29 +#define DRM_I915_GET_SPRITE_COLORKEY 0x2a +#define DRM_I915_SET_SPRITE_COLORKEY 0x2b +#define DRM_I915_GEM_WAIT 0x2c +#define DRM_I915_GEM_CONTEXT_CREATE 0x2d +#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e +#define DRM_I915_GEM_SET_CACHING 0x2f +#define DRM_I915_GEM_GET_CACHING 0x30 +#define DRM_I915_REG_READ 0x31 +#define DRM_I915_GET_RESET_STATS 0x32 +#define DRM_I915_GEM_USERPTR 0x33 +#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 +#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 + +#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) +#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) +#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) +#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) +#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) +#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) +#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) +#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) +#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) +#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) +#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) +#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) +#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t) +#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) +#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) +#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) +#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init) +#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) +#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) +#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) +#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) +#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) +#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) +#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching) +#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching) +#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE) +#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT) +#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT) +#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create) +#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread) +#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite) +#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap) +#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt) +#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain) +#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) +#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) +#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) +#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) +#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) +#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) +#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) +#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) +#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) +#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) +#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) +#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) +#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) +#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) +#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) +#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) +#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) + +enum aub_dump_bmp_format { +AUB_DUMP_BMP_FORMAT_8BIT =1 , +AUB_DUMP_BMP_FORMAT_ARGB_4444 =4 , +AUB_DUMP_BMP_FORMAT_ARGB_0888 =6 , +AUB_DUMP_BMP_FORMAT_ARGB_8888 =7 , +}; + +typedef struct _drm_intel_bo drm_intel_bo ; +typedef struct _drm_intel_bufmgr drm_intel_bufmgr ; +typedef struct _drm_intel_context drm_intel_context ; + +struct _drm_intel_context { +unsigned int ctx_id; +struct _drm_intel_bufmgr *bufmgr; +}; + +struct _drm_intel_bufmgr { +/** +* Allocate a buffer object. +* +* Buffer objects are not necessarily initially mapped into CPU virtual +* address space or graphics device aperture. They must be mapped +* using bo_map() or drm_intel_gem_bo_map_gtt() to be used by the CPU. +*/ +drm_intel_bo *(*bo_alloc) (drm_intel_bufmgr *bufmgr,const char *name, +unsigned long size,unsigned int alignment); + +/** +* Allocate a buffer object, hinting that it will be used as a +* render target. +* +* This is otherwise the same as bo_alloc. +*/ +drm_intel_bo *(*bo_alloc_for_render) (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned long size, +unsigned int alignment); + +/** +* Allocate a buffer object from an existing user accessible +* address malloc'd with the provided size. +* Alignment is used when mapping to the gtt. +* Flags may be I915_VMAP_READ_ONLY or I915_USERPTR_UNSYNCHRONIZED +*/ +drm_intel_bo *(*bo_alloc_userptr)(drm_intel_bufmgr *bufmgr, +const char *name,void *addr, +uint32_t tiling_mode,uint32_t stride, +unsigned long size, +unsigned long flags); + +/** +* Allocate a tiled buffer object. +* +* Alignment for tiled objects is set automatically; the 'flags' +* argument provides a hint about how the object will be used initially. +* +* Valid tiling formats are: +* I915_TILING_NONE +* I915_TILING_X +* I915_TILING_Y +* +* Note the tiling format may be rejected; callers should check the +* 'tiling_mode' field on return, as well as the pitch value, which +* may have been rounded up to accommodate for tiling restrictions. +*/ +drm_intel_bo *(*bo_alloc_tiled) (drm_intel_bufmgr *bufmgr, +const char *name, +int x,int y,int cpp, +uint32_t *tiling_mode, +unsigned long *pitch, +unsigned long flags); + +/** Takes a reference on a buffer object */ +void (*bo_reference) (drm_intel_bo *bo); + +/** +* Releases a reference on a buffer object, freeing the data if +* no references remain. +*/ +void (*bo_unreference) (drm_intel_bo *bo); + +/** +* Maps the buffer into userspace. +* +* This function will block waiting for any existing execution on the +* buffer to complete, first. The resulting mapping is available at +* buf->virtual. +*/ +int (*bo_map) (drm_intel_bo *bo,int write_enable); + +/** +* Reduces the refcount on the userspace mapping of the buffer +* object. +*/ +int (*bo_unmap) (drm_intel_bo *bo); + +/** +* Write data into an object. +* +* This is an optional function, if missing, +* drm_intel_bo will map/memcpy/unmap. +*/ +int (*bo_subdata) (drm_intel_bo *bo,unsigned long offset, +unsigned long size,const void *data); + +/** +* Read data from an object +* +* This is an optional function, if missing, +* drm_intel_bo will map/memcpy/unmap. +*/ +int (*bo_get_subdata) (drm_intel_bo *bo,unsigned long offset, +unsigned long size,void *data); + +/** +* Waits for rendering to an object by the GPU to have completed. +* +* This is not required for any access to the BO by bo_map, +* bo_subdata, etc. It is merely a way for the driver to implement +* glFinish. +*/ +void (*bo_wait_rendering) (drm_intel_bo *bo); + +/** +* Tears down the buffer manager instance. +*/ +void (*destroy) (drm_intel_bufmgr *bufmgr); + +/** +* Indicate if the buffer can be placed anywhere in the full ppgtt +* address range (2^48). +* +* Any resource used with flat/heapless (0x00000000-0xfffff000) +* General State Heap (GSH) or Intructions State Heap (ISH) must +* be in a 32-bit range. 48-bit range will only be used when explicitly +* requested. +* +* \param bo Buffer to set the use_48b_address_range flag. +* \param enable The flag value. +*/ +void (*bo_use_48b_address_range) (drm_intel_bo *bo,uint32_t enable); + +/** +* Add relocation entry in reloc_buf, which will be updated with the +* target buffer's real offset on on command submission. +* +* Relocations remain in place for the lifetime of the buffer object. +* +* \param bo Buffer to write the relocation into. +* \param offset Byte offset within reloc_bo of the pointer to +* target_bo. +* \param target_bo Buffer whose offset should be written into the +* relocation entry. +* \param target_offset Constant value to be added to target_bo's +* offset in relocation entry. +* \param read_domains GEM read domains which the buffer will be +* read into by the command that this relocation +* is part of. +* \param write_domains GEM read domains which the buffer will be +* dirtied in by the command that this +* relocation is part of. +*/ +int (*bo_emit_reloc) (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo,uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain); +int (*bo_emit_reloc_fence)(drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo, +uint32_t target_offset, +uint32_t read_domains, +uint32_t write_domain); + +/** Executes the command buffer pointed to by bo. */ +int (*bo_exec) (drm_intel_bo *bo,int used, +drm_clip_rect_t *cliprects,int num_cliprects, +int DR4 ); + +/** Executes the command buffer pointed to by bo on the selected +* ring buffer +*/ +int (*bo_mrb_exec) (drm_intel_bo *bo,int used, +drm_clip_rect_t *cliprects,int num_cliprects, +int DR4 ,unsigned flags); + +/** +* Pin a buffer to the aperture and fix the offset until unpinned +* +* \param buf Buffer to pin +* \param alignment Required alignment for aperture, in bytes +*/ +int (*bo_pin) (drm_intel_bo *bo,uint32_t alignment); + +/** +* Unpin a buffer from the aperture, allowing it to be removed +* +* \param buf Buffer to unpin +*/ +int (*bo_unpin) (drm_intel_bo *bo); + +/** +* Ask that the buffer be placed in tiling mode +* +* \param buf Buffer to set tiling mode for +* \param tiling_mode desired, and returned tiling mode +*/ +int (*bo_set_tiling) (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t stride); + +/** +* Get the current tiling (and resulting swizzling) mode for the bo. +* +* \param buf Buffer to get tiling mode for +* \param tiling_mode returned tiling mode +* \param swizzle_mode returned swizzling mode +*/ +int (*bo_get_tiling) (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t * swizzle_mode); + +/** +* Set the offset at which this buffer will be softpinned +* \param bo Buffer to set the softpin offset for +* \param offset Softpin offset +*/ +int (*bo_set_softpin_offset) (drm_intel_bo *bo,uint64_t offset); + +/** +* Create a visible name for a buffer which can be used by other apps +* +* \param buf Buffer to create a name for +* \param name Returned name +*/ +int (*bo_flink) (drm_intel_bo *bo,uint32_t * name); + +/** +* Returns 1 if mapping the buffer for write could cause the process +* to block, due to the object being active in the GPU. +*/ +int (*bo_busy) (drm_intel_bo *bo); + +/** +* Specify the volatility of the buffer. +* \param bo Buffer to create a name for +* \param madv The purgeable status +* +* Use I915_MADV_DONTNEED to mark the buffer as purgeable, and it will be +* reclaimed under memory pressure. If you subsequently require the buffer, +* then you must pass I915_MADV_WILLNEED to mark the buffer as required. +* +* Returns 1 if the buffer was retained, or 0 if it was discarded whilst +* marked as I915_MADV_DONTNEED. +*/ +int (*bo_madvise) (drm_intel_bo *bo,int madv); + +int (*check_aperture_space) (drm_intel_bo ** bo_array,int count); + +/** +* Disable buffer reuse for buffers which will be shared in some way, +* as with scanout buffers. When the buffer reference count goes to +* zero, it will be freed and not placed in the reuse list. +* +* \param bo Buffer to disable reuse for +*/ +int (*bo_disable_reuse) (drm_intel_bo *bo); + +/** +* Query whether a buffer is reusable. +* +* \param bo Buffer to query +*/ +int (*bo_is_reusable) (drm_intel_bo *bo); + +/** +* +* Return the pipe associated with a crtc_id so that vblank +* synchronization can use the correct data in the request. +* This is only supported for KMS and gem at this point, when +* unsupported, this function returns -1 and leaves the decision +* of what to do in that case to the caller +* +* \param bufmgr the associated buffer manager +* \param crtc_id the crtc identifier +*/ +int (*get_pipe_from_crtc_id) (drm_intel_bufmgr *bufmgr,int crtc_id); + +/** Returns true if target_bo is in the relocation tree rooted at bo. */ +int (*bo_references) (drm_intel_bo *bo,drm_intel_bo *target_bo); + +/**< Enables verbose debugging printouts */ +int debug; +}; + +struct _drm_intel_bo { +/** +* Size in bytes of the buffer object. +* +* The size may be larger than the size originally requested for the +* allocation, such as being aligned to page size. +*/ +unsigned long size; + +/** +* Alignment requirement for object +* +* Used for GTT mapping & pinning the object. +*/ +unsigned long align; + +/** +* Deprecated field containing (possibly the low 32-bits of) the last +* seen virtual card address. Use offset64 instead. +*/ +unsigned long offset; + +/** +* Virtual address for accessing the buffer data. Only valid while +* mapped. +*/ +#ifdef __cplusplus +void *virt; +#else +void *virtual; +#endif + +/** Buffer manager context associated with this buffer object */ +drm_intel_bufmgr *bufmgr; + +/** +* MM-specific handle for accessing object +*/ +int handle; + +/** +* Last seen card virtual address (offset from the beginning of the +* aperture) for the object. This should be used to fill relocation +* entries when calling drm_intel_bo_emit_reloc() +*/ +uint64_t offset64; +}; + +typedef struct drm_i915_getparam { +__s32 param; +/* +* WARNING: Using pointers instead of fixed-size u64 means we need to write +* compat32 code. Don't repeat this mistake. +*/ +int *value; +}drm_i915_getparam_t ; + +struct drm_i915_gem_execbuffer2 { +/** +* List of gem_exec_object2 structs +*/ +__u64 buffers_ptr; +__u32 buffer_count; + +/** Offset in the batchbuffer to start execution from. */ +__u32 batch_start_offset; +/** Bytes used in batchbuffer from batch_start_offset */ +__u32 batch_len; +__u32 DR1; +__u32 DR4; +__u32 num_cliprects; +/** This is a struct drm_clip_rect *cliprects */ +__u64 cliprects_ptr; +#define I915_EXEC_RING_MASK (7<<0) +#define I915_EXEC_DEFAULT (0<<0) +#define I915_EXEC_RENDER (1<<0) +#define I915_EXEC_BSD (2<<0) +#define I915_EXEC_BLT (3<<0) +#define I915_EXEC_VEBOX (4<<0) + +/* Used for switching the constants addressing mode on gen4+ RENDER ring. +* Gen6+ only supports relative addressing to dynamic state (default) and +* absolute addressing. +* +* These flags are ignored for the BSD and BLT rings. +*/ +#define I915_EXEC_CONSTANTS_MASK (3<<6) +#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6)/* default */ +#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) +#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6)/* gen4/5 only */ +__u64 flags; +__u64 rsvd1;/* now used for context info */ +__u64 rsvd2; +}; + +struct drm_i915_gem_exec_object2 { +/** +* User's handle for a buffer to be bound into the GTT for this +* operation. +*/ +__u32 handle; + +/** Number of relocations to be performed on this buffer */ +__u32 relocation_count; +/** +* Pointer to array of struct drm_i915_gem_relocation_entry containing +* the relocations to be performed in this buffer. +*/ +__u64 relocs_ptr; + +/** Required alignment in graphics aperture */ +__u64 alignment; + +/** +* When the EXEC_OBJECT_PINNED flag is specified this is populated by +* the user with the GTT offset at which this object will be pinned. +* When the I915_EXEC_NO_RELOC flag is specified this must contain the +* presumed_offset of the object. +* During execbuffer2 the kernel populates it with the value of the +* current GTT offset of the object, for future presumed_offset writes. +*/ +__u64 offset; + +#define EXEC_OBJECT_NEEDS_FENCE (1<<0) +#define EXEC_OBJECT_NEEDS_GTT (1<<1) +#define EXEC_OBJECT_WRITE (1<<2) +#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3) +#define EXEC_OBJECT_PINNED (1<<4) +#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PINNED<<1) +__u64 flags; + +__u64 rsvd1; +__u64 rsvd2; +}; + +struct drm_i915_gem_relocation_entry { +/** +* Handle of the buffer being pointed to by this relocation entry. +* +* It's appealing to make this be an index into the mm_validate_entry +* list to refer to the buffer, but this allows the driver to create +* a relocation list for state buffers and not re-write it per +* exec using the buffer. +*/ +__u32 target_handle; + +/** +* Value to be added to the offset of the target buffer to make up +* the relocation entry. +*/ +__u32 delta; + +/** Offset in the buffer the relocation entry will be written into */ +__u64 offset; + +/** +* Offset value of the target buffer that the relocation entry was last +* written as. +* +* If the buffer has the same offset as last time, we can skip syncing +* and writing the relocation. This value is written back out by +* the execbuffer ioctl when the relocation is written. +*/ +__u64 presumed_offset; + +/** +* Target memory domains read by this operation. +*/ +__u32 read_domains; + +/** +* Target memory domains written by this operation. +* +* Note that only one domain may be written by the whole +* execbuffer operation, so that where there are conflicts, +* the application will get -EINVAL back. +*/ +__u32 write_domain; +}; + +struct drm_i915_gem_get_tiling { +/** Handle of the buffer to get tiling state for. */ +__u32 handle; + +/** +* Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X, +* I915_TILING_Y). +*/ +__u32 tiling_mode; + +/** +* Returned address bit 6 swizzling required for CPU access through +* mmap mapping. +*/ +__u32 swizzle_mode; + +/** +* Returned address bit 6 swizzling required for CPU access through +* mmap mapping whilst bound. +*/ +__u32 phys_swizzle_mode; +}; + +struct drm_i915_gem_set_tiling { +/** Handle of the buffer to have its tiling state updated */ +__u32 handle; + +/** +* Tiling mode for the object (I915_TILING_NONE, I915_TILING_X, +* I915_TILING_Y). +* +* This value is to be set on request, and will be updated by the +* kernel on successful return with the actual chosen tiling layout. +* +* The tiling mode may be demoted to I915_TILING_NONE when the system +* has bit 6 swizzling that can't be managed correctly by GEM. +* +* Buffer contents become undefined when changing tiling_mode. +*/ +__u32 tiling_mode; + +/** +* Stride in bytes for the object when in I915_TILING_X or +* I915_TILING_Y. +*/ +__u32 stride; + +/** +* Returned address bit 6 swizzling required for CPU access through +* mmap mapping. +*/ +__u32 swizzle_mode; +}; + +struct drm_i915_gem_pwrite { +/** Handle for the object being written to. */ +__u32 handle; +__u32 pad; +/** Offset into the object to write to */ +__u64 offset; +/** Length of data to write */ +__u64 size; +/** +* Pointer to read the data from. +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 data_ptr; +}; + +struct drm_i915_gem_pread { +/** Handle for the object being read. */ +__u32 handle; +__u32 pad; +/** Offset into the object to read from */ +__u64 offset; +/** Length of data to read */ +__u64 size; +/** +* Pointer to write the data into. +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 data_ptr; +}; + +struct drm_i915_gem_set_domain { +/** Handle for the object */ +__u32 handle; + +/** New read domains */ +__u32 read_domains; + +/** New write domain */ +__u32 write_domain; +}; + +struct drm_i915_gem_wait { +/** Handle of BO we shall wait on */ +__u32 bo_handle; +__u32 flags; +/** Number of nanoseconds to wait, Returns time remaining. */ +__s64 timeout_ns; +}; + +struct drm_i915_gem_busy { +/** Handle of the buffer to check for busy */ +__u32 handle; + +/** Return busy status (1 if busy, 0 if idle). +* The high word is used to indicate on which rings the object +* currently resides: +* 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc) +*/ +__u32 busy; +}; + +struct drm_i915_gem_get_aperture { +/** Total size of the aperture used by i915_gem_execbuffer, in bytes */ +__u64 aper_size; + +/** +* Available space in the aperture used by i915_gem_execbuffer, in +* bytes +*/ +__u64 aper_available_size; +}; + +struct drm_i915_gem_create { +/** +* Requested size for the object. +* +* The (page-aligned) allocated size for the object will be returned. +*/ +__u64 size; +/** +* Returned handle for the object. +* +* Object handles are nonzero. +*/ +__u32 handle; +__u32 pad; +}; + +struct drm_i915_gem_mmap_gtt { +/** Handle for the object being mapped. */ +__u32 handle; +__u32 pad; +/** +* Fake offset to use for subsequent mmap call +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 offset; +}; + +struct drm_i915_gem_sw_finish { +/** Handle for the object */ +__u32 handle; +}; + +struct drm_i915_gem_mmap { +/** Handle for the object being mapped. */ +__u32 handle; +__u32 pad; +/** Offset in the object to map. */ +__u64 offset; +/** +* Length of data to map. +* +* The value will be page-aligned. +*/ +__u64 size; +/** +* Returned pointer the data was mapped at. +* +* This is a fixed-size type for 32/64 compatibility. +*/ +__u64 addr_ptr; + +/** +* Flags for extended behaviour. +* +* Added in version 2. +*/ +__u64 flags; +#define I915_MMAP_WC 0x1 +}; + +struct drm_i915_gem_madvise { +/** Handle of the buffer to change the backing store advice */ +__u32 handle; + +/* Advice: either the buffer will be needed again in the near future, +* or wont be and could be discarded under memory pressure. +*/ +__u32 madv; + +/** Whether the backing store still exists. */ +__u32 retained; +}; + +struct drm_i915_gem_context_create { +/* output: id of new context*/ +__u32 ctx_id; +__u32 pad; +}; + +struct drm_i915_gem_context_destroy { +__u32 ctx_id; +__u32 pad; +}; + +typedef struct _drm_intel_aub_annotation { +uint32_t type; +uint32_t subtype; +uint32_t ending_offset; +}drm_intel_aub_annotation ; + +struct drm_i915_gem_pin { +/** Handle of the buffer to be pinned. */ +__u32 handle; +__u32 pad; + +/** alignment required within the aperture */ +__u64 alignment; + +/** Returned GTT offset of the buffer. */ +__u64 offset; +}; + +#define I915_SET_COLORKEY_NONE (1<<0)/* disable color key matching */ +#define I915_SET_COLORKEY_DESTINATION (1<<1) +#define I915_SET_COLORKEY_SOURCE (1<<2) +struct drm_intel_sprite_colorkey { +__u32 plane_id; +__u32 min_value; +__u32 channel_mask; +__u32 max_value; +__u32 flags; +}; + +struct drm_i915_reg_read { +/* +* Register offset. +* For 64bit wide registers where the upper 32bits don't immediately +* follow the lower 32bits, the offset of the lower 32bits must +* be specified +*/ +__u64 offset; +__u64 val;/* Return value */ +}; + +drm_intel_bufmgr *drm_intel_bufmgr_gem_init (int fd,int batch_size); +void drm_intel_bo_unreference (drm_intel_bo *bo); +drm_intel_bo *drm_intel_bo_alloc (drm_intel_bufmgr *bufmgr,const char *name, +unsigned long size,unsigned int alignment); +int drm_intel_bo_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,const void *data); +int drm_intel_gem_bo_context_exec (drm_intel_bo *bo,drm_intel_context *ctx, +int used,unsigned int flags); +int drm_intel_bo_emit_reloc (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo,uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain); +int drm_intel_bo_emit_reloc_fence (drm_intel_bo *bo,uint32_t offset, +drm_intel_bo *target_bo, +uint32_t target_offset, +uint32_t read_domains,uint32_t write_domain); +int drm_intel_bo_get_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t * swizzle_mode); +int drm_intel_bo_mrb_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 , +unsigned int flags); +void drm_intel_bufmgr_gem_set_aub_annotations (drm_intel_bo *bo, +drm_intel_aub_annotation *annotations, +unsigned count); +void drm_intel_bufmgr_gem_enable_reuse (drm_intel_bufmgr *bufmgr); +int drm_intel_bo_exec (drm_intel_bo *bo,int used, +struct drm_clip_rect *cliprects,int num_cliprects,int DR4 ); +void drm_intel_bufmgr_destroy (drm_intel_bufmgr *bufmgr); +void drm_intel_bo_wait_rendering (drm_intel_bo *bo); +int drm_intel_bo_get_subdata (drm_intel_bo *bo,unsigned long offset, +unsigned long size,void *data); +int drm_intel_bo_map (drm_intel_bo *bo,int write_enable); +int drm_intel_gem_bo_map_gtt (drm_intel_bo *bo); +void drm_intel_bufmgr_gem_enable_fenced_relocs (drm_intel_bufmgr *bufmgr); +int drm_intel_bo_unmap (drm_intel_bo *bo); +int drm_intel_bo_flink (drm_intel_bo *bo,uint32_t * name); +drm_intel_bo *drm_intel_bo_gem_create_from_name (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned int handle); +int drm_intel_bo_gem_export_to_prime (drm_intel_bo *bo,int *prime_fd); +drm_intel_bo *drm_intel_bo_gem_create_from_prime (drm_intel_bufmgr *bufmgr, +int prime_fd,int size); +void drm_intel_bufmgr_gem_set_vma_cache_size (drm_intel_bufmgr *bufmgr, +int limit); +int drm_intel_gem_bo_unmap_gtt (drm_intel_bo *bo); +drm_intel_context *drm_intel_gem_context_create (drm_intel_bufmgr *bufmgr); +void drm_intel_gem_context_destroy (drm_intel_context *ctx); +drm_intel_bo *drm_intel_bo_alloc_tiled (drm_intel_bufmgr *bufmgr, +const char *name, +int x,int y,int cpp, +uint32_t *tiling_mode, +unsigned long *pitch, +unsigned long flags); +void drm_intel_bufmgr_gem_set_aub_filename (drm_intel_bufmgr *bufmgr, +const char *filename); +void drm_intel_bufmgr_gem_set_aub_dump (drm_intel_bufmgr *bufmgr,int enable); +void drm_intel_gem_bo_aub_dump_bmp (drm_intel_bo *bo, +int x1,int y1,int width,int height, +enum aub_dump_bmp_format format, +int pitch,int offset); +void drm_intel_gem_bo_start_gtt_access (drm_intel_bo *bo,int write_enable); +int drm_intel_bo_set_tiling (drm_intel_bo *bo,uint32_t * tiling_mode, +uint32_t stride); +int drm_intel_bo_disable_reuse (drm_intel_bo *bo); +void drm_intel_bo_reference (drm_intel_bo *bo); +int drm_intel_bufmgr_gem_get_devid (drm_intel_bufmgr *bufmgr); +drm_intel_bo *drm_intel_bo_alloc_for_render (drm_intel_bufmgr *bufmgr, +const char *name, +unsigned long size, +unsigned int alignment); +int drm_intel_bo_references (drm_intel_bo *bo,drm_intel_bo *target_bo);
Quoted 9 lines
Quoted 8 lines
lib/intel_drm_stubs.h new file +5
-1+int drm_intel_gem_bo_wait (drm_intel_bo *bo,int64_t timeout_ns); + +#endif + +#endif //INTEL_DRM_STUBS_H --2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 8/9 lib: Replace intel specific header includes with intel_drm_stubs.h.
In reply to [email protected]From: Robert Foss <[email protected]>
Replace intel specific header includes with intel_drm_stubs.h.
The stubbed functions will all call igt_require(false) and cause a skip.
--- lib/drmtest.c | 2 +- lib/gpgpu_fill.c | 7 +++---- lib/igt_aux.c | 2 +- lib/igt_aux.h | 3 ++- lib/igt_debugfs.c | 4 ++-- lib/igt_draw.h | 3 +-- lib/igt_fb.h | 3 ++- lib/igt_kms.c | 3 +-- lib/intel_batchbuffer.c | 4 ---- lib/intel_batchbuffer.h | 3 +-- lib/intel_chipset.c | 2 +- lib/ioctl_wrappers.c | 1 - lib/ioctl_wrappers.h | 4 ++-- lib/media_fill_gen7.c | 3 +-- lib/media_fill_gen8.c | 4 +--- lib/media_fill_gen8lp.c | 6 ++---- lib/media_fill_gen9.c | 4 +--- lib/media_spin.c | 2 -- lib/rendercopy_gen6.c | 5 ++--- lib/rendercopy_gen7.c | 4 +--- lib/rendercopy_gen8.c | 4 +--- lib/rendercopy_gen9.c | 5 +---- lib/rendercopy_i830.c | 5 +---- lib/rendercopy_i915.c | 9 +++------ 24 files changed, 31 insertions(+), 61 deletions(-)
lib/drmtest.c +1 -1
@@ -48,13 +48,13 @@#include <termios.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_gt.h" #include "igt_debugfs.h" #include "version.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h"
lib/gpgpu_fill.c +3 -4
@@ -25,15 +25,14 @@* Dominik Zeromski <[email protected]> */ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "intel_reg.h" #include "drmtest.h" -#include "intel_batchbuffer.h" #include "gen7_media.h" #include "gen8_media.h" #include "gpgpu_fill.h" +#include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" +#include "intel_reg.h" /* shaders/gpgpu/gpgpu_fill.gxa */ static const uint32_t gen7_gpgpu_kernel[][4 ] = {
lib/igt_aux.c +1 -1
@@ -52,12 +52,12 @@#include <assert.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "igt_aux.h" #include "igt_debugfs.h" #include "igt_gt.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_kms.h"
lib/igt_aux.h +2 -1
@@ -28,10 +28,11 @@#ifndef IGT_AUX_H #define IGT_AUX_H -#include <intel_bufmgr.h> #include <stdbool.h> #include <sys/time.h> +#include "intel_drm_stubs.h" +extern drm_intel_bo **trash_bos;extern int num_trash_bos;
lib/igt_debugfs.c +2 -2
@@ -32,12 +32,12 @@#include <string.h> #include <fcntl.h> #include <unistd.h> -#include <i915_drm.h> #include "drmtest.h" +#include "intel_drm_stubs.h" #include "igt_aux.h" -#include "igt_kms.h" #include "igt_debugfs.h" +#include "igt_kms.h" /** * SECTION:igt_debugfs
lib/igt_draw.h +1 -2
@@ -25,9 +25,8 @@#ifndef __IGT_DRAW_H__#define __IGT_DRAW_H__ -#include <intel_bufmgr.h> #include "igt_fb.h" - +#include "intel_drm_stubs.h" /** * igt_draw_method: * @IGT_DRAW_MMAP_CPU: draw using a CPU mmap.
lib/igt_fb.h +2 -1
@@ -38,10 +38,11 @@ typedef struct _cairo cairo_t;#include <stddef.h> #include <stdbool.h> +#include <stdint.h> #include <drm_fourcc.h> #include <xf86drmMode.h> -#include <i915_drm.h> +#include "intel_drm_stubs.h" /* helpers to create nice-looking framebuffers */ struct igt_fb {
lib/igt_kms.c +1 -2
@@ -41,12 +41,11 @@#include <errno.h> #include <time.h> -#include <i915_drm.h> -#include "drmtest.h" #include "igt_kms.h" #include "igt_aux.h" #include "intel_chipset.h" +#include "intel_drm_stubs.h" #include "igt_debugfs.h" /* list of connectors that need resetting on exit */
lib/intel_batchbuffer.c +0 -4
@@ -31,10 +31,8 @@#include <string.h> #include <assert.h> -#include "drm.h" #include "drmtest.h" #include "intel_batchbuffer.h" -#include "intel_bufmgr.h" #include "intel_chipset.h" #include "intel_reg.h" #include "rendercopy.h"
@@ -43,8 +41,6 @@#include "media_spin.h" #include "gpgpu_fill.h" -#include <i915_drm.h> -/** * SECTION:intel_batchbuffer * @short_description: Batchbuffer and blitter support
lib/intel_batchbuffer.h +1 -2
@@ -2,10 +2,9 @@#define INTEL_BATCHBUFFER_H #include <stdint.h> -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "igt_core.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #define BATCH_SZ 4096
lib/intel_chipset.c +1 -1
@@ -36,9 +36,9 @@#include <fcntl.h> #include <sys/stat.h> #include <sys/mman.h> -#include "i915_drm.h" #include "drmtest.h" +#include "intel_drm_stubs.h" #include "intel_chipset.h" #include "igt_core.h"
lib/ioctl_wrappers.c +0 -1
@@ -50,7 +50,6 @@#include <errno.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_debugfs.h"
lib/ioctl_wrappers.h +2 -2
@@ -32,8 +32,8 @@#include <stdint.h> #include <stdbool.h> -#include <intel_bufmgr.h> -#include <i915_drm.h> + +#include "intel_drm_stubs.h" extern int (*igt_ioctl)(int fd,unsigned long request,void *arg);
lib/media_fill_gen7.c +1 -2
@@ -1,9 +1,8 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "media_fill.h" #include "gen7_media.h" #include "intel_reg.h" +#include "intel_drm_stubs.h" #include "drmtest.h" #include <assert.h>
lib/media_fill_gen8.c +1 -3
@@ -1,8 +1,6 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "drmtest.h"
lib/media_fill_gen8lp.c +2 -4
@@ -1,13 +1,11 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> +#include <assert.h> #include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "drmtest.h" -#include <assert.h> -static const uint32_t media_kernel[][4 ] = { {0x00400001 ,0x20202288 ,0x00000020 ,0x00000000 },
lib/media_fill_gen9.c +1 -3
@@ -1,8 +1,6 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include <assert.h>
lib/media_spin.c +0 -2
@@ -24,8 +24,6 @@* Jeff McGee <[email protected]> */ -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "intel_reg.h" #include "drmtest.h" #include "intel_batchbuffer.h"
lib/rendercopy_gen6.c +2 -3
@@ -9,11 +9,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen6_render.h"
lib/rendercopy_gen7.c +1 -3
@@ -9,10 +9,8 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" #include "intel_chipset.h"
lib/rendercopy_gen8.c +1 -3
@@ -10,12 +10,10 @@#include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include <i915_drm.h> #include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen8_render.h"
lib/rendercopy_gen9.c +1 -4
@@ -11,12 +11,9 @@#include <sys/time.h> #include <getopt.h> -#include <drm.h> -#include <i915_drm.h> -#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen9_render.h"
lib/rendercopy_i830.c +1 -4
@@ -8,13 +8,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" -#include "i830_reg.h" #include "rendercopy.h"
lib/rendercopy_i915.c +3 -6
@@ -8,15 +8,12 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" -#include "drmtest.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" -#include "intel_io.h" +#include "drmtest.h" #include "i915_reg.h" #include "i915_3d.h" +#include "intel_batchbuffer.h" +#include "intel_io.h" #include "rendercopy.h" void gen3_render_copyfunc(struct intel_batchbuffer *batch,
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ?==?utf-8?q? [RFC i-g-t 8/9] lib: Replace intel specific header includes with intel_drm_stubs.h.
Quoted 25 lines · On Friday, May 20, 2016 23:59 BST, [email protected] wrote:
From: Robert Foss <[email protected]>
Replace intel specific header includes with
intel_drm_stubs.h.The stubbed functions will all call
igt_require(false)and cause a skip.Signed-off-by Robert Foss <[email protected]>--- lib/drmtest.c | 2 +- lib/gpgpu_fill.c | 7 +++---- lib/igt_aux.c | 2 +- lib/igt_aux.h | 3 ++- lib/igt_debugfs.c | 4 ++-- lib/igt_draw.h | 3 +-- lib/igt_fb.h | 3 ++- lib/igt_kms.c | 3 +-- lib/intel_batchbuffer.c | 4 ---- lib/intel_batchbuffer.h | 3 +-- lib/intel_chipset.c | 2 +- lib/ioctl_wrappers.c | 1 - lib/ioctl_wrappers.h | 4 ++-- lib/media_fill_gen7.c | 3 +-- lib/media_fill_gen8.c | 4 +--- lib/media_fill_gen8lp.c | 6 ++---- lib/media_fill_gen9.c | 4 +---
Quoted 9 lines
lib/media_spin.c | 2 -- lib/rendercopy_gen6.c | 5 ++--- lib/rendercopy_gen7.c | 4 +--- lib/rendercopy_gen8.c | 4 +--- lib/rendercopy_gen9.c | 5 +---- lib/rendercopy_i830.c | 5 +---- lib/rendercopy_i915.c | 9 +++------ 24 files changed, 31 insertions(+), 61 deletions(-)
This and next patch should be a simple sed job. Untangling the header inclusion(s) is a worthy goal imho, although it's not something that should be mixed in here.
The usual disclaimer... I've got little-to-no say when it comes to IGT so take all the above with a grain (truckload) of salt. That said, I'm fairly confident I haven't gone off the rocker this time and the reasoning is sound ;-)
Thanks
Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 8/9] lib: Replace intel specific header includes with intel_drm_stubs.h.
In reply to [email protected]Quoted 7 lines · On Fri, May 20, 2016 at 06:59:32PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
Replace intel specific header includes with
intel_drm_stubs.h.The stubbed functions will all call
igt_require(false)and cause a skip.Signed-off-by Robert Foss <[email protected]>
Do we need this sed job really? I kinda hoped we could have a dummy header somewhere, like lib/stubs/drm/i915_drm.h and similar (instead of your intel_drm_stubs.h), and then add lib/stubs/ to the include path when !HAVE_LIBDRM_INTEL? That way 0 changes to tests/lib itself should be needed.
-Daniel
Quoted 446 lines
--- lib/drmtest.c | 2 +- lib/gpgpu_fill.c | 7 +++---- lib/igt_aux.c | 2 +- lib/igt_aux.h | 3 ++- lib/igt_debugfs.c | 4 ++-- lib/igt_draw.h | 3 +-- lib/igt_fb.h | 3 ++- lib/igt_kms.c | 3 +-- lib/intel_batchbuffer.c | 4 ---- lib/intel_batchbuffer.h | 3 +-- lib/intel_chipset.c | 2 +- lib/ioctl_wrappers.c | 1 - lib/ioctl_wrappers.h | 4 ++-- lib/media_fill_gen7.c | 3 +-- lib/media_fill_gen8.c | 4 +--- lib/media_fill_gen8lp.c | 6 ++---- lib/media_fill_gen9.c | 4 +--- lib/media_spin.c | 2 -- lib/rendercopy_gen6.c | 5 ++--- lib/rendercopy_gen7.c | 4 +--- lib/rendercopy_gen8.c | 4 +--- lib/rendercopy_gen9.c | 5 +---- lib/rendercopy_i830.c | 5 +---- lib/rendercopy_i915.c | 9 +++------ 24 files changed, 31 insertions(+), 61 deletions(-)lib/drmtest.c +1
-1@@ -48,13 +48,13 @@#include <termios.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_gt.h" #include "igt_debugfs.h" #include "version.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" lib/gpgpu_fill.c +3
-4@@ -25,15 +25,14 @@* Dominik Zeromski <[email protected]> */ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "intel_reg.h" #include "drmtest.h" -#include "intel_batchbuffer.h" #include "gen7_media.h" #include "gen8_media.h" #include "gpgpu_fill.h" +#include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" +#include "intel_reg.h" /* shaders/gpgpu/gpgpu_fill.gxa */ static const uint32_t gen7_gpgpu_kernel[][4 ] = {lib/igt_aux.c +1
-1@@ -52,12 +52,12 @@#include <assert.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "igt_aux.h" #include "igt_debugfs.h" #include "igt_gt.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_kms.h" lib/igt_aux.h +2
-1@@ -28,10 +28,11 @@#ifndef IGT_AUX_H #define IGT_AUX_H -#include <intel_bufmgr.h> #include <stdbool.h> #include <sys/time.h> +#include "intel_drm_stubs.h" +extern drm_intel_bo **trash_bos;extern int num_trash_bos;lib/igt_debugfs.c +2
-2@@ -32,12 +32,12 @@#include <string.h> #include <fcntl.h> #include <unistd.h> -#include <i915_drm.h> #include "drmtest.h" +#include "intel_drm_stubs.h" #include "igt_aux.h" -#include "igt_kms.h" #include "igt_debugfs.h" +#include "igt_kms.h" /** * SECTION:igt_debugfs lib/igt_draw.h +1
-2@@ -25,9 +25,8 @@#ifndef __IGT_DRAW_H__#define __IGT_DRAW_H__ -#include <intel_bufmgr.h> #include "igt_fb.h" - +#include "intel_drm_stubs.h" /** * igt_draw_method: * @IGT_DRAW_MMAP_CPU: draw using a CPU mmap. lib/igt_fb.h +2
-1@@ -38,10 +38,11 @@ typedef struct _cairo cairo_t;#include <stddef.h> #include <stdbool.h> +#include <stdint.h> #include <drm_fourcc.h> #include <xf86drmMode.h> -#include <i915_drm.h> +#include "intel_drm_stubs.h" /* helpers to create nice-looking framebuffers */ struct igt_fb {lib/igt_kms.c +1
-2@@ -41,12 +41,11 @@#include <errno.h> #include <time.h> -#include <i915_drm.h> -#include "drmtest.h" #include "igt_kms.h" #include "igt_aux.h" #include "intel_chipset.h" +#include "intel_drm_stubs.h" #include "igt_debugfs.h" /* list of connectors that need resetting on exit */ lib/intel_batchbuffer.c +0
-4@@ -31,10 +31,8 @@#include <string.h> #include <assert.h> -#include "drm.h" #include "drmtest.h" #include "intel_batchbuffer.h" -#include "intel_bufmgr.h" #include "intel_chipset.h" #include "intel_reg.h" #include "rendercopy.h" @@ -43,8 +41,6 @@#include "media_spin.h" #include "gpgpu_fill.h" -#include <i915_drm.h> -/** * SECTION:intel_batchbuffer * @short_description: Batchbuffer and blitter support lib/intel_batchbuffer.h +1
-2@@ -2,10 +2,9 @@#define INTEL_BATCHBUFFER_H #include <stdint.h> -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "igt_core.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #define BATCH_SZ 4096lib/intel_chipset.c +1
-1@@ -36,9 +36,9 @@#include <fcntl.h> #include <sys/stat.h> #include <sys/mman.h> -#include "i915_drm.h" #include "drmtest.h" +#include "intel_drm_stubs.h" #include "intel_chipset.h" #include "igt_core.h" lib/ioctl_wrappers.c +0
-1@@ -50,7 +50,6 @@#include <errno.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_debugfs.h" lib/ioctl_wrappers.h +2
-2@@ -32,8 +32,8 @@#include <stdint.h> #include <stdbool.h> -#include <intel_bufmgr.h> -#include <i915_drm.h> + +#include "intel_drm_stubs.h" extern int (*igt_ioctl)(int fd,unsigned long request,void *arg);lib/media_fill_gen7.c +1
-2@@ -1,9 +1,8 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "media_fill.h" #include "gen7_media.h" #include "intel_reg.h" +#include "intel_drm_stubs.h" #include "drmtest.h" #include <assert.h> lib/media_fill_gen8.c +1
-3@@ -1,8 +1,6 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "drmtest.h" lib/media_fill_gen8lp.c +2
-4@@ -1,13 +1,11 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> +#include <assert.h> #include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "drmtest.h" -#include <assert.h> -static const uint32_t media_kernel[][4 ] = { {0x00400001 ,0x20202288 ,0x00000020 ,0x00000000 },lib/media_fill_gen9.c +1
-3@@ -1,8 +1,6 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include <assert.h> lib/media_spin.c +0
-2@@ -24,8 +24,6 @@* Jeff McGee <[email protected]> */ -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "intel_reg.h" #include "drmtest.h" #include "intel_batchbuffer.h" lib/rendercopy_gen6.c +2
-3@@ -9,11 +9,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen6_render.h" lib/rendercopy_gen7.c +1
-3@@ -9,10 +9,8 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" #include "intel_chipset.h" lib/rendercopy_gen8.c +1
-3@@ -10,12 +10,10 @@#include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include <i915_drm.h> #include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen8_render.h" lib/rendercopy_gen9.c +1
-4@@ -11,12 +11,9 @@#include <sys/time.h> #include <getopt.h> -#include <drm.h> -#include <i915_drm.h> -#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen9_render.h" lib/rendercopy_i830.c +1
-4@@ -8,13 +8,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" -#include "i830_reg.h" #include "rendercopy.h" lib/rendercopy_i915.c +3
-6@@ -8,15 +8,12 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" -#include "drmtest.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" -#include "intel_io.h" +#include "drmtest.h" #include "i915_reg.h" #include "i915_3d.h" +#include "intel_batchbuffer.h" +#include "intel_io.h" #include "rendercopy.h" void gen3_render_copyfunc(struct intel_batchbuffer *batch,Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [RFC i-g-t 8/9] lib: Replace intel specific header includes with intel_drm_stubs.h.
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · On Fri, May 20, 2016 at 06:59:32PM -0400, [email protected] wrote:
From: Robert Foss <[email protected]>
Replace intel specific header includes with
intel_drm_stubs.h.The stubbed functions will all call
igt_require(false)and cause a skip.
Quoted 8 lines
Quoted 1 line
Signed-off-by Robert Foss <[email protected]>Do we need this sed job really? I kinda hoped we could have a dummy header somewhere, like
lib/stubs/drm/i915_drm.hand similar (instead of yourintel_drm_stubs.h), and then addlib/stubs/to the include path when !HAVE_LIBDRM_INTEL? That way 0 changes to tests/lib itself should be needed.
-Daniel
This is a much cleaner solution, I've added it to v2. I'm somewhat worried about not having grokked the automake syntax for including the correct header files depending in HAVE_LIBDRM_INTEL though.
Rob.
Quoted 443 lines
Quoted 443 lines
--- lib/drmtest.c | 2 +- lib/gpgpu_fill.c | 7 +++---- lib/igt_aux.c | 2 +- lib/igt_aux.h | 3 ++- lib/igt_debugfs.c | 4 ++-- lib/igt_draw.h | 3 +-- lib/igt_fb.h | 3 ++- lib/igt_kms.c | 3 +-- lib/intel_batchbuffer.c | 4 ---- lib/intel_batchbuffer.h | 3 +-- lib/intel_chipset.c | 2 +- lib/ioctl_wrappers.c | 1 - lib/ioctl_wrappers.h | 4 ++-- lib/media_fill_gen7.c | 3 +-- lib/media_fill_gen8.c | 4 +--- lib/media_fill_gen8lp.c | 6 ++---- lib/media_fill_gen9.c | 4 +--- lib/media_spin.c | 2 -- lib/rendercopy_gen6.c | 5 ++--- lib/rendercopy_gen7.c | 4 +--- lib/rendercopy_gen8.c | 4 +--- lib/rendercopy_gen9.c | 5 +---- lib/rendercopy_i830.c | 5 +---- lib/rendercopy_i915.c | 9 +++------ 24 files changed, 31 insertions(+), 61 deletions(-)lib/drmtest.c +1
-1@@ -48,13 +48,13 @@#include <termios.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_gt.h" #include "igt_debugfs.h" #include "version.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" lib/gpgpu_fill.c +3
-4@@ -25,15 +25,14 @@* Dominik Zeromski <[email protected]> */ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "intel_reg.h" #include "drmtest.h" -#include "intel_batchbuffer.h" #include "gen7_media.h" #include "gen8_media.h" #include "gpgpu_fill.h" +#include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" +#include "intel_reg.h" /* shaders/gpgpu/gpgpu_fill.gxa */ static const uint32_t gen7_gpgpu_kernel[][4 ] = {lib/igt_aux.c +1
-1@@ -52,12 +52,12 @@#include <assert.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "igt_aux.h" #include "igt_debugfs.h" #include "igt_gt.h" #include "config.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_kms.h" lib/igt_aux.h +2
-1@@ -28,10 +28,11 @@#ifndef IGT_AUX_H #define IGT_AUX_H -#include <intel_bufmgr.h> #include <stdbool.h> #include <sys/time.h> +#include "intel_drm_stubs.h" +extern drm_intel_bo **trash_bos;extern int num_trash_bos;lib/igt_debugfs.c +2
-2@@ -32,12 +32,12 @@#include <string.h> #include <fcntl.h> #include <unistd.h> -#include <i915_drm.h> #include "drmtest.h" +#include "intel_drm_stubs.h" #include "igt_aux.h" -#include "igt_kms.h" #include "igt_debugfs.h" +#include "igt_kms.h" /** * SECTION:igt_debugfs lib/igt_draw.h +1
-2@@ -25,9 +25,8 @@#ifndef __IGT_DRAW_H__#define __IGT_DRAW_H__ -#include <intel_bufmgr.h> #include "igt_fb.h" - +#include "intel_drm_stubs.h" /** * igt_draw_method: * @IGT_DRAW_MMAP_CPU: draw using a CPU mmap. lib/igt_fb.h +2
-1@@ -38,10 +38,11 @@ typedef struct _cairo cairo_t;#include <stddef.h> #include <stdbool.h> +#include <stdint.h> #include <drm_fourcc.h> #include <xf86drmMode.h> -#include <i915_drm.h> +#include "intel_drm_stubs.h" /* helpers to create nice-looking framebuffers */ struct igt_fb {lib/igt_kms.c +1
-2@@ -41,12 +41,11 @@#include <errno.h> #include <time.h> -#include <i915_drm.h> -#include "drmtest.h" #include "igt_kms.h" #include "igt_aux.h" #include "intel_chipset.h" +#include "intel_drm_stubs.h" #include "igt_debugfs.h" /* list of connectors that need resetting on exit */ lib/intel_batchbuffer.c +0
-4@@ -31,10 +31,8 @@#include <string.h> #include <assert.h> -#include "drm.h" #include "drmtest.h" #include "intel_batchbuffer.h" -#include "intel_bufmgr.h" #include "intel_chipset.h" #include "intel_reg.h" #include "rendercopy.h" @@ -43,8 +41,6 @@#include "media_spin.h" #include "gpgpu_fill.h" -#include <i915_drm.h> -/** * SECTION:intel_batchbuffer * @short_description: Batchbuffer and blitter support lib/intel_batchbuffer.h +1
-2@@ -2,10 +2,9 @@#define INTEL_BATCHBUFFER_H #include <stdint.h> -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "igt_core.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #define BATCH_SZ 4096lib/intel_chipset.c +1
-1@@ -36,9 +36,9 @@#include <fcntl.h> #include <sys/stat.h> #include <sys/mman.h> -#include "i915_drm.h" #include "drmtest.h" +#include "intel_drm_stubs.h" #include "intel_chipset.h" #include "igt_core.h" lib/ioctl_wrappers.c +0
-1@@ -50,7 +50,6 @@#include <errno.h> #include "drmtest.h" -#include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" #include "igt_debugfs.h" lib/ioctl_wrappers.h +2
-2@@ -32,8 +32,8 @@#include <stdint.h> #include <stdbool.h> -#include <intel_bufmgr.h> -#include <i915_drm.h> + +#include "intel_drm_stubs.h" extern int (*igt_ioctl)(int fd,unsigned long request,void *arg);lib/media_fill_gen7.c +1
-2@@ -1,9 +1,8 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "media_fill.h" #include "gen7_media.h" #include "intel_reg.h" +#include "intel_drm_stubs.h" #include "drmtest.h" #include <assert.h> lib/media_fill_gen8.c +1
-3@@ -1,8 +1,6 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "drmtest.h" lib/media_fill_gen8lp.c +2
-4@@ -1,13 +1,11 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> +#include <assert.h> #include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include "drmtest.h" -#include <assert.h> -static const uint32_t media_kernel[][4 ] = { {0x00400001 ,0x20202288 ,0x00000020 ,0x00000000 },lib/media_fill_gen9.c +1
-3@@ -1,8 +1,6 @@ -#include <intel_bufmgr.h> -#include <i915_drm.h> -#include "media_fill.h" #include "gen8_media.h" +#include "intel_drm_stubs.h" #include "intel_reg.h" #include <assert.h> lib/media_spin.c +0
-2@@ -24,8 +24,6 @@* Jeff McGee <[email protected]> */ -#include <intel_bufmgr.h> -#include <i915_drm.h> #include "intel_reg.h" #include "drmtest.h" #include "intel_batchbuffer.h" lib/rendercopy_gen6.c +2
-3@@ -9,11 +9,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen6_render.h" lib/rendercopy_gen7.c +1
-3@@ -9,10 +9,8 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" #include "intel_chipset.h" lib/rendercopy_gen8.c +1
-3@@ -10,12 +10,10 @@#include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include <i915_drm.h> #include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen8_render.h" lib/rendercopy_gen9.c +1
-4@@ -11,12 +11,9 @@#include <sys/time.h> #include <getopt.h> -#include <drm.h> -#include <i915_drm.h> -#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "rendercopy.h" #include "gen9_render.h" lib/rendercopy_i830.c +1
-4@@ -8,13 +8,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" +#include "drmtest.h" -#include "intel_bufmgr.h" #include "intel_batchbuffer.h" #include "intel_io.h" -#include "i830_reg.h" #include "rendercopy.h" lib/rendercopy_i915.c +3
-6@@ -8,15 +8,12 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "i915_drm.h" -#include "drmtest.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" -#include "intel_io.h" +#include "drmtest.h" #include "i915_reg.h" #include "i915_3d.h" +#include "intel_batchbuffer.h" +#include "intel_io.h" #include "rendercopy.h"
Quoted 5 lines
Quoted 4 lines
lib/rendercopy_i915.c +0
-1void gen3_render_copyfunc(struct intel_batchbuffer *batch, --2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
RFC 9/9 tests: Replace intel specific header includes with intel_drm_stubs.h.
In reply to [email protected]From: Robert Foss <[email protected]>
Replace intel specific header includes with intel_drm_stubs.h.
The stubbed functions will all call igt_require(false) and cause a skip.
Additionally there a small amount of reformatting of the #includes was perfomed. "XXX" was fixed to <XXX> where approptiate, spacing and alphabetical ordering was also enforced.
--- tests/core_auth.c | 2 +- tests/core_get_client_auth.c | 2 +- tests/core_getclient.c | 3 ++- tests/drm_import_export.c | 7 +++---- tests/drm_read.c | 5 +++-- tests/drm_vma_limiter.c | 6 +++--- tests/drm_vma_limiter_cached.c | 6 +++--- tests/drm_vma_limiter_cpu.c | 6 +++--- tests/drm_vma_limiter_gtt.c | 6 +++--- tests/drv_getparams_basic.c | 6 +++--- tests/gem_alive.c | 4 ++-- tests/gem_bad_address.c | 6 +++--- tests/gem_bad_batch.c | 6 +++--- tests/gem_bad_blit.c | 6 +++--- tests/gem_bad_length.c | 2 +- tests/gem_bad_reloc.c | 2 +- tests/gem_basic.c | 2 +- tests/gem_caching.c | 5 ++--- tests/gem_close_race.c | 2 +- tests/gem_concurrent_all.c | 5 ++--- tests/gem_cpu_reloc.c | 4 ++-- tests/gem_create.c | 8 ++++---- tests/gem_ctx_bad_exec.c | 3 ++- tests/gem_ctx_basic.c | 8 +++++--- tests/gem_double_irq_loop.c | 7 ++++--- tests/gem_evict_everything.c | 2 +- tests/gem_exec_bad_domains.c | 7 ++++--- tests/gem_exec_big.c | 2 +- tests/gem_exec_blt.c | 2 +- tests/gem_exec_faulting_reloc.c | 2 +- tests/gem_exec_lut_handle.c | 2 +- tests/gem_exec_nop.c | 2 +- tests/gem_exec_params.c | 2 +- tests/gem_fence_thrash.c | 2 +- tests/gem_fence_upload.c | 7 ++++--- tests/gem_flink_basic.c | 2 +- tests/gem_flink_race.c | 4 ++-- tests/gem_gpgpu_fill.c | 7 ++++--- tests/gem_gtt_cpu_tlb.c | 2 +- tests/gem_gtt_speed.c | 2 +- tests/gem_hang.c | 6 +++--- tests/gem_hangcheck_forcewake.c | 7 ++++--- tests/gem_largeobject.c | 2 +- tests/gem_lut_handle.c | 2 +- tests/gem_madvise.c | 3 +-- tests/gem_media_fill.c | 7 ++++--- tests/gem_mmap.c | 2 +- tests/gem_mmap_gtt.c | 2 +- tests/gem_mmap_offset_exhaustion.c | 2 +- tests/gem_mmap_wc.c | 2 +- tests/gem_non_secure_batch.c | 5 +++-- tests/gem_partial_pwrite_pread.c | 1 - tests/gem_persistent_relocs.c | 1 - tests/gem_pin.c | 1 - tests/gem_pipe_control_store_loop.c | 7 ++++--- tests/gem_ppgtt.c | 6 +++--- tests/gem_pread.c | 2 +- tests/gem_pread_after_blit.c | 1 - tests/gem_pwrite.c | 2 +- tests/gem_pwrite_pread.c | 7 ++++--- tests/gem_pwrite_snooped.c | 2 +- tests/gem_read_read_speed.c | 5 ++--- tests/gem_readwrite.c | 2 +- tests/gem_reloc_overflow.c | 2 +- tests/gem_reloc_vs_gpu.c | 1 - tests/gem_render_copy.c | 5 ++--- tests/gem_render_copy_redux.c | 7 +++---- tests/gem_render_linear_blits.c | 5 ++--- tests/gem_render_tiled_blits.c | 5 ++--- tests/gem_request_retire.c | 8 +++----- tests/gem_seqno_wrap.c | 4 ++-- tests/gem_set_tiling_vs_blt.c | 7 ++++--- tests/gem_set_tiling_vs_gtt.c | 2 +- tests/gem_set_tiling_vs_pwrite.c | 2 +- tests/gem_stolen.c | 14 ++++++-------- tests/gem_storedw_batches_loop.c | 7 ++++--- tests/gem_storedw_loop.c | 2 +- tests/gem_streaming_writes.c | 2 +- tests/gem_stress.c | 6 ++---- tests/gem_threaded_access_tiled.c | 4 ++-- tests/gem_tiled_blits.c | 1 - tests/gem_tiled_fence_blits.c | 5 ++--- tests/gem_tiled_partial_pwrite_pread.c | 1 - tests/gem_tiled_pread_basic.c | 2 +- tests/gem_tiled_pread_pwrite.c | 1 - tests/gem_tiled_swapping.c | 1 - tests/gem_tiled_wb.c | 2 +- tests/gem_tiled_wc.c | 2 +- tests/gem_tiling_max_stride.c | 2 +- tests/gem_unfence_active_buffers.c | 7 ++++--- tests/gem_unref_active_buffers.c | 7 ++++--- tests/gem_userptr_blits.c | 8 +++----- tests/gem_wait.c | 5 ++--- tests/gem_write_read_ring_switch.c | 1 - tests/gen3_mixed_blits.c | 2 +- tests/gen3_render_linear_blits.c | 2 +- tests/gen3_render_mixed_blits.c | 2 +- tests/gen3_render_tiledx_blits.c | 2 +- tests/gen3_render_tiledy_blits.c | 2 +- tests/gen7_forcewake_mt.c | 3 +-- tests/kms_addfb_basic.c | 3 ++- tests/kms_atomic.c | 5 +++-- tests/kms_mmap_write_crc.c | 2 +- tests/kms_psr_sink_crc.c | 4 ++-- tests/kms_render.c | 4 ++-- tests/kms_setmode.c | 4 ++-- tests/kms_vblank.c | 5 ++--- tests/pm_rpm.c | 1 - tests/pm_rps.c | 4 ++-- tests/pm_sseu.c | 6 +++--- tests/prime_mmap.c | 5 +++-- tests/prime_nv_api.c | 4 ++-- tests/prime_nv_pcopy.c | 4 ++-- tests/prime_nv_test.c | 4 ++-- tests/prime_self_import.c | 3 +-- tests/prime_udl.c | 7 +++---- tests/vc4_create_bo.c | 5 +++-- tests/vc4_wait_bo.c | 5 +++-- tests/vc4_wait_seqno.c | 3 ++- 119 files changed, 226 insertions(+), 236 deletions(-)
tests/core_auth.c +1 -1
@@ -39,7 +39,7 @@#include <sys/ioctl.h> #include <sys/time.h> #include <sys/poll.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Call drmGetMagic() and drmAuthMagic() and see if it behaves." );
tests/core_get_client_auth.c +1 -1
@@ -44,7 +44,7 @@# include <pthread.h> #endif -#include "drm.h" +#include <drm.h> /* Checks whether the thread id is the current thread */ static bool
tests/core_getclient.c +2 -1
@@ -25,12 +25,13 @@* */ -#include "igt.h" #include <limits.h> #include <sys/ioctl.h> #include <stdlib.h> #include <errno.h> +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Tests the DRM_IOCTL_GET_CLIENT ioctl." );
tests/drm_import_export.c +3 -4
@@ -25,22 +25,21 @@*/ #define _GNU_SOURCE -#include "igt.h" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> -#include <libdrm/drm.h> -#include <libdrm/i915_drm.h> #include <xf86drm.h> -#include <intel_bufmgr.h> #include <errno.h> #include <pthread.h> #include <unistd.h> #include <sys/syscall.h> +#include "igt.h" +#include "intel_drm_stubs.h" +int fd;drm_intel_bufmgr *bufmgr;
tests/drm_read.c +3 -2
@@ -29,7 +29,6 @@* Testcase: boundary testing of read(drm_fd) */ -#include "igt.h" #include <unistd.h> #include <stdlib.h> #include <stdint.h>
@@ -43,7 +42,9 @@#include <sys/ioctl.h> #include <sys/time.h> #include <sys/poll.h> -#include "drm.h" + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Call read(drm) and see if it behaves." );
tests/drm_vma_limiter.c +3 -3
@@ -24,7 +24,6 @@* Daniel Vetter <[email protected]> */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -33,8 +32,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/drm_vma_limiter_cached.c +3 -3
@@ -24,7 +24,6 @@* Daniel Vetter <[email protected]> */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -33,8 +32,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/drm_vma_limiter_cpu.c +3 -3
@@ -24,7 +24,6 @@* Daniel Vetter <[email protected]> */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -33,8 +32,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/drm_vma_limiter_gtt.c +3 -3
@@ -24,7 +24,6 @@* Daniel Vetter <[email protected]> */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -33,8 +32,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/drv_getparams_basic.c +3 -3
@@ -25,12 +25,12 @@* */ -#include "igt.h" #include <unistd.h> #include <errno.h> #include <xf86drm.h> -#include <i915_drm.h> -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n" );
tests/gem_alive.c +2 -2
@@ -1,11 +1,11 @@ -#include "igt.h" #include <sys/ioctl.h> #include <fcntl.h> #include <errno.h> #include <string.h> #include <signal.h> -#include <i915_drm.h> +#include "igt.h" +#include "intel_drm_stubs.h" int main (void ) {
tests/gem_bad_address.c +3 -3
@@ -26,7 +26,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -35,8 +34,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/gem_bad_batch.c +3 -3
@@ -26,7 +26,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -35,8 +34,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/gem_bad_blit.c +3 -3
@@ -41,7 +41,6 @@* resulted. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -50,8 +49,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/gem_bad_length.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Test minimal bo_create and batchbuffer exec." );
tests/gem_bad_reloc.c +1 -1
@@ -37,7 +37,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Simulates SNA behaviour using negative self-relocations" " for STATE_BASE_ADDRESS command packets." );
tests/gem_basic.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> static void test_bad_close (int fd)
tests/gem_caching.c +2 -3
@@ -26,7 +26,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -35,10 +34,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test snoop consistency when touching partial" " cachelines." );
tests/gem_close_race.c +1 -1
@@ -40,7 +40,7 @@#include <sys/ioctl.h> #include <sys/time.h> #include <sys/syscall.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE (256 * 1024)
tests/gem_concurrent_all.c +2 -3
@@ -35,7 +35,6 @@* Based on gem_gtt_concurrent_blt. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -46,10 +45,10 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/wait.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test of pread/pwrite/mmap behavior when writing to active" " buffers." );
tests/gem_cpu_reloc.c +2 -2
@@ -45,7 +45,6 @@* GPU will hang. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -57,7 +56,8 @@#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test the relocations through the CPU domain." );
tests/gem_create.c +4 -4
@@ -47,15 +47,15 @@#include <drm.h> + +#include "igt.h" #include "ioctl_wrappers.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "intel_chipset.h" #include "igt_aux.h" #include "drmtest.h" -#include "drm.h" -#include "i915_drm.h" +IGT_TEST_DESCRIPTION ("This is a test for the extended & old gem_create ioctl," " that includes allocation of object from stolen memory"
tests/gem_ctx_bad_exec.c +2 -1
@@ -42,7 +42,8 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" + +#include <drm.h> IGT_TEST_DESCRIPTION ("Test that context cannot be submitted to unsupported" " rings." );
tests/gem_ctx_basic.c +5 -3
@@ -29,7 +29,6 @@* This test is useful for finding memory and refcount leaks. */ -#include "igt.h" #include <pthread.h> #include <stdlib.h> #include <sys/ioctl.h>
@@ -40,8 +39,11 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" +IGT_TEST_DESCRIPTION ("Basic test for memory and refcount leaks." );
tests/gem_double_irq_loop.c +4 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -34,8 +33,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" #include "i830_reg.h" static drm_intel_bufmgr *bufmgr;
tests/gem_evict_everything.c +1 -1
@@ -42,7 +42,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #include "eviction_common.c"
tests/gem_exec_bad_domains.c +4 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -34,8 +33,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" /* Testcase: Test whether the kernel rejects relocations with non-gpu domains *
tests/gem_exec_big.c +1 -1
@@ -44,7 +44,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Run a large nop batch to stress test the error capture" " code." );
tests/gem_exec_blt.c +1 -1
@@ -37,7 +37,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 16384
tests/gem_exec_faulting_reloc.c +1 -1
@@ -37,7 +37,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> /* Testcase: Submit patches with relocations in memory that will fault *
tests/gem_exec_lut_handle.c +1 -1
@@ -36,7 +36,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Exercises the basic execbuffer using the handle LUT" " interface." );
tests/gem_exec_nop.c +1 -1
@@ -38,7 +38,7 @@#include <sys/ioctl.h> #include <sys/time.h> #include <time.h> -#include "drm.h" +#include <drm.h> #define LOCAL_I915_EXEC_NO_RELOC (1<<11)#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
tests/gem_exec_params.c +1 -1
@@ -37,7 +37,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #define LOCAL_I915_EXEC_VEBOX (4<<0)
tests/gem_fence_thrash.c +1 -1
@@ -41,7 +41,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <pthread.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE (128*1024)/* restricted to 1MiB alignment on i915 fences */
tests/gem_fence_upload.c +4 -3
@@ -29,7 +29,6 @@#include "config.h" #endif -#include "igt.h" #include <unistd.h> #include <stdlib.h> #include <stdio.h>
@@ -39,8 +38,10 @@#include <errno.h> #include <sys/time.h> #include <pthread.h> -#include "drm.h" -#include "i915_drm.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" #define OBJECT_SIZE (1024*1024)/* restricted to 1MiB alignment on i915 fences */
tests/gem_flink_basic.c +1 -1
@@ -34,7 +34,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> static void test_flink (int fd)
tests/gem_flink_race.c +2 -2
@@ -25,7 +25,6 @@*/ #define _GNU_SOURCE -#include "igt.h" #include <sys/ioctl.h> #include <stdlib.h> #include <string.h>
@@ -34,7 +33,8 @@#include <pthread.h> #include <errno.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Check for flink/open vs. gem close races." );
tests/gem_gpgpu_fill.c +4 -3
@@ -30,7 +30,6 @@* workload for the GPGPU pipeline. */ -#include "igt.h" #include <stdbool.h> #include <unistd.h> #include <stdlib.h>
@@ -42,8 +41,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" #define WIDTH 64#define HEIGHT 64
tests/gem_gtt_cpu_tlb.c +1 -1
@@ -40,7 +40,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Check whether gtt tlbs for cpu access are correctly" " invalidated." );
tests/gem_gtt_speed.c +1 -1
@@ -38,7 +38,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 16384
tests/gem_hang.c +3 -3
@@ -26,7 +26,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -35,8 +34,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/gem_hangcheck_forcewake.c +4 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -34,8 +33,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Provoke the hangcheck timer on an otherwise idle" " system." );
tests/gem_largeobject.c +1 -1
@@ -34,7 +34,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> /* Should take 64 pages to store the page pointers on 64 bit */ #define OBJ_SIZE (128 * 1024 * 1024)
tests/gem_lut_handle.c +1 -1
@@ -36,7 +36,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Exercises the basic execbuffer using the handle LUT" " interface." );
tests/gem_madvise.c +1 -2
@@ -35,8 +35,7 @@#include <errno.h> #include <setjmp.h> #include <signal.h> - -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Checks that the kernel reports EFAULT when trying to use" " purged bo." );
tests/gem_media_fill.c +4 -3
@@ -30,7 +30,6 @@* workload for the Media pipeline. */ -#include "igt.h" #include <stdbool.h> #include <unistd.h> #include <stdlib.h>
@@ -42,8 +41,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Basic test for the media_fill() function, a very simple" " workload for the Media pipeline." );
tests/gem_mmap.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 16384#define PAGE_SIZE 4096
tests/gem_mmap_gtt.c +1 -1
@@ -37,7 +37,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #ifndef PAGE_SIZE #define PAGE_SIZE 4096
tests/gem_mmap_offset_exhaustion.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Checks whether the kernel handles mmap offset exhaustion" " correctly." );
tests/gem_mmap_wc.c +1 -1
@@ -37,7 +37,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> struct local_i915_gem_mmap_v2 {uint32_t handle;
tests/gem_non_secure_batch.c +3 -2
@@ -34,9 +34,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include "i830_reg.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Basic check of non-secure batches." );
tests/gem_partial_pwrite_pread.c +0 -1
@@ -34,7 +34,6 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h>
tests/gem_persistent_relocs.c +0 -1
@@ -37,7 +37,6 @@#include <sys/time.h> #include <signal.h> #include <sys/wait.h> -#include <drm.h>
tests/gem_pin.c +0 -1
@@ -36,7 +36,6 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h>
tests/gem_pipe_control_store_loop.c +4 -3
@@ -31,7 +31,6 @@* Writes a counter-value into an always newly allocated target bo (by disabling * buffer reuse). Decently trashes on tlb inconsistencies, too. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -40,8 +39,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test (TLB-)Coherency of pipe_control QW writes." );
tests/gem_ppgtt.c +3 -3
@@ -21,7 +21,6 @@* IN THE SOFTWARE. */ -#include "igt.h" #include <stdbool.h> #include <unistd.h> #include <stdlib.h>
@@ -33,11 +32,12 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" #include "igt_debugfs.h" +#include "intel_drm_stubs.h" +#define WIDTH 512#define STRIDE (WIDTH*4)
tests/gem_pread.c +1 -1
@@ -37,7 +37,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 16384#define LARGE_OBJECT_SIZE 1024 * 1024
tests/gem_pread_after_blit.c +0 -1
@@ -43,7 +43,6 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h>
tests/gem_pwrite.c +1 -1
@@ -37,7 +37,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 16384
tests/gem_pwrite_pread.c +4 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <unistd.h> #include <stdlib.h> #include <stdint.h>
@@ -37,8 +36,10 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" #define OBJECT_SIZE 16384
tests/gem_pwrite_snooped.c +1 -1
@@ -34,7 +34,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("pwrite to a snooped bo then make it uncached and check that the GPU sees the data." );
tests/gem_read_read_speed.c +2 -3
@@ -26,7 +26,6 @@* This is a test of performance with multiple readers from the same source. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -37,10 +36,10 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/wait.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test speed of concurrent reads between engines." );
tests/gem_readwrite.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 16384
tests/gem_reloc_overflow.c +1 -1
@@ -43,7 +43,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Check that kernel relocation overflows are caught." );
tests/gem_reloc_vs_gpu.c +0 -1
@@ -37,7 +37,6 @@#include <sys/time.h> #include <signal.h> #include <sys/wait.h> -#include <drm.h>
tests/gem_render_copy.c +2 -3
@@ -29,7 +29,6 @@* workload for the 3D engine. */ -#include "igt.h" #include <stdbool.h> #include <unistd.h> #include <cairo.h>
@@ -42,10 +41,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Basic test for the render_copy() function." );
tests/gem_render_copy_redux.c +3 -4
@@ -32,7 +32,6 @@* the execbuffer interface with a simple render workload. */ -#include "igt.h" #include <stdbool.h> #include <unistd.h> #include <stdlib.h>
@@ -44,10 +43,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Advanced test for the render_copy() function." );
@@ -111,7 +110,7 @@ static void scratch_buf_init(data_t *data, struct igt_buf *buf,static void scratch_buf_fini (data_t *data,struct igt_buf *buf) { -dri_bo_unreference (buf->bo); +drm_intel_bo_unreference (buf->bo);memset (buf,0 ,sizeof (*buf)); }
tests/gem_render_linear_blits.c +2 -3
@@ -37,7 +37,6 @@#include "config.h" #endif -#include "igt.h" #include <stdlib.h> #include <sys/ioctl.h> #include <stdio.h>
@@ -47,10 +46,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #define WIDTH 512#define STRIDE (WIDTH*4)
tests/gem_render_tiled_blits.c +2 -3
@@ -33,7 +33,6 @@* The goal is to simply ensure the basics work. */ -#include "igt.h" #include <stdlib.h> #include <sys/ioctl.h> #include <stdio.h>
@@ -43,10 +42,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #define WIDTH 512#define STRIDE (WIDTH*4)
tests/gem_request_retire.c +3 -5
@@ -30,7 +30,6 @@* Collection of tests targeting request retirement code paths. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -43,11 +42,10 @@#include <signal.h> #include <pthread.h> #include <time.h> +#include <drm.h> -#include "drm.h" -#include "i915_drm.h" - -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Collection of tests targeting request retirement code" " paths." );
tests/gem_seqno_wrap.c +2 -2
@@ -30,7 +30,6 @@* boundary. */ -#include "igt.h" #include <stdlib.h> #include <string.h> #include <time.h>
@@ -42,7 +41,8 @@#include <signal.h> #include <errno.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Runs blitcopy -> rendercopy with multiple buffers over" " wrap boundary." );
tests/gem_set_tiling_vs_blt.c +4 -3
@@ -44,7 +44,6 @@* transitions (i.e. changing stride). */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -54,8 +53,10 @@#include <sys/stat.h> #include <sys/time.h> #include <stdbool.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Check for proper synchronization of tiling changes vs." " tiled gpu access." );
tests/gem_set_tiling_vs_gtt.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Check set_tiling vs gtt mmap coherency." );
tests/gem_set_tiling_vs_pwrite.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Check set_tiling vs pwrite coherency." );
tests/gem_stolen.c +6 -8
@@ -44,18 +44,16 @@#include <sys/stat.h> #include <sys/time.h> #include <getopt.h> -#include <drm.h> -#include "ioctl_wrappers.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" +#include "drmtest.h" +#include "igt.h" +#include "igt_aux.h" +#include "intel_drm_stubs.h" #include "intel_io.h" #include "intel_chipset.h" -#include "igt_aux.h" -#include "drmtest.h" -#include "drm.h" -#include "i915_drm.h" +#include "ioctl_wrappers.h" +IGT_TEST_DESCRIPTION ("This test verifies the exetended gem_create ioctl," " that includes allocation of obj from stolen region" );
tests/gem_storedw_batches_loop.c +4 -3
@@ -26,7 +26,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -35,8 +34,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;static drm_intel_bo *target_bo;
tests/gem_storedw_loop.c +1 -1
@@ -35,7 +35,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Basic CS check using MI_STORE_DATA_IMM." );
tests/gem_streaming_writes.c +1 -1
@@ -37,7 +37,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #define OBJECT_SIZE 1024*1024#define CHUNK_SIZE 32
tests/gem_stress.c +2 -4
@@ -49,7 +49,6 @@* In short: designed for maximum evilness. */ -#include "igt.h" #include <stdlib.h> #include <sys/ioctl.h> #include <stdio.h>
@@ -60,9 +59,8 @@#include <sys/stat.h> #include <sys/time.h> -#include <drm.h> - -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("General gem coherency test." );
tests/gem_threaded_access_tiled.c +2 -2
@@ -24,14 +24,14 @@* Mika Kuoppala <[email protected]> */ -#include "igt.h" #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <pthread.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Check parallel access to tiled memory." );
tests/gem_tiled_blits.c +0 -1
@@ -50,7 +50,6 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h>
tests/gem_tiled_fence_blits.c +2 -3
@@ -41,7 +41,6 @@* resulted. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -50,10 +49,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" static drm_intel_bufmgr *bufmgr;struct intel_batchbuffer *batch;
tests/gem_tiled_partial_pwrite_pread.c +0 -1
@@ -34,7 +34,6 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h>
tests/gem_tiled_pread_basic.c +1 -1
@@ -45,7 +45,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION("Test pread behavior on tiled objects with respect to the"
tests/gem_tiled_pread_pwrite.c +0 -1
@@ -54,7 +54,6 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include <drm.h>
tests/gem_tiled_swapping.c +0 -1
@@ -55,7 +55,6 @@#include <sys/time.h> #include <sys/ioctl.h> #include <pthread.h> -#include <drm.h>
tests/gem_tiled_wb.c +1 -1
@@ -42,7 +42,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("This is a test of write-combining mmap's behavior on" " tiled objects with respect to the reported swizzling"
tests/gem_tiled_wc.c +1 -1
@@ -42,7 +42,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #define WIDTH 512#define HEIGHT 512
tests/gem_tiling_max_stride.c +1 -1
@@ -36,7 +36,7 @@#include <limits.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Check that max fence stride works." );
tests/gem_unfence_active_buffers.c +4 -3
@@ -38,7 +38,6 @@* problem - the race window is too small. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -48,8 +47,10 @@#include <sys/stat.h> #include <sys/time.h> #include <stdbool.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Check for use-after-free in the fence stealing code." );
tests/gem_unref_active_buffers.c +4 -3
@@ -32,7 +32,6 @@* will be the last one to hold a reference on them. Usually libdrm bo caching * prevents that by keeping another reference. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -41,8 +40,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" -#include "intel_bufmgr.h" +#include <drm.h> + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test unreferencing of active buffers." );
tests/gem_userptr_blits.c +3 -5
@@ -36,7 +36,6 @@* The goal is to simply ensure the basics work. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -49,11 +48,10 @@#include <signal.h> #include <pthread.h> #include <time.h> +#include <drm.h> -#include "drm.h" -#include "i915_drm.h" - -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #include "eviction_common.c"
tests/gem_wait.c +2 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <stdio.h> #include <time.h> #include <stdlib.h>
@@ -37,10 +36,10 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #define MSEC_PER_SEC 1000L#define USEC_PER_MSEC 1000L
tests/gem_write_read_ring_switch.c +0 -1
@@ -34,7 +34,6 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include <drm.h> #include "i830_reg.h"
tests/gen3_mixed_blits.c +1 -1
@@ -43,7 +43,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #include "i915_reg.h"
tests/gen3_render_linear_blits.c +1 -1
@@ -42,7 +42,7 @@#include <errno.h> #include <sys/stat.h> #include <sys/time.h> -#include "drm.h" +#include <drm.h> #include "i915_reg.h"
tests/gen3_render_mixed_blits.c +1 -1
@@ -43,7 +43,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #include "i915_reg.h"
tests/gen3_render_tiledx_blits.c +1 -1
@@ -43,7 +43,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #include "i915_reg.h"
tests/gen3_render_tiledy_blits.c +1 -1
@@ -43,7 +43,7 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> #include "i915_reg.h"
tests/gen7_forcewake_mt.c +1 -2
@@ -34,8 +34,7 @@#include <sys/types.h> #include <pthread.h> #include <string.h> - -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Exercise a suspect workaround required for" " FORCEWAKE_MT." );
tests/kms_addfb_basic.c +2 -1
@@ -35,7 +35,8 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "drm.h" +#include <drm.h> +#include "drm_fourcc.h" uint32_t gem_bo;
tests/kms_atomic.c +3 -2
@@ -39,11 +39,12 @@#include <errno.h> #include <xf86drmMode.h> #include <cairo.h> -#include "drm.h" -#include "ioctl_wrappers.h" +#include <drm.h> +#include "drmtest.h" #include "igt.h" #include "igt_aux.h" +#include "ioctl_wrappers.h" #ifndef DRM_CLIENT_CAP_ATOMIC #define DRM_CLIENT_CAP_ATOMIC 3
tests/kms_mmap_write_crc.c +1 -1
@@ -31,11 +31,11 @@#include <string.h> #include "drmtest.h" +#include "igt_aux.h" #include "igt_debugfs.h" #include "igt_kms.h" #include "intel_chipset.h" #include "ioctl_wrappers.h" -#include "igt_aux.h" IGT_TEST_DESCRIPTION ("Use the display CRC support to validate mmap write to an already uncached future scanout buffer." );
tests/kms_psr_sink_crc.c +2 -2
@@ -22,13 +22,13 @@* */ -#include "igt.h" #include <errno.h> #include <stdbool.h> #include <stdio.h> #include <string.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" bool running_with_psr_disabled;
tests/kms_render.c +2 -2
@@ -24,14 +24,14 @@#include "config.h" #endif -#include "igt.h" #include <cairo.h> #include <errno.h> #include <stdint.h> #include <unistd.h> #include <sys/time.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" drmModeRes *resources;int drm_fd;
tests/kms_setmode.c +2 -2
@@ -24,7 +24,6 @@#include "config.h" #endif -#include "igt.h" #include <cairo.h> #include <errno.h> #include <stdint.h>
@@ -32,7 +31,8 @@#include <string.h> #include <sys/time.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #define MAX_CONNECTORS 10#define MAX_CRTCS 3
tests/kms_vblank.c +2 -3
@@ -26,7 +26,6 @@* This is a test of performance of drmWaitVblank. */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -37,10 +36,10 @@#include <sys/stat.h> #include <sys/time.h> #include <sys/wait.h> -#include <drm.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Test speed of WaitVblank." );
tests/pm_rpm.c +0 -1
@@ -40,7 +40,6 @@#include <sys/stat.h> #include <linux/i2c.h> #include <linux/i2c-dev.h> -#include <drm.h>
tests/pm_rps.c +2 -2
@@ -27,7 +27,6 @@*/ #define _GNU_SOURCE -#include "igt.h" #include <stdio.h> #include <stdlib.h> #include <string.h>
@@ -38,7 +37,8 @@#include <time.h> #include <sys/wait.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" static int drm_fd;
tests/pm_sseu.c +3 -3
@@ -24,14 +24,14 @@* Jeff McGee <[email protected]> */ -#include "igt.h" #include <fcntl.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <time.h> -#include "i915_drm.h" -#include "intel_bufmgr.h" + +#include "igt.h" +#include "intel_drm_stubs.h" IGT_TEST_DESCRIPTION ("Tests slice/subslice/EU power gating functionality.\n" );
tests/prime_mmap.c +3 -2
@@ -40,11 +40,12 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <pthread.h> +#include <drm.h> -#include "drm.h" -#include "i915_drm.h" #include "drmtest.h" +#include "igt.h" #include "igt_debugfs.h" +#include "intel_drm_stubs.h" #include "ioctl_wrappers.h" #define BO_SIZE (16*1024)
tests/prime_nv_api.c +2 -2
@@ -8,14 +8,14 @@test4 - export handle twice from intel, import into nouveau twice, check handle is the same */ -#include "igt.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #include "nouveau.h" #define BO_SIZE (256*1024)
tests/prime_nv_pcopy.c +2 -2
@@ -14,7 +14,6 @@*/ -#include "igt.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h>
@@ -24,7 +23,8 @@#include <sys/ioctl.h> #include <errno.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #include "nouveau.h" static int intel_fd =-1 , nouveau_fd =-1 ;
tests/prime_nv_test.c +2 -2
@@ -14,7 +14,6 @@*/ -#include "igt.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h>
@@ -23,7 +22,8 @@#include <sys/stat.h> #include <sys/ioctl.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" #include "nouveau.h" int intel_fd =-1 , nouveau_fd =-1 ;
tests/prime_self_import.c +1 -2
@@ -43,8 +43,7 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <pthread.h> - -#include "drm.h" +#include <drm.h> IGT_TEST_DESCRIPTION ("Check whether prime import/export works on the same" " device... but with different fds." );
tests/prime_udl.c +3 -4
@@ -14,7 +14,6 @@*/ -#include "igt.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h>
@@ -23,11 +22,11 @@#include <sys/stat.h> #include <sys/ioctl.h> #include <errno.h> - -#include "xf86drm.h" +#include <xf86drm.h> #include <xf86drmMode.h> -#include "intel_bufmgr.h" +#include "igt.h" +#include "intel_drm_stubs.h" int intel_fd =-1 , udl_fd =-1 ;drm_intel_bufmgr *bufmgr;
tests/vc4_create_bo.c +3 -2
@@ -21,8 +21,6 @@* IN THE SOFTWARE. */ -#include "igt.h" -#include "igt_vc4.h" #include <unistd.h> #include <stdlib.h> #include <stdio.h>
@@ -32,6 +30,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> + +#include "igt.h" +#include "igt_vc4.h" #include "vc4_drm.h" igt_main
tests/vc4_wait_bo.c +3 -2
@@ -21,8 +21,6 @@* IN THE SOFTWARE. */ -#include "igt.h" -#include "igt_vc4.h" #include <unistd.h> #include <stdlib.h> #include <stdio.h>
@@ -32,6 +30,9 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> + +#include "igt.h" +#include "igt_vc4.h" #include "vc4_drm.h" static void
tests/vc4_wait_seqno.c +2 -1
@@ -21,7 +21,6 @@* IN THE SOFTWARE. */ -#include "igt.h" #include <unistd.h> #include <stdlib.h> #include <stdio.h>
@@ -31,6 +30,8 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> + +#include "igt.h" #include "vc4_drm.h" igt_main
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx