From: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC 3/6] drm/i915: introduce runtime get/put based on display activity
Date: Mon, 24 Feb 2014 10:51:32 +0530 [thread overview]
Message-ID: <530AD6DC.6060607@intel.com> (raw)
In-Reply-To: <CA+gsUGQzxv1HUS3fTJvJRzdQV5PDELDmi3UfnwUpz9Yn=dXzMg@mail.gmail.com>
On 01/22/2014 07:10 PM, Paulo Zanoni wrote:
> Hi
>
> 2014/1/22 <naresh.kumar.kachhi@intel.com>:
>> From: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
>>
>> Once the display is disabled, we need to call runtime_put to
>> make sure Runtime framework triggers runtime_suspend based on
>> idleness. Similarly when display gets enabled, runtime_get should
>> be called. We have similiar function for pc8 feature, but some
>> platform(BYT) might not have pc8 feature, so creating a generic
>> function for runtime_pm
> Does this patch series help you somehow?
> http://lists.freedesktop.org/archives/intel-gfx/2013-December/037721.html
Yes, this patch series helps here. Do we know when these patches will
bemerged to nightly build?
>> Signed-off-by: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_drv.h | 2 ++
>> drivers/gpu/drm/i915/intel_drv.h | 1 +
>> drivers/gpu/drm/i915/intel_pm.c | 50 ++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 53 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index d1399f9..6a6f046 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -1325,6 +1325,8 @@ struct i915_package_c8 {
>> struct i915_runtime_pm {
>> bool suspended;
>> bool gpu_idle;
>> + bool disp_idle;
>> + struct mutex lock;
>> };
>>
>> enum intel_pipe_crc_source {
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index 9061aa7..94a6127 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -887,6 +887,7 @@ void intel_init_runtime_pm(struct drm_i915_private *dev_priv);
>> void intel_fini_runtime_pm(struct drm_i915_private *dev_priv);
>> void intel_runtime_pm_gpu_busy(struct drm_i915_private *dev_priv);
>> void intel_runtime_pm_gpu_idle(struct drm_i915_private *dev_priv);
>> +void intel_runtime_update_disp_state(struct drm_i915_private *dev_priv);
>> void ilk_wm_get_hw_state(struct drm_device *dev);
>>
>>
>> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
>> index 991ff62..9d6d0e1 100644
>> --- a/drivers/gpu/drm/i915/intel_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_pm.c
>> @@ -5501,6 +5501,54 @@ void intel_runtime_pm_gpu_busy(struct drm_i915_private *dev_priv)
>> }
>> }
>>
>> +static void intel_runtime_pm_disp_idle(struct drm_i915_private *dev_priv)
>> +{
>> + if (!HAS_RUNTIME_PM(dev_priv->dev))
>> + return;
>> +
>> + mutex_lock(&dev_priv->pm.lock);
>> + if (!dev_priv->pm.disp_idle) {
>> + dev_priv->pm.disp_idle = true;
>> + intel_runtime_pm_put(dev_priv);
>> + }
>> + mutex_unlock(&dev_priv->pm.lock);
>> +}
>> +
>> +static void intel_runtime_pm_disp_busy(struct drm_i915_private *dev_priv)
>> +{
>> + if (!HAS_RUNTIME_PM(dev_priv->dev))
>> + return;
>> +
>> + mutex_lock(&dev_priv->pm.lock);
>> + if (dev_priv->pm.disp_idle) {
>> + dev_priv->pm.disp_idle = false;
>> + /* This call is coming from an IOCTL so we have already done a
>> + * get_sync. get_noresume should suffice here
>> + */
>> + intel_runtime_pm_get_noresume(dev_priv);
>> + }
>> + mutex_unlock(&dev_priv->pm.lock);
>> +}
>> +
>> +void intel_runtime_update_disp_state(struct drm_i915_private *dev_priv)
>> +{
>> + struct drm_device *dev = dev_priv->dev;
>> + struct intel_crtc *crtc;
>> + bool enabled = false;
>> +
>> + if (!HAS_RUNTIME_PM(dev_priv->dev))
>> + return;
>> +
>> + list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head)
>> + enabled |= crtc->base.enabled;
>> +
>> + if (enabled)
>> + intel_runtime_pm_disp_busy(dev_priv);
>> + else
>> + intel_runtime_pm_disp_idle(dev_priv);
>> +
>> +}
>> +
>> void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
>> {
>> struct drm_device *dev = dev_priv->dev;
>> @@ -5547,6 +5595,8 @@ void intel_init_runtime_pm(struct drm_i915_private *dev_priv)
>>
>> dev_priv->pm.suspended = false;
>> dev_priv->pm.gpu_idle = true;
>> + dev_priv->pm.disp_idle = true;
>> + mutex_init(&dev_priv->pm.lock);
>>
>> if (!HAS_RUNTIME_PM(dev))
>> return;
>> --
>> 1.8.1.2
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
next prev parent reply other threads:[~2014-02-24 5:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 12:04 [RFC 0/6] enabling runtime on BYT naresh.kumar.kachhi
2014-01-22 12:04 ` [RFC 1/6] drm/i915: cover ioctls with runtime_get/put naresh.kumar.kachhi
2014-01-22 12:51 ` Daniel Vetter
2014-01-22 13:23 ` Imre Deak
2014-01-24 15:05 ` Naresh Kumar Kachhi
2014-01-24 15:56 ` Paulo Zanoni
2014-02-24 5:17 ` Naresh Kumar Kachhi
2014-01-24 17:23 ` Imre Deak
2014-02-21 20:07 ` Jesse Barnes
2014-02-24 5:30 ` Naresh Kumar Kachhi
2014-01-22 13:35 ` Paulo Zanoni
2014-01-22 12:04 ` [RFC 2/6] drm/i915: cover ring access with rpm get/put naresh.kumar.kachhi
2014-01-22 13:39 ` Paulo Zanoni
2014-01-22 12:04 ` [RFC 3/6] drm/i915: introduce runtime get/put based on display activity naresh.kumar.kachhi
2014-01-22 13:40 ` Paulo Zanoni
2014-02-24 5:21 ` Naresh Kumar Kachhi [this message]
2014-01-22 12:04 ` [RFC 4/6] drm/i915/vlv: call runtime get/put based on disp activity naresh.kumar.kachhi
2014-01-22 12:04 ` [RFC 5/6] drm/i915: device specific runtime suspend/resume naresh.kumar.kachhi
2014-01-22 12:58 ` Daniel Vetter
2014-01-24 15:23 ` Naresh Kumar Kachhi
2014-01-22 12:04 ` [RFC 6/6] FOR_UPSTREAM [VPG]: drm/i915: call init_runtime_pm before gem_init naresh.kumar.kachhi
2014-01-22 13:44 ` Paulo Zanoni
2014-01-24 15:11 ` Naresh Kumar Kachhi
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=530AD6DC.6060607@intel.com \
--to=naresh.kumar.kachhi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=przanoni@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox