From patchwork Tue Oct 2 20:52:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1539061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id D72E5DFFAD for ; Tue, 2 Oct 2012 21:10:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2E589EFC5 for ; Tue, 2 Oct 2012 14:10:19 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gg0-f177.google.com (mail-gg0-f177.google.com [209.85.161.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 6EFE89EF7D for ; Tue, 2 Oct 2012 13:53:57 -0700 (PDT) Received: by mail-gg0-f177.google.com with SMTP id m2so1762342ggn.36 for ; Tue, 02 Oct 2012 13:53:57 -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=abZbtcxg02J4YQyGkvkSrP5Wx6JiiTcE++WsDbplhOs=; b=QkNYsfTuxWcSXR4XmIqJ8I911uQwdtPU2/oOkLyrtjWvlH+N+mdeh3P2xHssFhPEC4 Ddb9j99wVTUmBdxoT9sk6bFMZctSM5vrn72BFhvDEReeYGDtwBHfJuiVD0ZJVT+3C4xr V52kOwxqV1rGIEs/WDwqRQhF1kJsqRuGyDMn7aIcQHEQjizAcQN3c2GKnIcXMTjeidAX jxElS8JjKkeFVxWMW06xuqaoccSZ4yDLCUPKYjpOnYBFFa/23Tv2l6w1caazaKkmPDBW EgHynEmlrgvJ16zKwdrDfIeuX1X/kb/EQBR5d8n05jKAHKEz5sZDIp4meTDl5txgwstY EDQg== Received: by 10.236.191.135 with SMTP id g7mr17157608yhn.83.1349211237141; Tue, 02 Oct 2012 13:53:57 -0700 (PDT) Received: from vicky.domain.invalid ([187.59.149.118]) by mx.google.com with ESMTPS id f1sm2117168ank.12.2012.10.02.13.53.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Oct 2012 13:53:56 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 2 Oct 2012 17:52:10 -0300 Message-Id: <1349211142-4802-36-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1349211142-4802-1-git-send-email-przanoni@gmail.com> References: <1349211142-4802-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 35/47] drm/i915: set the correct eDP aux channel clock divider on DDI 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 The cdclk frequency is not always the same, so the value here should be adjusted to match it. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_dp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 2e4e588..cc9e5ab 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -351,7 +351,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, int i; int recv_bytes; uint32_t status; - uint32_t aux_clock_divider; + uint32_t aux_clock_divider, cdclk_freq; int try, precharge; if (IS_HASWELL(dev)) { @@ -387,7 +387,10 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, * clock divider. */ if (is_cpu_edp(intel_dp)) { - if (IS_VALLEYVIEW(dev)) + if (IS_HASWELL(dev)) { + cdclk_freq = I915_READ(CDCLK_FREQ) & CDCLK_FREQ_MASK; + aux_clock_divider = (cdclk_freq + 1) >> 1; + } else if (IS_VALLEYVIEW(dev)) aux_clock_divider = 100; else if (IS_GEN6(dev) || IS_GEN7(dev)) aux_clock_divider = 200; /* SNB & IVB eDP input clock at 400Mhz */