Re: [Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume
Dear Jesse, unfortunately due to mail problems with SourceForge I did not get the latest series. Do you have a public repository with these patches in it? Am Mittwoch, den 31.10.2012, 15:41 -0700 schrieb Jesse Barnes: The console lock can be contended, so rather than prevent other drivers after us from being held up, queue the console suspend into the global work queue that can happen anytime. I've measured this to take around 200ms on my T420. Combined with the ring freq/turbo change, we should save almost 1/2 a second on resume. In #intel-gfx on irc.freenode.net, Daniel told me that this is mostly true for Sandybridge. Could you clarify that in the commit message please. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org […] Thanks, Paul signature.asc Description: This is a digitally signed message part ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume
On Sun, 04 Nov 2012 22:16:39 +0100 Paul Menzel paulepan...@users.sourceforge.net wrote: Dear Jesse, unfortunately due to mail problems with SourceForge I did not get the latest series. No I haven't pushed an updated version anywhere, but I think Daniel has them queued now? Do you have a public repository with these patches in it? Am Mittwoch, den 31.10.2012, 15:41 -0700 schrieb Jesse Barnes: The console lock can be contended, so rather than prevent other drivers after us from being held up, queue the console suspend into the global work queue that can happen anytime. I've measured this to take around 200ms on my T420. Combined with the ring freq/turbo change, we should save almost 1/2 a second on resume. In #intel-gfx on irc.freenode.net, Daniel told me that this is mostly true for Sandybridge. Could you clarify that in the commit message please. The fb resume and GTT rewrite patches will benefit every Intel gfx platform. The work queue for ring freq updates will benefit SNB+. Jesse ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume v2
Jesse Barnes jbar...@virtuousgeek.org writes: v2: use console_trylock() to try to resume the console immediately (Chris) This will cause other printks to stall if i915 grabs the lock first. Seems like a way to get random resume delays to me. -- keith.pack...@intel.com pgpas36b6iooM.pgp Description: PGP signature ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume
On Wed, 31 Oct 2012 15:41:02 -0700, Jesse Barnes jbar...@virtuousgeek.org wrote: The console lock can be contended, so rather than prevent other drivers after us from being held up, queue the console suspend into the global work queue that can happen anytime. I've measured this to take around 200ms on my T420. Combined with the ring freq/turbo change, we should save almost 1/2 a second on resume. Hmm, I'd rather not postpone the work unless actually contended, otherwise we may end up just increasing the resume time whilst avoiding the blame. Perhaps: if (console_trylock() { intel_fbdev_set_suspend(dev, 0); console_unlock(); } else schedule_work(dev_priv-console_resume_work); -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume v2
The console lock can be contended, so rather than prevent other drivers after us from being held up, queue the console suspend into the global work queue that can happen anytime. I've measured this to take around 200ms on my T420. Combined with the ring freq/turbo change, we should save almost 1/2 a second on resume. v2: use console_trylock() to try to resume the console immediately (Chris) Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org --- drivers/gpu/drm/i915/i915_dma.c |3 +++ drivers/gpu/drm/i915/i915_drv.c | 27 --- drivers/gpu/drm/i915/i915_drv.h |7 +++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index d04facb..14526dc 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1329,6 +1329,8 @@ static int i915_load_modeset_init(struct drm_device *dev) intel_modeset_gem_init(dev); + INIT_WORK(dev_priv-console_resume_work, intel_console_resume); + ret = drm_irq_install(dev); if (ret) goto cleanup_gem; @@ -1723,6 +1725,7 @@ int i915_driver_unload(struct drm_device *dev) if (drm_core_check_feature(dev, DRIVER_MODESET)) { intel_fbdev_fini(dev); intel_modeset_cleanup(dev); + cancel_work_sync(dev_priv-console_resume_work); /* * free the memory space allocated for the child device diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 4238853..bedf942 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -519,6 +519,18 @@ int i915_suspend(struct drm_device *dev, pm_message_t state) return 0; } +void intel_console_resume(struct work_struct *work) +{ + struct drm_i915_private *dev_priv = + container_of(work, struct drm_i915_private, +console_resume_work); + struct drm_device *dev = dev_priv-dev; + + console_lock(); + intel_fbdev_set_suspend(dev, 0); + console_unlock(); +} + static int i915_drm_thaw(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev-dev_private; @@ -555,9 +567,18 @@ static int i915_drm_thaw(struct drm_device *dev) dev_priv-modeset_on_lid = 0; - console_lock(); - intel_fbdev_set_suspend(dev, 0); - console_unlock(); + /* +* The console lock can be pretty contented on resume due +* to all the printk activity. Try to keep it out of the hot +* path of resume if possible. +*/ + if (console_trylock()) { + intel_fbdev_set_suspend(dev, 0); + console_unlock(); + } else { + schedule_work(dev_priv-console_resume_work); + } + return error; } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a2c5e89..045963d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -455,6 +455,12 @@ typedef struct drm_i915_private { u32 hotplug_supported_mask; struct work_struct hotplug_work; + /* +* The console may be contended at resume, but we don't +* want it to block on it. +*/ + struct work_struct console_resume_work; + int num_pipe; int num_pch_pll; @@ -1255,6 +1261,7 @@ extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); +extern void intel_console_resume(struct work_struct *work); /* i915_irq.c */ void i915_hangcheck_elapsed(unsigned long data); -- 1.7.9.5 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume v2
The console lock can be contended, so rather than prevent other drivers after us from being held up, queue the console suspend into the global work queue that can happen anytime. I've measured this to take around 200ms on my T420. Combined with the ring freq/turbo change, we should save almost 1/2 a second on resume. v2: use console_trylock() to try to resume the console immediately (Chris) Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org --- drivers/gpu/drm/i915/i915_dma.c |3 +++ drivers/gpu/drm/i915/i915_drv.c | 27 --- drivers/gpu/drm/i915/i915_drv.h |7 +++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index d04facb..14526dc 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1329,6 +1329,8 @@ static int i915_load_modeset_init(struct drm_device *dev) intel_modeset_gem_init(dev); + INIT_WORK(dev_priv-console_resume_work, intel_console_resume); + ret = drm_irq_install(dev); if (ret) goto cleanup_gem; @@ -1723,6 +1725,7 @@ int i915_driver_unload(struct drm_device *dev) if (drm_core_check_feature(dev, DRIVER_MODESET)) { intel_fbdev_fini(dev); intel_modeset_cleanup(dev); + cancel_work_sync(dev_priv-console_resume_work); /* * free the memory space allocated for the child device diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 4238853..bedf942 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -519,6 +519,18 @@ int i915_suspend(struct drm_device *dev, pm_message_t state) return 0; } +void intel_console_resume(struct work_struct *work) +{ + struct drm_i915_private *dev_priv = + container_of(work, struct drm_i915_private, +console_resume_work); + struct drm_device *dev = dev_priv-dev; + + console_lock(); + intel_fbdev_set_suspend(dev, 0); + console_unlock(); +} + static int i915_drm_thaw(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev-dev_private; @@ -555,9 +567,18 @@ static int i915_drm_thaw(struct drm_device *dev) dev_priv-modeset_on_lid = 0; - console_lock(); - intel_fbdev_set_suspend(dev, 0); - console_unlock(); + /* +* The console lock can be pretty contented on resume due +* to all the printk activity. Try to keep it out of the hot +* path of resume if possible. +*/ + if (console_trylock()) { + intel_fbdev_set_suspend(dev, 0); + console_unlock(); + } else { + schedule_work(dev_priv-console_resume_work); + } + return error; } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a2c5e89..045963d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -455,6 +455,12 @@ typedef struct drm_i915_private { u32 hotplug_supported_mask; struct work_struct hotplug_work; + /* +* The console may be contended at resume, but we don't +* want it to block on it. +*/ + struct work_struct console_resume_work; + int num_pipe; int num_pch_pll; @@ -1255,6 +1261,7 @@ extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); +extern void intel_console_resume(struct work_struct *work); /* i915_irq.c */ void i915_hangcheck_elapsed(unsigned long data); -- 1.7.9.5 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 1/4] drm/i915: don't block resume on fb console resume
The console lock can be contended, so rather than prevent other drivers after us from being held up, queue the console suspend into the global work queue that can happen anytime. I've measured this to take around 200ms on my T420. Combined with the ring freq/turbo change, we should save almost 1/2 a second on resume. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org --- drivers/gpu/drm/i915/i915_dma.c |3 +++ drivers/gpu/drm/i915/i915_drv.c | 17 ++--- drivers/gpu/drm/i915/i915_drv.h |7 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index d04facb..14526dc 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1329,6 +1329,8 @@ static int i915_load_modeset_init(struct drm_device *dev) intel_modeset_gem_init(dev); + INIT_WORK(dev_priv-console_resume_work, intel_console_resume); + ret = drm_irq_install(dev); if (ret) goto cleanup_gem; @@ -1723,6 +1725,7 @@ int i915_driver_unload(struct drm_device *dev) if (drm_core_check_feature(dev, DRIVER_MODESET)) { intel_fbdev_fini(dev); intel_modeset_cleanup(dev); + cancel_work_sync(dev_priv-console_resume_work); /* * free the memory space allocated for the child device diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 4238853..4cd7404 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -519,6 +519,18 @@ int i915_suspend(struct drm_device *dev, pm_message_t state) return 0; } +void intel_console_resume(struct work_struct *work) +{ + struct drm_i915_private *dev_priv = + container_of(work, struct drm_i915_private, +console_resume_work); + struct drm_device *dev = dev_priv-dev; + + console_lock(); + intel_fbdev_set_suspend(dev, 0); + console_unlock(); +} + static int i915_drm_thaw(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev-dev_private; @@ -555,9 +567,8 @@ static int i915_drm_thaw(struct drm_device *dev) dev_priv-modeset_on_lid = 0; - console_lock(); - intel_fbdev_set_suspend(dev, 0); - console_unlock(); + schedule_work(dev_priv-console_resume_work); + return error; } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a2c5e89..045963d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -455,6 +455,12 @@ typedef struct drm_i915_private { u32 hotplug_supported_mask; struct work_struct hotplug_work; + /* +* The console may be contended at resume, but we don't +* want it to block on it. +*/ + struct work_struct console_resume_work; + int num_pipe; int num_pch_pll; @@ -1255,6 +1261,7 @@ extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); +extern void intel_console_resume(struct work_struct *work); /* i915_irq.c */ void i915_hangcheck_elapsed(unsigned long data); -- 1.7.9.5 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx