[Intel-gfx] [RFC i-g-t 0/9] Remove compile time depencencies on libdrm_intel.

robert.foss at collabora.com robert.foss at collabora.com
Fri May 20 22:59:24 UTC 2016


From: Robert Foss <robert.foss at collabora.com>

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

-- 
2.7.4



More information about the Intel-gfx mailing list