From patchwork Thu Aug 18 06:42:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: libin.yang@linux.intel.com X-Patchwork-Id: 9286865 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 14DCB600CB for ; Thu, 18 Aug 2016 06:46:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0645D29029 for ; Thu, 18 Aug 2016 06:46:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDFA82902C; Thu, 18 Aug 2016 06:46:13 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BAC529029 for ; Thu, 18 Aug 2016 06:46:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B4ECD6E9B0; Thu, 18 Aug 2016 06:46:12 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id B6C196E9B0 for ; Thu, 18 Aug 2016 06:46:09 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 17 Aug 2016 23:46:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,538,1464678000"; d="scan'208"; a="1027492850" Received: from younglee-grantley.sh.intel.com ([10.239.159.22]) by fmsmga001.fm.intel.com with ESMTP; 17 Aug 2016 23:46:07 -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, 18 Aug 2016 14:42:28 +0800 Message-Id: <1471502548-137544-4-git-send-email-libin.yang@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471502548-137544-1-git-send-email-libin.yang@linux.intel.com> References: <1471502548-137544-1-git-send-email-libin.yang@linux.intel.com> Cc: Libin Yang Subject: [Intel-gfx] [PATCH v4 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. This patch renames mode to adjusted_mode to unify the name. Signed-off-by: Libin Yang --- 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 da8217c..577e23a 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -162,7 +162,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; } } @@ -257,8 +257,8 @@ static void audio_m_cts_setup(struct drm_device *dev, 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) || @@ -750,7 +750,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; @@ -782,20 +782,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));