[Intel-gfx] [PATCH 00/21] drm/i915: clean up i915_drv.h

Jani Nikula jani.nikula at intel.com
Wed Jan 5 19:56:16 UTC 2022


In a long overdue cleanup, split out a bunch of headers and declarations
out of i915_drv.h, and reduce includes all over the place.

I feel pretty strongly that declarations for functions in some_file.c
need to be placed in some_file.h. This does not generally seem to be the
case in gem/gt land. I create a number of such files here to place the
declarations extracted from i915_drv.h in them. I limit myself to
i915_drv.h cleanup here, and leave further cleanup for follow-up.

i915_drv.h is a painful file to deal with. Due to the massive amount of
headers it includes, and the massive amount of files it gets included
from, it basically causes the entire driver to be rebuilt whenever
almost any header gets changed in include/linux, include/drm, or i915
itself. Just build and sparse testing each commit takes eons.

This series is far from fixing everything, but it moves things forward a
few strides.


BR,
Jani.


Jani Nikula (21):
  drm/i915: split out i915_getparam.h from i915_drv.h
  drm/i915: split out i915_cmd_parser.h from i915_drv.h
  drm/i915: split out i915_gem_evict.h from i915_drv.h
  drm/i915: split out gem/i915_gem_userptr.h from i915_drv.h
  drm/i915: split out gem/i915_gem_tiling.h from i915_drv.h
  drm/i915: split out i915_gem.h declarations from i915_drv.h
  drm/i915: split out i915_gem_internal.h from i915_drv.h
  drm/i915: remove leftover i915_gem_pm.h declarations from i915_drv.h
  drm/i915: split out gem/i915_gem_dmabuf.h from i915_drv.h
  drm/i915: split out gem/i915_gem_create.h from i915_drv.h
  drm/i915: split out gem/i915_gem_domain.h from i915_drv.h
  drm/i915: move i915_cache_level_str() static in i915_debugfs.c
  drm/i915: move i915_gem_vm_lookup() where it's used
  drm/i915: move i915_reset_count()/i915_reset_engine_count() out of
    i915_drv.h
  drm/i915: split out i915_file_private.h from i915_drv.h
  drm/i915: don't include drm_cache.h in i915_drv.h
  drm/i915: include shmem_fs.h only where needed
  drm/i915: include some drm headers only where needed
  drm/i915: axe lots of unnecessary includes from i915_drv.h
  drm/i915: fix drm_i915.h include grouping and sorting
  drm/i915: group drm_i915.h forward declarations together

 drivers/gpu/drm/i915/display/intel_dpt.c      |   4 +-
 drivers/gpu/drm/i915/display/intel_dsb.c      |   2 +
 drivers/gpu/drm/i915/display/intel_fb_pin.c   |   1 +
 drivers/gpu/drm/i915/display/intel_overlay.c  |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_clflush.c   |   2 +
 drivers/gpu/drm/i915/gem/i915_gem_context.c   |  17 +
 drivers/gpu/drm/i915/gem/i915_gem_create.c    |   3 +
 drivers/gpu/drm/i915/gem/i915_gem_create.h    |  17 +
 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c    |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.h    |  18 ++
 drivers/gpu/drm/i915/gem/i915_gem_domain.c    |   5 +-
 drivers/gpu/drm/i915/gem/i915_gem_domain.h    |  15 +
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |   3 +
 drivers/gpu/drm/i915/gem/i915_gem_internal.c  |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_internal.h  |  23 ++
 drivers/gpu/drm/i915/gem/i915_gem_mman.c      |   2 +
 drivers/gpu/drm/i915/gem/i915_gem_object.c    |   5 +
 drivers/gpu/drm/i915/gem/i915_gem_pages.c     |   2 +
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c     |   3 +
 drivers/gpu/drm/i915/gem/i915_gem_throttle.c  |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_tiling.c    |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_tiling.h    |  18 ++
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c       |   2 +
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c   |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_userptr.h   |  14 +
 .../gpu/drm/i915/gem/selftests/huge_pages.c   |   3 +-
 .../drm/i915/gem/selftests/i915_gem_context.c |   1 +
 .../drm/i915/gem/selftests/i915_gem_mman.c    |   4 +-
 .../drm/i915/gem/selftests/igt_gem_utils.c    |   1 +
 .../gpu/drm/i915/gem/selftests/mock_context.c |   1 +
 drivers/gpu/drm/i915/gt/gen6_ppgtt.c          |   2 +
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  14 +-
 drivers/gpu/drm/i915/gt/intel_gt.c            |   7 +-
 .../gpu/drm/i915/gt/intel_gt_buffer_pool.c    |   1 +
 drivers/gpu/drm/i915/gt/intel_gtt.c           |   1 +
 drivers/gpu/drm/i915/gt/intel_renderstate.c   |   2 +
 drivers/gpu/drm/i915/gt/intel_reset.c         |   1 +
 drivers/gpu/drm/i915/gt/intel_ring.c          |   1 +
 .../gpu/drm/i915/gt/intel_ring_submission.c   |   4 +
 drivers/gpu/drm/i915/gt/intel_timeline.c      |   5 +-
 drivers/gpu/drm/i915/gt/selftest_execlists.c  |   1 +
 drivers/gpu/drm/i915/gt/selftest_hangcheck.c  |   2 +
 drivers/gpu/drm/i915/gt/selftest_lrc.c        |   2 +
 drivers/gpu/drm/i915/gt/selftest_migrate.c    |   2 +
 drivers/gpu/drm/i915/gt/selftest_rps.c        |   2 +
 .../gpu/drm/i915/gt/selftest_workarounds.c    |   1 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c   |   2 +
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c      |   2 +
 drivers/gpu/drm/i915/gvt/dmabuf.c             |   5 +
 drivers/gpu/drm/i915/i915_cmd_parser.c        |   3 +
 drivers/gpu/drm/i915/i915_cmd_parser.h        |  26 ++
 drivers/gpu/drm/i915/i915_debugfs.c           |  11 +
 drivers/gpu/drm/i915/i915_driver.c            |   4 +
 drivers/gpu/drm/i915/i915_drv.h               | 297 ++----------------
 drivers/gpu/drm/i915/i915_file_private.h      | 108 +++++++
 drivers/gpu/drm/i915/i915_gem.c               |   8 +-
 drivers/gpu/drm/i915/i915_gem.h               |  36 +++
 drivers/gpu/drm/i915/i915_gem_evict.c         |   1 +
 drivers/gpu/drm/i915/i915_gem_evict.h         |  24 ++
 drivers/gpu/drm/i915/i915_gem_gtt.c           |   1 +
 drivers/gpu/drm/i915/i915_getparam.c          |   2 +
 drivers/gpu/drm/i915/i915_getparam.h          |  15 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   1 +
 drivers/gpu/drm/i915/i915_gpu_error.h         |  11 +
 drivers/gpu/drm/i915/i915_ioc32.c             |   1 +
 drivers/gpu/drm/i915/i915_pci.c               |   1 +
 drivers/gpu/drm/i915/i915_perf.c              |   2 +
 drivers/gpu/drm/i915/i915_vma.c               |   3 +-
 drivers/gpu/drm/i915/selftests/i915_gem.c     |   3 +-
 .../gpu/drm/i915/selftests/i915_gem_evict.c   |   1 +
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |   1 +
 drivers/gpu/drm/i915/selftests/i915_request.c |   1 +
 drivers/gpu/drm/i915/selftests/i915_vma.c     |   1 +
 drivers/gpu/drm/i915/selftests/igt_spinner.c  |   1 +
 74 files changed, 498 insertions(+), 294 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_create.h
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.h
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_domain.h
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_internal.h
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_tiling.h
 create mode 100644 drivers/gpu/drm/i915/gem/i915_gem_userptr.h
 create mode 100644 drivers/gpu/drm/i915/i915_cmd_parser.h
 create mode 100644 drivers/gpu/drm/i915/i915_file_private.h
 create mode 100644 drivers/gpu/drm/i915/i915_gem_evict.h
 create mode 100644 drivers/gpu/drm/i915/i915_getparam.h

-- 
2.30.2



More information about the Intel-gfx mailing list