From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [RFC 3/6] drm/i915: add enable_runtime_pm option
Date: Mon, 4 Nov 2013 23:36:06 +0200 [thread overview]
Message-ID: <20131104213606.GA13047@intel.com> (raw)
In-Reply-To: <1382966859.5775.76.camel@intelbox>
On Mon, Oct 28, 2013 at 03:27:39PM +0200, Imre Deak wrote:
> On Tue, 2013-10-22 at 17:30 -0200, Paulo Zanoni wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > And leave it off by default. We have way too many driver entry points,
> > we can't assume this will work without regressions without tons of
> > testing first. This option allows people to test and fix the problems.
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_dma.c | 4 ++--
> > drivers/gpu/drm/i915/i915_drv.c | 8 ++++++--
> > drivers/gpu/drm/i915/i915_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_pm.c | 4 ++--
> > 4 files changed, 11 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index 6aa044e..dd4f424 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1458,7 +1458,7 @@ static void i915_init_runtime_pm(struct drm_i915_private *dev_priv)
> >
> > dev_priv->pm.suspended = false;
> >
> > - if (!HAS_RUNTIME_PM(dev))
> > + if (!HAS_RUNTIME_PM(dev) || !i915_enable_runtime_pm)
> > return;
> >
> > pm_runtime_set_active(device);
> > @@ -1475,7 +1475,7 @@ static void i915_fini_runtime_pm(struct drm_i915_private *dev_priv)
> > struct drm_device *dev = dev_priv->dev;
> > struct device *device = &dev->pdev->dev;
> >
> > - if (!HAS_RUNTIME_PM(dev))
> > + if (!HAS_RUNTIME_PM(dev) || !i915_enable_runtime_pm)
> > return;
> >
> > /* Make sure we're not suspended first. */
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index a999a3f..c75b78f 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -154,6 +154,10 @@ module_param_named(prefault_disable, i915_prefault_disable, bool, 0600);
> > MODULE_PARM_DESC(prefault_disable,
> > "Disable page prefaulting for pread/pwrite/reloc (default:false). For developers only.");
> >
> > +int i915_enable_runtime_pm __read_mostly = 0;
> > +module_param_named(enable_runtime_pm, i915_enable_runtime_pm, int, 0600);
> > +MODULE_PARM_DESC(enable_runtime_pm, "Enable runtime PM on supported platforms (default: disabled)");
> > +
> > static struct drm_driver driver;
> > extern int intel_agp_enabled;
> >
> > @@ -890,7 +894,7 @@ static int i915_runtime_suspend(struct device *device)
> > struct drm_device *dev = pci_get_drvdata(pdev);
> > struct drm_i915_private *dev_priv = dev->dev_private;
> >
> > - WARN_ON(!HAS_RUNTIME_PM(dev));
> > + WARN_ON(!HAS_RUNTIME_PM(dev) || !i915_enable_runtime_pm);
> >
> > DRM_DEBUG_KMS("Suspending device\n");
> >
> > @@ -909,7 +913,7 @@ static int i915_runtime_resume(struct device *device)
> > struct drm_device *dev = pci_get_drvdata(pdev);
> > struct drm_i915_private *dev_priv = dev->dev_private;
> >
> > - WARN_ON(!HAS_RUNTIME_PM(dev));
> > + WARN_ON(!HAS_RUNTIME_PM(dev) || !i915_enable_runtime_pm);
>
> This could a problem if someone disables runtime_pm through sysfs while
> the device is suspended. One solution would be just to do a get/put in
> the handler of i915_enable_runtime_pm and not check for it afterwards.
There's already a standard interface for enabling/disabling runtime PM
under sysfs. Why do we want this custom one?
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2013-11-04 21:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 19:30 [RFC 0/6] Haswell runtime PM support + D3 Paulo Zanoni
2013-10-22 19:30 ` [RFC 1/6] drm/i915: add initial Runtime PM functions Paulo Zanoni
2013-10-28 13:21 ` Imre Deak
2013-11-06 20:32 ` Paulo Zanoni
2013-11-07 9:38 ` Imre Deak
2013-11-07 11:36 ` Imre Deak
2013-11-07 18:13 ` Imre Deak
2013-10-22 19:30 ` [RFC 2/6] drm/i915: do adapter power state notification at runtime PM Paulo Zanoni
2013-10-22 19:30 ` [RFC 3/6] drm/i915: add enable_runtime_pm option Paulo Zanoni
2013-10-28 13:27 ` Imre Deak
2013-11-04 21:36 ` Ville Syrjälä [this message]
2013-11-06 20:04 ` Paulo Zanoni
2013-10-22 19:30 ` [RFC 4/6] drm/i915: add runtime put/get calls at the basic places Paulo Zanoni
2013-10-22 19:30 ` [RFC 5/6] drm/i915: add some runtime PM get/put calls Paulo Zanoni
2013-10-22 19:30 ` [RFC 6/6] drm/i915: add runtime PM support on Haswell Paulo Zanoni
2013-10-25 13:44 ` [RFC i-g-t] tests: add runtime_pm Paulo Zanoni
2013-10-27 13:37 ` Daniel Vetter
2013-10-28 12:20 ` Paulo Zanoni
2013-10-28 16:05 ` Daniel Vetter
2013-11-04 21:40 ` Ville Syrjälä
2013-11-08 18:19 ` Paulo Zanoni
2013-11-08 18:42 ` Daniel Vetter
2013-10-28 13:09 ` [RFC 0/6] Haswell runtime PM support + D3 Imre Deak
2013-10-28 16:10 ` Daniel Vetter
2013-10-28 20:02 ` Jesse Barnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131104213606.GA13047@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.