From patchwork Fri Oct 26 08:58:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1650681 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 2669CDF2F6 for ; Fri, 26 Oct 2012 09:50:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06850A0AB4 for ; Fri, 26 Oct 2012 02:50:30 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id E66329E818 for ; Fri, 26 Oct 2012 01:58:30 -0700 (PDT) Received: by mail-wi0-f169.google.com with SMTP id hq4so208154wib.0 for ; Fri, 26 Oct 2012 01:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=YJ90gMdR7H9XP8HRyK7Uc/IHNilXJfWRPaUfgxduCHg=; b=LCiQzy/cyMpuAf4kE5UEUAXD5xQbsmdyzhU3zlN28Qk3RkFYwa/TIXTBbZrIVHx3MY 588GX/d5uIedYztXR8sJcpdG5HYG+YhKEShBIUSCL6DUNjrSuurtUECNcDPzva2nQ7Ga aKdWZUUDpgsQ9Uv3XxjAIR61fsWAaJLCWqM9s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=YJ90gMdR7H9XP8HRyK7Uc/IHNilXJfWRPaUfgxduCHg=; b=bzb6h66Lt/Y5lEV0KXFM6udWAmQm0roGyoJBSp1edVU4NAqFmSdPNag6PSurcXqXQB doYvdctTOsGSCHJ+1V2IRijdTa+5z45MjTwSZlgrNOryODAnc7hn6qiHFwbxOc/RflHU Ow5U3wt5rpz9f43Y3WHj/Rignfg1PaTQ6WYfRv8MdNS9NAMPou/bUqYu871XGMNLqzBn Nsp5eFhhMiNijJmguLxSk5zqVcMOst9H0AD9tI+EvG3GWqakdza74Byh7B+aTf6yrFaj VywFXel+GIc3Jr6C0xJEZV2z6eY2q8ksgQ6m2OA2Fh/jet+vje7lTjnCZc6IrpvoAanD NBuA== Received: by 10.180.106.2 with SMTP id gq2mr3603943wib.18.1351241909378; Fri, 26 Oct 2012 01:58:29 -0700 (PDT) Received: from bremse.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id k20sm14217364wiv.11.2012.10.26.01.58.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Oct 2012 01:58:29 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 26 Oct 2012 10:58:15 +0200 Message-Id: <1351241899-7870-6-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1351241899-7870-1-git-send-email-daniel.vetter@ffwll.ch> References: <1351241899-7870-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQlNfCozCyd9TN9+aKpDZyQL0qCPoYxhZjXgNKUHvN0D+43UcTHdTvmD/te30nd/U0C/6Xbp Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 5/9] drm/i915: CPT/PPT pch dp transcoder workaround 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 We need to set the timing override chicken bit after fdi link training has completed and before we enable the dp transcoder. We also have to clear that bit again after disabling the pch dp transcoder. See "Graphics BSpec: vol4g North Display Engine Registers [IVB], Display Mode Set Sequence" and "Graphics BSpec: vol4h South Display Engine Registers [CPT, PPT], South Display Engine Transcoder and FDI Control, Transcoder Debug and DFT, TRANS_CHICKEN_2" bit 31: "Workaround : Enable the override prior to enabling the transcoder. Disable the override after disabling the transcoder." While at it, use the _PIPE macro for the other TRANS_DP register. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_reg.h | 8 +++++++- drivers/gpu/drm/i915/intel_display.c | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index c7c4b96..84b09ee 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -4062,7 +4062,7 @@ #define TRANS_DP_CTL_A 0xe0300 #define TRANS_DP_CTL_B 0xe1300 #define TRANS_DP_CTL_C 0xe2300 -#define TRANS_DP_CTL(pipe) (TRANS_DP_CTL_A + (pipe) * 0x01000) +#define TRANS_DP_CTL(pipe) _PIPE(pipe, TRANS_DP_CTL_A, TRANS_DP_CTL_B) #define TRANS_DP_OUTPUT_ENABLE (1<<31) #define TRANS_DP_PORT_SEL_B (0<<29) #define TRANS_DP_PORT_SEL_C (1<<29) @@ -4082,6 +4082,12 @@ #define TRANS_DP_HSYNC_ACTIVE_LOW 0 #define TRANS_DP_SYNC_MASK (3<<3) +#define TRANS_CHICKEN_2_A 0xf0064 +#define TRANS_CHICKEN_2_B 0xf1064 +#define TRANS_CHICKEN_2_C 0xf2064 +#define TRANS_CHICKEN_2(pipe) _PIPE(pipe, TRANS_CHICKEN_2_A, TRANS_CHICKEN_2_B) +#define TRANS_CHICKEN2_TIMING_OVERRIDE (1<<31) + /* SNB eDP training params */ /* SNB A-stepping */ #define EDP_LINK_TRAIN_400MV_0DB_SNB_A (0x38<<22) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index aa80ecb..8ab0fa5 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2687,7 +2687,6 @@ static void ironlake_fdi_pll_enable(struct intel_crtc *intel_crtc) int pipe = intel_crtc->pipe; u32 reg, temp; - /* enable PCH FDI RX PLL, wait warmup plus DMI latency */ reg = FDI_RX_CTL(pipe); temp = I915_READ(reg); @@ -3060,6 +3059,14 @@ static void ironlake_pch_enable(struct drm_crtc *crtc) (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT) || intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) { u32 bpc = (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) >> 5; + + /* Workaround: Set the timing override bit before enabling the + * DP pch transcoder. */ + reg = TRANS_CHICKEN2(pipe); + temp = I915_READ(reg); + temp |= TRANS_CHICKEN2_TIMING_OVERRIDE; + I915_WRITE(reg, temp); + reg = TRANS_DP_CTL(pipe); temp = I915_READ(reg); temp &= ~(TRANS_DP_PORT_SEL_MASK | @@ -3365,6 +3372,12 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) BUG(); /* wtf */ } I915_WRITE(PCH_DPLL_SEL, temp); + + /* Workaround: Clear the timing override chicken bit again. */ + reg = TRANS_CHICKEN2(pipe); + temp = I915_READ(reg); + temp &= ~TRANS_CHICKEN2_TIMING_OVERRIDE; + I915_WRITE(reg, temp); } /* disable PCH DPLL */