drm/i915: vlv: reserve the GT power context only once during driver init
Subsystems (2)
PATCH 1/1 drm/i915: vlv: reserve the GT power context only once during driver init
Atm we reserve/allocate and free the power context during GT power enable/disable time. There is no need to do this, we can reserve/allocate the buffer once during driver loading and free it during driver cleanup. The re-reservation can also fail in case the driver previously manages to allocate something on the given fixed address.
The buffer isn't exepected to move even if allocated by the BIOS, for safety add an assert to check this assumption.
This also fixed a bug for Ville, where re-reserving the context failed during a GPU reset (I assume because something else got allocated on its fixed address).
--- drivers/gpu/drm/i915/intel_display.c | 8 +++++++ drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_pm.c | 41 ++++++++++++++++++++++++++++++------ 3 files changed, 44 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +8 -0
@@ -11759,6 +11759,10 @@ void intel_modeset_gem_init(struct drm_device *dev)struct drm_crtc *c;struct intel_framebuffer *fb; +mutex_lock (&dev->struct_mutex); +intel_init_gt_powersave (dev); +mutex_unlock (&dev->struct_mutex); +intel_modeset_init_hw (dev);intel_setup_overlay (dev);
@@ -11845,6 +11849,10 @@ void intel_modeset_cleanup(struct drm_device *dev)drm_mode_config_cleanup (dev);intel_cleanup_overlay (dev); + +mutex_lock (&dev->struct_mutex); +intel_cleanup_gt_powersave (dev); +mutex_unlock (&dev->struct_mutex); }/*
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -897,6 +897,8 @@ void intel_display_power_get(struct drm_i915_private *dev_priv,void intel_display_power_put (struct drm_i915_private *dev_priv,enum intel_display_power_domain domain);void intel_power_domains_init_hw (struct drm_i915_private *dev_priv); +void intel_init_gt_powersave (struct drm_device *dev); +void intel_cleanup_gt_powersave (struct drm_device *dev);void intel_enable_gt_powersave (struct drm_device *dev);void intel_disable_gt_powersave (struct drm_device *dev);void ironlake_teardown_rc6 (struct drm_device *dev);
drivers/gpu/drm/i915/intel_pm.c +34 -7
77 lines not on this page · raw message
Signature · 6 lines
1.8.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Imre Deak
Atm we reserve/allocate and free the power context during GT power enable/disable time. There is no need to do this, we can reserve/allocate the buffer once during driver loading and free it during driver cleanup. The re-reservation can also fail in case the driver previously manages to allocate something on the given fixed address.
Quoted 6 lines
The buffer isn't exepected to move even if allocated by the BIOS, for safety add an assert to check this assumption.
This also fixed a bug for Ville, where re-reserving the context failed during a GPU reset (I assume because something else got allocated on its fixed address).
I'm assuming it was the already existing pctx allocation that caused the warning. We just call intel_enable_gt_powersave() again during GPU reset w/o having called intel_disable_gt_powersave() anywhere. So no danger of clobbering the pctx AFAICS, but getting a WARN on every GPU reset is rather annoying.
Quoted 3 lines
Tested-by Ville Syrjälä <[email protected]>Signed-off-by Imre Deak <[email protected]>
The patch looks good to me.
<snip>
Signature · 2 lines
Ville Syrjälä Intel OTC
Daniel Vetter
AppliedQuoted 21 lines · Ville Syrjälä
Quoted 6 lines · Imre Deak
Atm we reserve/allocate and free the power context during GT power enable/disable time. There is no need to do this, we can reserve/allocate the buffer once during driver loading and free it during driver cleanup. The re-reservation can also fail in case the driver previously manages to allocate something on the given fixed address.
Quoted 6 lines
The buffer isn't exepected to move even if allocated by the BIOS, for safety add an assert to check this assumption.
This also fixed a bug for Ville, where re-reserving the context failed during a GPU reset (I assume because something else got allocated on its fixed address).
I'm assuming it was the already existing pctx allocation that caused the warning. We just call
intel_enable_gt_powersave()again during GPU reset w/o having calledintel_disable_gt_powersave()anywhere. So no danger of clobbering the pctx AFAICS, but getting a WARN on every GPU reset is rather annoying.Quoted 1 line
Quoted 6 lines
Quoted 2 lines
Tested-by Ville Syrjälä <[email protected]>Signed-off-by Imre Deak <[email protected]>The patch looks good to me.
Reviewed-by Ville Syrjälä <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch