mbox series

[RFC,00/10] Compartmentalize uncore code

Message ID 20190313231319.711-1-daniele.ceraolospurio@intel.com (mailing list archive)
Headers show
Series Compartmentalize uncore code | expand

Message

Daniele Ceraolo Spurio March 13, 2019, 11:13 p.m. UTC
In some areas of the driver we do a really bad job in
compartmentalizing the code. While passing dev_priv everywhere is always
an easy solution, our driver is growing in ways in which this is getting
in the way. We really want to compartmentalize our classes and keep as
much code as we can under a controlled scope without relying on the God
Object dev_priv.

This series initiates a rework in this direction for the uncore code.
The intel_uncore class already abstracts most of the handling around
our register access, so passing it around instead of dev_priv in code
that relates to register interface makes sense.
For extra integration, the later part of the series (patch 7+) also moves
the regs pointer inside the uncore structure. This is just an initial
proposal and I'm open to alternative solution about this if we want to
keep them separate. I've detailed a couple of simple options in the commit
message of patch 7

Compile-tested only.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>

Daniele Ceraolo Spurio (10):
  drm/i915: do not pass dev_priv to low-level forcewake functions
  drm/i915: use intel_uncore in fw get/put internal paths
  drm/i915: use intel_uncore for all forcewake get/put
  drm/i915: make more uncore function work on intel_uncore
  drm/i915: make find_fw_domain work on intel_uncore
  drm/i915: reduce the dev_priv->uncore dance in uncore.c
  drm/i915: move regs pointer inside the uncore structure
  drm/i915: make raw access function work on uncore
  drm/i915: add uncore flags
  drm/i915: switch uncore mmio funcs to use intel_uncore

 drivers/gpu/drm/i915/gvt/mmio_context.c       |   8 +-
 drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
 drivers/gpu/drm/i915/i915_drv.c               |  32 +-
 drivers/gpu/drm/i915/i915_drv.h               |  46 +-
 drivers/gpu/drm/i915/i915_gem.c               |  20 +-
 drivers/gpu/drm/i915/i915_irq.c               |  22 +-
 drivers/gpu/drm/i915/i915_perf.c              |   6 +-
 drivers/gpu/drm/i915/i915_reset.c             |  12 +-
 drivers/gpu/drm/i915/i915_vgpu.c              |   8 +-
 drivers/gpu/drm/i915/intel_display.c          |   6 +-
 drivers/gpu/drm/i915/intel_engine_cs.c        |   4 +-
 drivers/gpu/drm/i915/intel_guc.c              |   8 +-
 drivers/gpu/drm/i915/intel_guc_fw.c           |   4 +-
 drivers/gpu/drm/i915/intel_hangcheck.c        |   2 +-
 drivers/gpu/drm/i915/intel_huc_fw.c           |   4 +-
 drivers/gpu/drm/i915/intel_lrc.c              |   6 +-
 drivers/gpu/drm/i915/intel_pm.c               |  52 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c       |   8 +-
 drivers/gpu/drm/i915/intel_uncore.c           | 827 +++++++++---------
 drivers/gpu/drm/i915/intel_uncore.h           |  76 +-
 drivers/gpu/drm/i915/intel_workarounds.c      |   4 +-
 drivers/gpu/drm/i915/selftests/intel_uncore.c |  15 +-
 .../gpu/drm/i915/selftests/mock_gem_device.c  |   2 +-
 drivers/gpu/drm/i915/selftests/mock_uncore.c  |  10 +-
 drivers/gpu/drm/i915/selftests/mock_uncore.h  |   2 +-
 25 files changed, 616 insertions(+), 585 deletions(-)