From patchwork Mon Oct 15 18:51:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1595141 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 3AB583FD86 for ; Mon, 15 Oct 2012 18:55:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 307F09F71D for ; Mon, 15 Oct 2012 11:55:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f49.google.com (mail-yh0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 466749F734 for ; Mon, 15 Oct 2012 11:52:19 -0700 (PDT) Received: by mail-yh0-f49.google.com with SMTP id j52so1335408yhj.36 for ; Mon, 15 Oct 2012 11:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=SwiD6jfoSQO1Ry5GuAavKD9Y1L19pL/j1Bor48tzZ+c=; b=QUvZU0hzg8nalvNi3pVfbcBDJol3Pa+SsEX67kRhMwgrgII54CrK7BhBCBPmb74jZ/ uqLMKwmwuy2Xl7wf1v/5olrP5fRHFkYC/TNuq0cCsuuJIForni7k3s3jxmyTxGLHrErm YCdUWvaYe2Xxa7G2Qy75o2zY7prGaBSMrpAJGcI7+k9hvVDSFUsKdFuvI04iKCJ88Zhr 0vEiDs803Y0yo6h1PBSd00PlGub96VZmE1ZnRnz/9eXP93uG1f6najZOnmcCNkyrFyqF /bpCdcjr4G/Z5lIWtZQ3wOZfFv9TUdNlDNNY7Yu+hlMg6ahQ8xNXNGvTO61EBbkKdIKb LmFg== Received: by 10.236.118.17 with SMTP id k17mr11363528yhh.69.1350327139084; Mon, 15 Oct 2012 11:52:19 -0700 (PDT) Received: from vicky.domain.invalid ([177.16.37.219]) by mx.google.com with ESMTPS id u67sm15879079yhb.8.2012.10.15.11.52.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 11:52:17 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 15 Oct 2012 15:51:35 -0300 Message-Id: <1350327102-4463-8-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350327102-4463-1-git-send-email-przanoni@gmail.com> References: <1350327102-4463-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 07/14] drm/i915: use TU_SIZE macro at intel_dp_set_m_n 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Paulo Zanoni Much simpler and looks more like the M/N code inside intel_display.c. Signed-off-by: Paulo Zanoni Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/intel_dp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index b10f35b..52b5453 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -794,9 +794,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, mode->clock, adjusted_mode->clock, &m_n); if (HAS_PCH_SPLIT(dev)) { - I915_WRITE(TRANSDATA_M1(pipe), - ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) | - m_n.gmch_m); + I915_WRITE(TRANSDATA_M1(pipe), TU_SIZE(m_n.tu) | m_n.gmch_m); I915_WRITE(TRANSDATA_N1(pipe), m_n.gmch_n); I915_WRITE(TRANSDPLINK_M1(pipe), m_n.link_m); I915_WRITE(TRANSDPLINK_N1(pipe), m_n.link_n); @@ -807,8 +805,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, I915_WRITE(PIPE_LINK_N1(pipe), m_n.link_n); } else { I915_WRITE(PIPE_GMCH_DATA_M(pipe), - ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) | - m_n.gmch_m); + TU_SIZE(m_n.tu) | m_n.gmch_m); I915_WRITE(PIPE_GMCH_DATA_N(pipe), m_n.gmch_n); I915_WRITE(PIPE_DP_LINK_M(pipe), m_n.link_m); I915_WRITE(PIPE_DP_LINK_N(pipe), m_n.link_n);