From patchwork Thu Aug 4 07:58:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: libin.yang@linux.intel.com X-Patchwork-Id: 9262889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B44E260839 for ; Thu, 4 Aug 2016 08:01:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A720F27F8C for ; Thu, 4 Aug 2016 08:01:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BBDF2832E; Thu, 4 Aug 2016 08:01:46 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DB4F27F8C for ; Thu, 4 Aug 2016 08:01:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF2136E5F2; Thu, 4 Aug 2016 08:01:43 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C1386E5E9 for ; Thu, 4 Aug 2016 08:01:18 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 04 Aug 2016 01:01:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,469,1464678000"; d="scan'208"; a="1034875323" Received: from younglee-grantley.sh.intel.com ([10.239.159.22]) by fmsmga002.fm.intel.com with ESMTP; 04 Aug 2016 01:01:16 -0700 From: libin.yang@linux.intel.com To: intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com, daniel.vetter@intel.com, tiwai@suse.de Date: Thu, 4 Aug 2016 15:58:04 +0800 Message-Id: <1470297484-82178-3-git-send-email-libin.yang@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470297484-82178-1-git-send-email-libin.yang@linux.intel.com> References: <1470297484-82178-1-git-send-email-libin.yang@linux.intel.com> Cc: Libin Yang Subject: [Intel-gfx] [PATCH v3 3/3] drm/i915: HDMI audio gets the TMDS clock by crtc_clock X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang HDMI audio should use crtc_clock to get the TMDS clock. Besides, this patch renames mode to adjusted_mode to unify the name. Signed-off-by: Libin Yang Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_audio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index 7aa0203..bf02645 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -159,7 +159,7 @@ static int audio_config_get_n(struct intel_crtc *crtc, if (intel_crtc_has_type(crtc->config, INTEL_OUTPUT_HDMI)) { for (i = 0; i < ARRAY_SIZE(aud_ncts); i++) { if ((rate == aud_ncts[i].sample_rate) && - (adjusted_mode->clock == aud_ncts[i].clock)) { + (adjusted_mode->crtc_clock == aud_ncts[i].clock)) { return aud_ncts[i].n; } } @@ -228,8 +228,8 @@ static uint32_t audio_config_setup_m_reg(struct intel_crtc *crtc, static bool audio_rate_need_prog(struct intel_crtc *crtc, const struct drm_display_mode *adjusted_mode) { - if (((adjusted_mode->clock == TMDS_297M) || - (adjusted_mode->clock == TMDS_296M)) && + if (((adjusted_mode->crtc_clock == TMDS_297M) || + (adjusted_mode->crtc_clock == TMDS_296M)) && intel_crtc_has_type(crtc->config, INTEL_OUTPUT_HDMI)) return true; else if (((crtc->config->port_clock == LC_540M) || @@ -725,7 +725,7 @@ static int i915_audio_component_sync_audio_rate(struct device *dev, struct drm_i915_private *dev_priv = dev_to_i915(dev); struct intel_encoder *intel_encoder; struct intel_crtc *crtc; - struct drm_display_mode *mode; + struct drm_display_mode *adjusted_mode; struct i915_audio_component *acomp = dev_priv->audio_component; enum pipe pipe = INVALID_PIPE; u32 tmp, m; @@ -756,20 +756,20 @@ static int i915_audio_component_sync_audio_rate(struct device *dev, DRM_DEBUG_KMS("pipe %c connects port %c\n", pipe_name(pipe), port_name(port)); - mode = &crtc->config->base.adjusted_mode; + adjusted_mode = &crtc->config->base.adjusted_mode; /* port must be valid now, otherwise the pipe will be invalid */ acomp->aud_sample_rate[port] = rate; /* 2. check whether to set the N/CTS/M manually or not */ - if (!audio_rate_need_prog(crtc, mode)) { + if (!audio_rate_need_prog(crtc, adjusted_mode)) { tmp = I915_READ(HSW_AUD_CFG(pipe)); tmp &= ~AUD_CONFIG_N_PROG_ENABLE; I915_WRITE(HSW_AUD_CFG(pipe), tmp); goto unlock; } - n = audio_config_get_n(crtc, mode, rate); + n = audio_config_get_n(crtc, adjusted_mode, rate); if (n == 0) { DRM_DEBUG_KMS("Using automatic mode for N value on port %c\n", port_name(port));