mbox series

[v2,00/10] Compartmentalize uncore code

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

Message

Daniele Ceraolo Spurio March 19, 2019, 6:35 p.m. UTC
Compared to v1 [1], there is a new patch for further simplification of
low-level fw get/put by always using the bitmasks since the upper bits
of the fw reg are reserved on gen6 and I couldn't find any reason
writing them wouldn't work in the git history.
I put together a small selftest to trybot this on snb [2], if people
think it is worth adding it to the tree I can clean it up and send it
for review.

Apart from the above, addresses the review comments, the only
non-trivial one being moving the mmio setup under uncore.

[1] https://patchwork.freedesktop.org/series/57962/
[2] https://patchwork.freedesktop.org/patch/292852/?series=58159&rev=1

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>

Daniele Ceraolo Spurio (10):
  drm/i915: always use masks on FW regs
  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/gvt/scheduler.c          |   4 +-
 drivers/gpu/drm/i915/i915_debugfs.c           |  17 +-
 drivers/gpu/drm/i915/i915_drv.c               |  73 +-
 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              |   7 +-
 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           | 795 +++++++++---------
 drivers/gpu/drm/i915/intel_uncore.h           |  71 +-
 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 +-
 26 files changed, 615 insertions(+), 593 deletions(-)

Comments

Chris Wilson March 19, 2019, 6:59 p.m. UTC | #1
Quoting Daniele Ceraolo Spurio (2019-03-19 18:35:33)
> Compared to v1 [1], there is a new patch for further simplification of
> low-level fw get/put by always using the bitmasks since the upper bits
> of the fw reg are reserved on gen6 and I couldn't find any reason
> writing them wouldn't work in the git history.
> I put together a small selftest to trybot this on snb [2], if people
> think it is worth adding it to the tree I can clean it up and send it
> for review.
> 
> Apart from the above, addresses the review comments, the only
> non-trivial one being moving the mmio setup under uncore.
> 
> [1] https://patchwork.freedesktop.org/series/57962/
> [2] https://patchwork.freedesktop.org/patch/292852/?series=58159&rev=1

I thought so. You just need to verify that the fw count is zero at the
start of the loop and then flush the hrtimer instead of the imprecise
usleep().

Certainly worth checking out whether we can abuse the reserved bits :)
-Chris
Chris Wilson March 20, 2019, 11:34 a.m. UTC | #2
Quoting Chris Wilson (2019-03-19 18:59:04)
> Quoting Daniele Ceraolo Spurio (2019-03-19 18:35:33)
> > Compared to v1 [1], there is a new patch for further simplification of
> > low-level fw get/put by always using the bitmasks since the upper bits
> > of the fw reg are reserved on gen6 and I couldn't find any reason
> > writing them wouldn't work in the git history.
> > I put together a small selftest to trybot this on snb [2], if people
> > think it is worth adding it to the tree I can clean it up and send it
> > for review.
> > 
> > Apart from the above, addresses the review comments, the only
> > non-trivial one being moving the mmio setup under uncore.
> > 
> > [1] https://patchwork.freedesktop.org/series/57962/
> > [2] https://patchwork.freedesktop.org/patch/292852/?series=58159&rev=1
> 
> I thought so. You just need to verify that the fw count is zero at the
> start of the loop and then flush the hrtimer instead of the imprecise
> usleep().

After beating around the bush to find the right mix of registers that
give us the inspection we need, I've pushed your selftest. Hopefully
that holds up to soak testing and provides a nice early warning canary.
Thanks,
-Chris