From patchwork Mon Jan 14 17:37:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10763233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CAA0184E for ; Mon, 14 Jan 2019 17:38:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26169290C4 for ; Mon, 14 Jan 2019 17:38:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A67129262; Mon, 14 Jan 2019 17:38:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 705AE29260 for ; Mon, 14 Jan 2019 17:38:07 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2D7F7266834; Mon, 14 Jan 2019 18:38:06 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 201D5266A73; Mon, 14 Jan 2019 18:38:04 +0100 (CET) Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by alsa0.perex.cz (Postfix) with ESMTP id 630A12667F5 for ; Mon, 14 Jan 2019 18:38:00 +0100 (CET) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 15220786-1500050 for multiple; Mon, 14 Jan 2019 17:37:53 +0000 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Jan 2019 17:37:51 +0000 Message-Id: <20190114173753.472-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Chris Wilson Subject: [alsa-devel] [PATCH 1/3] drm/i915/audio: Track temporary rpm wakerefs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }