From patchwork Tue Dec 17 05:28:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vandana.kannan@intel.com X-Patchwork-Id: 3359071 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 968259F32E for ; Tue, 17 Dec 2013 05:21:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC8A120173 for ; Tue, 17 Dec 2013 05:21:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 04EF2200EA for ; Tue, 17 Dec 2013 05:21:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A2661060D7; Mon, 16 Dec 2013 21:21:13 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id D88421060D7 for ; Mon, 16 Dec 2013 21:20:43 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 16 Dec 2013 21:20:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,499,1384329600"; d="scan'208";a="453406244" Received: from vkannan-desktop.iind.intel.com ([10.223.25.35]) by orsmga002.jf.intel.com with ESMTP; 16 Dec 2013 21:20:41 -0800 From: Vandana Kannan To: intel-gfx@lists.freedesktop.org Date: Tue, 17 Dec 2013 10:58:27 +0530 Message-Id: <1387258107-19232-6-git-send-email-vandana.kannan@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387258107-19232-1-git-send-email-vandana.kannan@intel.com> References: <1387258107-19232-1-git-send-email-vandana.kannan@intel.com> Subject: [Intel-gfx] [PATCH 5/5] drm/i915/bdw: Add support for DRRS to switch RR X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For Broadwell, there is one instance of Transcoder MN values per transcoder. For dynamic switching between multiple refreshr rates, M/N values may be reprogrammed on the fly. Link N programming triggers update of all data and link M & N registers and the new M/N values will be used in the next frame that is output. Signed-off-by: Vandana Kannan Signed-off-by: Pradeep Bhat --- drivers/gpu/drm/i915/intel_dp.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 209be3c..183cfd7 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -798,9 +798,15 @@ intel_dp_set_m2_n2(struct intel_crtc *crtc, struct intel_link_m_n *m_n) struct drm_i915_private *dev_priv = dev->dev_private; enum transcoder transcoder = crtc->config.cpu_transcoder; - if (INTEL_INFO(dev)->gen >= 5 && INTEL_INFO(dev)->gen < 8) { + if (INTEL_INFO(dev)->gen >= 8) { + I915_WRITE(PIPE_DATA_M1(transcoder), + TU_SIZE(m_n->tu) | m_n->gmch_m); + I915_WRITE(PIPE_DATA_N1(transcoder), m_n->gmch_n); + I915_WRITE(PIPE_LINK_M1(transcoder), m_n->link_m); + I915_WRITE(PIPE_LINK_N1(transcoder), m_n->link_n); + } else if (INTEL_INFO(dev)->gen >= 5 && INTEL_INFO(dev)->gen < 8) { I915_WRITE(PIPE_DATA_M2(transcoder), - TU_SIZE(m_n->tu) | m_n->gmch_m); + TU_SIZE(m_n->tu) | m_n->gmch_m); I915_WRITE(PIPE_DATA_N2(transcoder), m_n->gmch_n); I915_WRITE(PIPE_LINK_M2(transcoder), m_n->link_m); I915_WRITE(PIPE_LINK_N2(transcoder), m_n->link_n); @@ -3617,8 +3623,17 @@ intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate) mutex_lock(&intel_dp->drrs_state.mutex); - /* Haswell and below */ - if (INTEL_INFO(dev)->gen >= 5 && INTEL_INFO(dev)->gen < 8) { + if (INTEL_INFO(dev)->gen >= 8) { + switch (index) { + case DRRS_HIGH_RR: + intel_dp_set_m2_n2(intel_crtc, &config->dp_m_n); + break; + case DRRS_LOW_RR: + intel_dp_set_m2_n2(intel_crtc, &config->dp_m2_n2); + break; + }; + } else if (INTEL_INFO(dev)->gen >= 5 && INTEL_INFO(dev)->gen < 8) { + /* Haswell and below */ reg = PIPECONF(intel_crtc->config.cpu_transcoder); val = I915_READ(reg); if (index > DRRS_HIGH_RR) {