[CI,01/33] drm/i915: Convert intel_vgt_(de)balloon to uncore
diff mbox series

Message ID 20190621070811.7006-1-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series
  • [CI,01/33] drm/i915: Convert intel_vgt_(de)balloon to uncore
Related show

Commit Message

Tvrtko Ursulin June 21, 2019, 7:07 a.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

More removal of implicit dev_priv from using old mmio accessors.

Furthermore these calls really operate on ggtt so it logically makes sense
if they take it as parameter.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c |  4 ++--
 drivers/gpu/drm/i915/i915_vgpu.c    | 24 ++++++++++++++----------
 drivers/gpu/drm/i915/i915_vgpu.h    |  4 ++--
 3 files changed, 18 insertions(+), 14 deletions(-)

Comments

Tvrtko Ursulin June 21, 2019, 12:50 p.m. UTC | #1
On 21/06/2019 08:49, Patchwork wrote:
> == Series Details ==
> 
> Series: series starting with [CI,01/33] drm/i915: Convert intel_vgt_(de)balloon to uncore
> URL   : https://patchwork.freedesktop.org/series/62496/
> State : success
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_6320 -> Patchwork_13381
> ====================================================
> 
> Summary
> -------
> 
>    **SUCCESS**
> 
>    No regressions found.
> 
>    External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/
> 
> Known issues
> ------------
> 
>    Here are the changes found in Patchwork_13381 that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>    * igt@i915_selftest@live_contexts:
>      - fi-kbl-x1275:       [PASS][1] -> [DMESG-FAIL][2] ([fdo#110235])
>     [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6320/fi-kbl-x1275/igt@i915_selftest@live_contexts.html
>     [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/fi-kbl-x1275/igt@i915_selftest@live_contexts.html
> 
>    * igt@vgem_basic@sysfs:
>      - fi-icl-u3:          [PASS][3] -> [DMESG-WARN][4] ([fdo#107724]) +1 similar issue
>     [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6320/fi-icl-u3/igt@vgem_basic@sysfs.html
>     [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/fi-icl-u3/igt@vgem_basic@sysfs.html
> 
>    
> #### Possible fixes ####
> 
>    * igt@i915_module_load@reload:
>      - fi-blb-e6850:       [INCOMPLETE][5] ([fdo#107718]) -> [PASS][6]
>     [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6320/fi-blb-e6850/igt@i915_module_load@reload.html
>     [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/fi-blb-e6850/igt@i915_module_load@reload.html
> 
>    * igt@i915_selftest@live_blt:
>      - fi-skl-iommu:       [INCOMPLETE][7] ([fdo#108602]) -> [PASS][8]
>     [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6320/fi-skl-iommu/igt@i915_selftest@live_blt.html
>     [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/fi-skl-iommu/igt@i915_selftest@live_blt.html
> 
>    * igt@kms_chamelium@hdmi-hpd-fast:
>      - fi-kbl-7500u:       [FAIL][9] ([fdo#109485]) -> [PASS][10]
>     [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6320/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
>     [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
> 
>    * igt@kms_frontbuffer_tracking@basic:
>      - fi-icl-u2:          [FAIL][11] ([fdo#103167]) -> [PASS][12]
>     [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6320/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html
>     [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13381/fi-icl-u2/igt@kms_frontbuffer_tracking@basic.html
> 
>    
>    [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
>    [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
>    [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
>    [fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
>    [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
>    [fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235
> 
> 
> Participating hosts (51 -> 44)
> ------------------------------
> 
>    Additional (1): fi-cml-u2
>    Missing    (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-icl-y fi-icl-dsi fi-bdw-samus
> 
> 
> Build changes
> -------------
> 
>    * Linux: CI_DRM_6320 -> Patchwork_13381
> 
>    CI_DRM_6320: 6c42b26a62077226edcc8014ee5bca0366ae133b @ git://anongit.freedesktop.org/gfx-ci/linux
>    IGT_5064: 22850c1906550fb97b405c019275dcfb34be8cf7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>    Patchwork_13381: 5eefeb04c29c48d77ba63263b61a4ca56a3fd514 @ git://anongit.freedesktop.org/gfx-ci/linux
> 
> 
> == Linux commits ==
> 
> 5eefeb04c29c drm/i915: Eliminate dual personality of i915_scratch_offset
> 18d2396124ea drm/i915: Rename i915_timeline to intel_timeline and move under gt
> 1e06a432b0b6 drm/i915: Make timelines gt centric
> 9d315c0ab0fe drm/i915: Save trip via top-level i915 in a few more places
> b2ea54bc79c9 drm/i915: Compartmentalize ring buffer creation
> e5143444dec7 drm/i915: Store ggtt pointer in intel_gt
> fea91a3802fb drm/i915: Compartmentalize i915_gem_init_ggtt
> 434b5ed7ccc4 drm/i915: Compartmentalize i915_ggtt_cleanup_hw
> 4bdbb1ce1bda drm/i915: Compartmentalize timeline_init/park/fini
> 5f5a8726e216 drm/i915: Move i915_gem_chipset_flush to intel_gt
> a5fd627fcf20 drm/i915: Convert i915_gem_flush_ggtt_writes to intel_gt
> 3e1ecd9c50d1 drm/i915: Compartmentalize i915_gem_suspend/restore_gtt_mappings
> 024c9b1906cf drm/i915: Store intel_gt backpointer in vm
> 88d56344f4da drm/i915: Make ggtt invalidation work on ggtt
> fae79514053f drm/i915: Compartmentalize i915_ggtt_init_hw
> 4797e618e7db drm/i915: Compartmentalize i915_ggtt_probe_hw
> 6b7188c27677 drm/i915: Stop using I915_READ/WRITE in intel_wopcm_init_hw
> acc6bf8adf46 drm/i915: Move intel_engines_resume into common init
> 9766e15093ba drm/i915: Convert i915_gem_init_hw to intel_gt
> f7489fb04cf9 drm/i915: Consolidate some open coded mmio rmw
> cc14354560a8 drm/i915: Convert i915_ppgtt_init_hw to intel_gt
> e66e0bd16555 drm/i915: Convert intel_mocs_init_l3cc_table to intel_gt
> 35ce8ec21338 drm/i915: Store backpointer to intel_gt in the engine
> 85345da4c6c3 drm/i915: Convert gt workarounds to intel_gt
> 03dd1a1caeb8 drm/i915: Convert init_unused_rings to intel_gt
> 5f83e2b7dac0 drm/i915: Use intel_uncore_rmw in intel_gt_init_swizzling
> 373e5dbe52ba drm/i915: Convert i915_gem_init_swizzling to intel_gt
> 83c819ce1ec3 drm/i915: Make i915_check_and_clear_faults take intel_gt
> 0fbc641c8480 drm/i915: Move intel_gt_pm_init under intel_gt_init_early
> dd8d717c7ec3 drm/i915: Store some backpointers in struct intel_gt
> acd94baa8745 drm/i915: Move intel_gt initialization to a separate file
> 4a3508a80c72 drm/i915: Introduce struct intel_gt as replacement for anonymous i915->gt
> b8c60e2d0b66 drm/i915: Convert intel_vgt_(de)balloon to uncore

Pushed, thanks for all the reviews!

Regards,

Tvrtko

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 5b858f675f29..685505f45991 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2811,7 +2811,7 @@  int i915_gem_init_ggtt(struct drm_i915_private *dev_priv)
 	ggtt->pin_bias = max_t(u32, I915_GTT_PAGE_SIZE,
 			       intel_wopcm_guc_size(&dev_priv->wopcm));
 
-	ret = intel_vgt_balloon(dev_priv);
+	ret = intel_vgt_balloon(ggtt);
 	if (ret)
 		return ret;
 
@@ -2882,7 +2882,7 @@  void i915_ggtt_cleanup_hw(struct drm_i915_private *dev_priv)
 	ggtt_release_guc_top(ggtt);
 
 	if (drm_mm_initialized(&ggtt->vm.mm)) {
-		intel_vgt_deballoon(dev_priv);
+		intel_vgt_deballoon(ggtt);
 		i915_address_space_fini(&ggtt->vm);
 	}
 
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 1a8f7c731126..9916bc6159b6 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -136,17 +136,17 @@  static void vgt_deballoon_space(struct i915_ggtt *ggtt,
  * This function is called to deallocate the ballooned-out graphic memory, when
  * driver is unloaded or when ballooning fails.
  */
-void intel_vgt_deballoon(struct drm_i915_private *dev_priv)
+void intel_vgt_deballoon(struct i915_ggtt *ggtt)
 {
 	int i;
 
-	if (!intel_vgpu_active(dev_priv))
+	if (!intel_vgpu_active(ggtt->vm.i915))
 		return;
 
 	DRM_DEBUG("VGT deballoon.\n");
 
 	for (i = 0; i < 4; i++)
-		vgt_deballoon_space(&dev_priv->ggtt, &bl_info.space[i]);
+		vgt_deballoon_space(ggtt, &bl_info.space[i]);
 }
 
 static int vgt_balloon_space(struct i915_ggtt *ggtt,
@@ -214,22 +214,26 @@  static int vgt_balloon_space(struct i915_ggtt *ggtt,
  * Returns:
  * zero on success, non-zero if configuration invalid or ballooning failed
  */
-int intel_vgt_balloon(struct drm_i915_private *dev_priv)
+int intel_vgt_balloon(struct i915_ggtt *ggtt)
 {
-	struct i915_ggtt *ggtt = &dev_priv->ggtt;
+	struct intel_uncore *uncore = &ggtt->vm.i915->uncore;
 	unsigned long ggtt_end = ggtt->vm.total;
 
 	unsigned long mappable_base, mappable_size, mappable_end;
 	unsigned long unmappable_base, unmappable_size, unmappable_end;
 	int ret;
 
-	if (!intel_vgpu_active(dev_priv))
+	if (!intel_vgpu_active(ggtt->vm.i915))
 		return 0;
 
-	mappable_base = I915_READ(vgtif_reg(avail_rs.mappable_gmadr.base));
-	mappable_size = I915_READ(vgtif_reg(avail_rs.mappable_gmadr.size));
-	unmappable_base = I915_READ(vgtif_reg(avail_rs.nonmappable_gmadr.base));
-	unmappable_size = I915_READ(vgtif_reg(avail_rs.nonmappable_gmadr.size));
+	mappable_base =
+	  intel_uncore_read(uncore, vgtif_reg(avail_rs.mappable_gmadr.base));
+	mappable_size =
+	  intel_uncore_read(uncore, vgtif_reg(avail_rs.mappable_gmadr.size));
+	unmappable_base =
+	  intel_uncore_read(uncore, vgtif_reg(avail_rs.nonmappable_gmadr.base));
+	unmappable_size =
+	  intel_uncore_read(uncore, vgtif_reg(avail_rs.nonmappable_gmadr.size));
 
 	mappable_end = mappable_base + mappable_size;
 	unmappable_end = unmappable_base + unmappable_size;
diff --git a/drivers/gpu/drm/i915/i915_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
index a919735fb6ce..8dd7497eda15 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.h
+++ b/drivers/gpu/drm/i915/i915_vgpu.h
@@ -42,7 +42,7 @@  intel_vgpu_has_huge_gtt(struct drm_i915_private *dev_priv)
 	return dev_priv->vgpu.caps & VGT_CAPS_HUGE_GTT;
 }
 
-int intel_vgt_balloon(struct drm_i915_private *dev_priv);
-void intel_vgt_deballoon(struct drm_i915_private *dev_priv);
+int intel_vgt_balloon(struct i915_ggtt *ggtt);
+void intel_vgt_deballoon(struct i915_ggtt *ggtt);
 
 #endif /* _I915_VGPU_H_ */