@@ -348,6 +348,7 @@ struct i915_ggtt {
struct mutex error_mutex;
struct drm_mm_node error_capture;
struct drm_mm_node uc_fw;
+ struct drm_mm_node balloon[4];
};
struct i915_ppgtt {
@@ -106,17 +106,6 @@ bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *dev_priv)
return dev_priv->vgpu.caps & VGT_CAPS_FULL_PPGTT;
}
-struct _balloon_info_ {
- /*
- * There are up to 2 regions per mappable/unmappable graphic
- * memory that might be ballooned. Here, index 0/1 is for mappable
- * graphic memory, 2/3 for unmappable graphic memory.
- */
- struct drm_mm_node space[4];
-};
-
-static struct _balloon_info_ bl_info;
-
/**
* intel_vgt_deballoon - deballoon reserved graphics address trunks
* @ggtt: the global GGTT from which we reserved earlier
@@ -134,7 +123,7 @@ void intel_vgt_deballoon(struct i915_ggtt *ggtt)
DRM_DEBUG("VGT deballoon.\n");
for (i = 0; i < 4; i++)
- i915_ggtt_deballoon(ggtt, &bl_info.space[i]);
+ i915_ggtt_deballoon(ggtt, &ggtt->balloon[i]);
}
/**
@@ -221,7 +210,7 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)
/* Unmappable graphic memory ballooning */
if (unmappable_base > ggtt->mappable_end) {
ret = i915_ggtt_balloon(ggtt, ggtt->mappable_end,
- unmappable_base, &bl_info.space[2]);
+ unmappable_base, &ggtt->balloon[2]);
if (ret)
goto err;
@@ -229,7 +218,7 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)
if (unmappable_end < ggtt_end) {
ret = i915_ggtt_balloon(ggtt, unmappable_end, ggtt_end,
- &bl_info.space[3]);
+ &ggtt->balloon[3]);
if (ret)
goto err_upon_mappable;
}
@@ -237,7 +226,7 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)
/* Mappable graphic memory ballooning */
if (mappable_base) {
ret = i915_ggtt_balloon(ggtt, 0, mappable_base,
- &bl_info.space[0]);
+ &ggtt->balloon[0]);
if (ret)
goto err_upon_unmappable;
@@ -245,7 +234,7 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)
if (mappable_end < ggtt->mappable_end) {
ret = i915_ggtt_balloon(ggtt, mappable_end, ggtt->mappable_end,
- &bl_info.space[1]);
+ &ggtt->balloon[1]);
if (ret)
goto err_below_mappable;
@@ -255,11 +244,11 @@ int intel_vgt_balloon(struct i915_ggtt *ggtt)
return 0;
err_below_mappable:
- i915_ggtt_deballoon(ggtt, &bl_info.space[0]);
+ i915_ggtt_deballoon(ggtt, &ggtt->balloon[0]);
err_upon_unmappable:
- i915_ggtt_deballoon(ggtt, &bl_info.space[3]);
+ i915_ggtt_deballoon(ggtt, &ggtt->balloon[3]);
err_upon_mappable:
- i915_ggtt_deballoon(ggtt, &bl_info.space[2]);
+ i915_ggtt_deballoon(ggtt, &ggtt->balloon[2]);
err:
DRM_ERROR("VGT balloon fail\n");
return ret;
Since VGT ballooning nodes are GGTT specific, we can move them to i915_ggtt struct close to some other similar nodes. This way we drop another place in driver that uses static data. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Xiong Zhang <xiong.y.zhang@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/gt/intel_gtt.h | 1 + drivers/gpu/drm/i915/i915_vgpu.c | 27 ++++++++------------------- 2 files changed, 9 insertions(+), 19 deletions(-)