* [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend @ 2013-12-13 17:22 Paulo Zanoni 2013-12-13 17:22 ` [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 Paulo Zanoni ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Paulo Zanoni @ 2013-12-13 17:22 UTC (permalink / raw) To: intel-gfx; +Cc: Paulo Zanoni From: Paulo Zanoni <paulo.r.zanoni@intel.com> The hangcheck function requires the hardware to be working, and if we're suspending we're going to put the HW in D3 state. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> --- drivers/gpu/drm/i915/i915_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index e7a6c84..70590b0 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -920,6 +920,7 @@ static int i915_runtime_suspend(struct device *device) DRM_DEBUG_KMS("Suspending device\n"); + del_timer_sync(&dev_priv->gpu_error.hangcheck_timer); dev_priv->pm.suspended = true; intel_opregion_notify_adapter(dev, PCI_D3cold); -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 2013-12-13 17:22 [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Paulo Zanoni @ 2013-12-13 17:22 ` Paulo Zanoni 2013-12-13 18:22 ` Rodrigo Vivi 2013-12-13 17:22 ` [PATCH 3/3] drm/i915: add runtime PM support on Haswell Paulo Zanoni 2013-12-13 18:08 ` [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Rodrigo Vivi 2 siblings, 1 reply; 7+ messages in thread From: Paulo Zanoni @ 2013-12-13 17:22 UTC (permalink / raw) To: intel-gfx; +Cc: Paulo Zanoni From: Paulo Zanoni <paulo.r.zanoni@intel.com> So we'll get a fault when someone tries to access the mmap, then we'll wake up from D3. v2: - Rebase v3: - Use gtt active/inactive Testcase: igt/pm_pc8/gem-mmap-gtt Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> --- drivers/gpu/drm/i915/i915_drv.c | 2 ++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 70590b0..23f8217 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -920,6 +920,8 @@ static int i915_runtime_suspend(struct device *device) DRM_DEBUG_KMS("Suspending device\n"); + i915_gem_release_all_mmaps(dev_priv); + del_timer_sync(&dev_priv->gpu_error.hangcheck_timer); dev_priv->pm.suspended = true; intel_opregion_notify_adapter(dev, PCI_D3cold); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index fca2eb6..5e036be 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2013,6 +2013,7 @@ void i915_gem_object_unpin(struct drm_i915_gem_object *obj); int __must_check i915_vma_unbind(struct i915_vma *vma); int __must_check i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj); int i915_gem_object_put_pages(struct drm_i915_gem_object *obj); +void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv); void i915_gem_release_mmap(struct drm_i915_gem_object *obj); void i915_gem_lastclose(struct drm_device *dev); diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 66f8133..0d7c061 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1465,6 +1465,16 @@ out: return ret; } +void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv) +{ + struct i915_vma *vma; + + list_for_each_entry(vma, &dev_priv->gtt.base.active_list, mm_list) + i915_gem_release_mmap(vma->obj); + list_for_each_entry(vma, &dev_priv->gtt.base.inactive_list, mm_list) + i915_gem_release_mmap(vma->obj); +} + /** * i915_gem_release_mmap - remove physical page mappings * @obj: obj in question -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 2013-12-13 17:22 ` [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 Paulo Zanoni @ 2013-12-13 18:22 ` Rodrigo Vivi 2013-12-14 14:36 ` Daniel Vetter 0 siblings, 1 reply; 7+ messages in thread From: Rodrigo Vivi @ 2013-12-13 18:22 UTC (permalink / raw) To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni When I saw this I was afraid this force could break userspace somehow, but Paulo explained me the release with pagefault mechanism. Thanks Paulo. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> On Fri, Dec 13, 2013 at 3:22 PM, Paulo Zanoni <przanoni@gmail.com> wrote: > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > > So we'll get a fault when someone tries to access the mmap, then we'll > wake up from D3. > > v2: - Rebase > v3: - Use gtt active/inactive > > Testcase: igt/pm_pc8/gem-mmap-gtt > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > --- > drivers/gpu/drm/i915/i915_drv.c | 2 ++ > drivers/gpu/drm/i915/i915_drv.h | 1 + > drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++++ > 3 files changed, 13 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index 70590b0..23f8217 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -920,6 +920,8 @@ static int i915_runtime_suspend(struct device *device) > > DRM_DEBUG_KMS("Suspending device\n"); > > + i915_gem_release_all_mmaps(dev_priv); > + > del_timer_sync(&dev_priv->gpu_error.hangcheck_timer); > dev_priv->pm.suspended = true; > intel_opregion_notify_adapter(dev, PCI_D3cold); > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index fca2eb6..5e036be 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -2013,6 +2013,7 @@ void i915_gem_object_unpin(struct drm_i915_gem_object *obj); > int __must_check i915_vma_unbind(struct i915_vma *vma); > int __must_check i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj); > int i915_gem_object_put_pages(struct drm_i915_gem_object *obj); > +void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv); > void i915_gem_release_mmap(struct drm_i915_gem_object *obj); > void i915_gem_lastclose(struct drm_device *dev); > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index 66f8133..0d7c061 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -1465,6 +1465,16 @@ out: > return ret; > } > > +void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv) > +{ > + struct i915_vma *vma; > + > + list_for_each_entry(vma, &dev_priv->gtt.base.active_list, mm_list) > + i915_gem_release_mmap(vma->obj); > + list_for_each_entry(vma, &dev_priv->gtt.base.inactive_list, mm_list) > + i915_gem_release_mmap(vma->obj); > +} > + > /** > * i915_gem_release_mmap - remove physical page mappings > * @obj: obj in question > -- > 1.8.3.1 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Rodrigo Vivi Blog: http://blog.vivi.eng.br ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 2013-12-13 18:22 ` Rodrigo Vivi @ 2013-12-14 14:36 ` Daniel Vetter 0 siblings, 0 replies; 7+ messages in thread From: Daniel Vetter @ 2013-12-14 14:36 UTC (permalink / raw) To: Rodrigo Vivi; +Cc: intel-gfx, Paulo Zanoni On Fri, Dec 13, 2013 at 04:22:40PM -0200, Rodrigo Vivi wrote: > When I saw this I was afraid this force could break userspace somehow, > but Paulo explained me the release with pagefault mechanism. Thanks Paulo. > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> Merged all three patches with the small changes added to this one as per our irc discussion. -Daniel > > On Fri, Dec 13, 2013 at 3:22 PM, Paulo Zanoni <przanoni@gmail.com> wrote: > > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > > > > So we'll get a fault when someone tries to access the mmap, then we'll > > wake up from D3. > > > > v2: - Rebase > > v3: - Use gtt active/inactive > > > > Testcase: igt/pm_pc8/gem-mmap-gtt > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > > --- > > drivers/gpu/drm/i915/i915_drv.c | 2 ++ > > drivers/gpu/drm/i915/i915_drv.h | 1 + > > drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++++ > > 3 files changed, 13 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > > index 70590b0..23f8217 100644 > > --- a/drivers/gpu/drm/i915/i915_drv.c > > +++ b/drivers/gpu/drm/i915/i915_drv.c > > @@ -920,6 +920,8 @@ static int i915_runtime_suspend(struct device *device) > > > > DRM_DEBUG_KMS("Suspending device\n"); > > > > + i915_gem_release_all_mmaps(dev_priv); > > + > > del_timer_sync(&dev_priv->gpu_error.hangcheck_timer); > > dev_priv->pm.suspended = true; > > intel_opregion_notify_adapter(dev, PCI_D3cold); > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > > index fca2eb6..5e036be 100644 > > --- a/drivers/gpu/drm/i915/i915_drv.h > > +++ b/drivers/gpu/drm/i915/i915_drv.h > > @@ -2013,6 +2013,7 @@ void i915_gem_object_unpin(struct drm_i915_gem_object *obj); > > int __must_check i915_vma_unbind(struct i915_vma *vma); > > int __must_check i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj); > > int i915_gem_object_put_pages(struct drm_i915_gem_object *obj); > > +void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv); > > void i915_gem_release_mmap(struct drm_i915_gem_object *obj); > > void i915_gem_lastclose(struct drm_device *dev); > > > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > > index 66f8133..0d7c061 100644 > > --- a/drivers/gpu/drm/i915/i915_gem.c > > +++ b/drivers/gpu/drm/i915/i915_gem.c > > @@ -1465,6 +1465,16 @@ out: > > return ret; > > } > > > > +void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv) > > +{ > > + struct i915_vma *vma; > > + > > + list_for_each_entry(vma, &dev_priv->gtt.base.active_list, mm_list) > > + i915_gem_release_mmap(vma->obj); > > + list_for_each_entry(vma, &dev_priv->gtt.base.inactive_list, mm_list) > > + i915_gem_release_mmap(vma->obj); > > +} > > + > > /** > > * i915_gem_release_mmap - remove physical page mappings > > * @obj: obj in question > > -- > > 1.8.3.1 > > > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > > > -- > Rodrigo Vivi > Blog: http://blog.vivi.eng.br > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] drm/i915: add runtime PM support on Haswell 2013-12-13 17:22 [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Paulo Zanoni 2013-12-13 17:22 ` [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 Paulo Zanoni @ 2013-12-13 17:22 ` Paulo Zanoni 2013-12-13 18:23 ` Rodrigo Vivi 2013-12-13 18:08 ` [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Rodrigo Vivi 2 siblings, 1 reply; 7+ messages in thread From: Paulo Zanoni @ 2013-12-13 17:22 UTC (permalink / raw) To: intel-gfx; +Cc: Paulo Zanoni From: Paulo Zanoni <paulo.r.zanoni@intel.com> Now that all the infrastructure is in place and all the tests from pm_pc8 pass, we can finally enable the feature. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> --- drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5e036be..5606f8d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1848,7 +1848,7 @@ struct drm_i915_file_private { #define HAS_FPGA_DBG_UNCLAIMED(dev) (INTEL_INFO(dev)->has_fpga_dbg) #define HAS_PSR(dev) (IS_HASWELL(dev) || IS_BROADWELL(dev)) #define HAS_PC8(dev) (IS_HASWELL(dev)) /* XXX HSW:ULX */ -#define HAS_RUNTIME_PM(dev) false +#define HAS_RUNTIME_PM(dev) (IS_HASWELL(dev)) #define INTEL_PCH_DEVICE_ID_MASK 0xff00 #define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] drm/i915: add runtime PM support on Haswell 2013-12-13 17:22 ` [PATCH 3/3] drm/i915: add runtime PM support on Haswell Paulo Zanoni @ 2013-12-13 18:23 ` Rodrigo Vivi 0 siblings, 0 replies; 7+ messages in thread From: Rodrigo Vivi @ 2013-12-13 18:23 UTC (permalink / raw) To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni \o/ Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> On Fri, Dec 13, 2013 at 3:22 PM, Paulo Zanoni <przanoni@gmail.com> wrote: > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > > Now that all the infrastructure is in place and all the tests from > pm_pc8 pass, we can finally enable the feature. > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > --- > drivers/gpu/drm/i915/i915_drv.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index 5e036be..5606f8d 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -1848,7 +1848,7 @@ struct drm_i915_file_private { > #define HAS_FPGA_DBG_UNCLAIMED(dev) (INTEL_INFO(dev)->has_fpga_dbg) > #define HAS_PSR(dev) (IS_HASWELL(dev) || IS_BROADWELL(dev)) > #define HAS_PC8(dev) (IS_HASWELL(dev)) /* XXX HSW:ULX */ > -#define HAS_RUNTIME_PM(dev) false > +#define HAS_RUNTIME_PM(dev) (IS_HASWELL(dev)) > > #define INTEL_PCH_DEVICE_ID_MASK 0xff00 > #define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 > -- > 1.8.3.1 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Rodrigo Vivi Blog: http://blog.vivi.eng.br ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend 2013-12-13 17:22 [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Paulo Zanoni 2013-12-13 17:22 ` [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 Paulo Zanoni 2013-12-13 17:22 ` [PATCH 3/3] drm/i915: add runtime PM support on Haswell Paulo Zanoni @ 2013-12-13 18:08 ` Rodrigo Vivi 2 siblings, 0 replies; 7+ messages in thread From: Rodrigo Vivi @ 2013-12-13 18:08 UTC (permalink / raw) To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> On Fri, Dec 13, 2013 at 3:22 PM, Paulo Zanoni <przanoni@gmail.com> wrote: > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > > The hangcheck function requires the hardware to be working, and if > we're suspending we're going to put the HW in D3 state. > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > --- > drivers/gpu/drm/i915/i915_drv.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index e7a6c84..70590b0 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -920,6 +920,7 @@ static int i915_runtime_suspend(struct device *device) > > DRM_DEBUG_KMS("Suspending device\n"); > > + del_timer_sync(&dev_priv->gpu_error.hangcheck_timer); > dev_priv->pm.suspended = true; > intel_opregion_notify_adapter(dev, PCI_D3cold); > > -- > 1.8.3.1 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Rodrigo Vivi Blog: http://blog.vivi.eng.br ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-12-14 14:35 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-12-13 17:22 [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Paulo Zanoni 2013-12-13 17:22 ` [PATCH 2/3] drm/i915: release the GTT mmaps when going into D3 Paulo Zanoni 2013-12-13 18:22 ` Rodrigo Vivi 2013-12-14 14:36 ` Daniel Vetter 2013-12-13 17:22 ` [PATCH 3/3] drm/i915: add runtime PM support on Haswell Paulo Zanoni 2013-12-13 18:23 ` Rodrigo Vivi 2013-12-13 18:08 ` [PATCH 1/3] drm/i915: cancel the hangcheck before runtime suspend Rodrigo Vivi
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.