All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: alsa-devel@alsa-project.org, Chris Wilson <chris@chris-wilson.co.uk>
Subject: [PATCH 1/3] drm/i915/audio: Track temporary rpm wakerefs
Date: Mon, 14 Jan 2019 17:37:51 +0000	[thread overview]
Message-ID: <20190114173753.472-1-chris@chris-wilson.co.uk> (raw)

Track the temporary rpm wakerefs used within audio so that they may be
marked as complete and the tracking cancelled upon release.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_audio.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index de26cd0a5497..92e27359c2e3 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -756,12 +756,13 @@ static void i915_audio_component_codec_wake_override(struct device *kdev,
 						     bool enable)
 {
 	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
+	intel_wakeref_t wakeref;
 	u32 tmp;
 
 	if (!IS_GEN(dev_priv, 9))
 		return;
 
-	i915_audio_component_get_power(kdev);
+	wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
 
 	/*
 	 * Enable/disable generating the codec wake signal, overriding the
@@ -779,7 +780,7 @@ static void i915_audio_component_codec_wake_override(struct device *kdev,
 		usleep_range(1000, 1500);
 	}
 
-	i915_audio_component_put_power(kdev);
+	intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, wakeref);
 }
 
 /* Get CDCLK in kHz  */
@@ -850,12 +851,13 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,
 	struct i915_audio_component *acomp = dev_priv->audio_component;
 	struct intel_encoder *encoder;
 	struct intel_crtc *crtc;
+	intel_wakeref_t wakeref;
 	int err = 0;
 
 	if (!HAS_DDI(dev_priv))
 		return 0;
 
-	i915_audio_component_get_power(kdev);
+	wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
 	mutex_lock(&dev_priv->av_mutex);
 
 	/* 1. get the pipe */
@@ -875,7 +877,7 @@ static int i915_audio_component_sync_audio_rate(struct device *kdev, int port,
 
  unlock:
 	mutex_unlock(&dev_priv->av_mutex);
-	i915_audio_component_put_power(kdev);
+	intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, wakeref);
 	return err;
 }
 
-- 
2.20.1

             reply	other threads:[~2019-01-14 17:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 17:37 Chris Wilson [this message]
2019-01-14 17:37 ` [PATCH 2/3] snd/hda: Track the display_power_status using a cookie Chris Wilson
2019-01-14 17:54   ` Takashi Iwai
2019-01-14 21:11     ` Chris Wilson
2019-01-14 17:37 ` [PATCH 3/3] snd/hda: Protect concurrent display_power_status with a mutex Chris Wilson
2019-01-14 17:46   ` Takashi Iwai
2019-01-14 17:51     ` Chris Wilson
2019-01-14 18:00       ` Takashi Iwai
2019-01-14 20:57         ` Chris Wilson
2019-01-14 21:18           ` Takashi Iwai
2019-01-14 18:07 ` [PATCH 1/3] drm/i915/audio: Track temporary rpm wakerefs John Harrison
2019-01-14 18:21 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] " Patchwork
2019-01-14 19:14 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-15  0:29 ` ✓ Fi.CI.IGT: " Patchwork

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=20190114173753.472-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.