All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: s/intel_modeset_disable/intel_modeset_hw_freeze/
@ 2012-12-17 14:51 Daniel Vetter
  2012-12-17 15:10 ` Chris Wilson
  2012-12-17 15:10 ` Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-12-17 14:51 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Chris Wilson rightfully complained that the name of this function is
misleading - it suggests that it's a generic means to disable all
outputs (and also update all the sw side tracking of the modeset
state). In effect it only disables the hw to quiescent it in the
freeze callbacks for suspend/hibernate - since thaw will read-out the
entire hw state again anyway and so scrap the sw tracking, we don't
need to update the driver state.

Also add a comment in the code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.c      |    2 +-
 drivers/gpu/drm/i915/intel_display.c |    4 +++-
 drivers/gpu/drm/i915/intel_drv.h     |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 530db83..b2c4ee6 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -483,7 +483,7 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 		cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
 
-		intel_modeset_disable(dev);
+		intel_modeset_hw_freeze(dev);
 
 		drm_irq_uninstall(dev);
 	}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 31844fa..0a7c955 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3807,10 +3807,12 @@ static void intel_crtc_disable(struct drm_crtc *crtc)
 	}
 }
 
-void intel_modeset_disable(struct drm_device *dev)
+void intel_modeset_hw_freeze(struct drm_device *dev)
 {
 	struct drm_crtc *crtc;
 
+	/* No need to update the sw tracking of the hw state - at resume time
+	 * the hw state readout will overwrite it anyway. */
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 		if (crtc->enabled)
 			intel_crtc_disable(crtc);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 8a1bd4a..951d0ab 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -504,7 +504,7 @@ struct intel_set_config {
 
 extern bool intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
 			   int x, int y, struct drm_framebuffer *old_fb);
-extern void intel_modeset_disable(struct drm_device *dev);
+extern void intel_modeset_hw_freeze(struct drm_device *dev);
 extern void intel_crtc_load_lut(struct drm_crtc *crtc);
 extern void intel_crtc_update_dpms(struct drm_crtc *crtc);
 extern void intel_encoder_noop(struct drm_encoder *encoder);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: s/intel_modeset_disable/intel_modeset_hw_freeze/
  2012-12-17 14:51 [PATCH] drm/i915: s/intel_modeset_disable/intel_modeset_hw_freeze/ Daniel Vetter
@ 2012-12-17 15:10 ` Chris Wilson
  2012-12-17 15:10 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2012-12-17 15:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Mon, 17 Dec 2012 15:51:57 +0100, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Chris Wilson rightfully complained that the name of this function is
> misleading - it suggests that it's a generic means to disable all
> outputs (and also update all the sw side tracking of the modeset
> state). In effect it only disables the hw to quiescent it in the
> freeze callbacks for suspend/hibernate - since thaw will read-out the
> entire hw state again anyway and so scrap the sw tracking, we don't
> need to update the driver state.
> 
> Also add a comment in the code.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

A nice improvement and stops me from wanting to call it -- it would have
been a nasty mistake.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: s/intel_modeset_disable/intel_modeset_hw_freeze/
  2012-12-17 14:51 [PATCH] drm/i915: s/intel_modeset_disable/intel_modeset_hw_freeze/ Daniel Vetter
  2012-12-17 15:10 ` Chris Wilson
@ 2012-12-17 15:10 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2012-12-17 15:10 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Mon, 17 Dec 2012 15:51:57 +0100, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Chris Wilson rightfully complained that the name of this function is
> misleading - it suggests that it's a generic means to disable all
> outputs (and also update all the sw side tracking of the modeset
> state). In effect it only disables the hw to quiescent it in the
> freeze callbacks for suspend/hibernate - since thaw will read-out the
> entire hw state again anyway and so scrap the sw tracking, we don't
> need to update the driver state.
> 
> Also add a comment in the code.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Forgot the r-b,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-17 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 14:51 [PATCH] drm/i915: s/intel_modeset_disable/intel_modeset_hw_freeze/ Daniel Vetter
2012-12-17 15:10 ` Chris Wilson
2012-12-17 15:10 ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.