intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 5/9] drm/i915: CPT/PPT pch dp transcoder workaround
Date: Fri, 26 Oct 2012 12:21:11 -0200	[thread overview]
Message-ID: <CA+gsUGTWddRp6kFnD07QmZ6-SnP9Js4oDRgX5tgsMff3rc3tFA@mail.gmail.com> (raw)
In-Reply-To: <1351241899-7870-6-git-send-email-daniel.vetter@ffwll.ch>

Hi

2012/10/26 Daniel Vetter <daniel.vetter@ffwll.ch>:
> 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.

What confuses me is that the bit name is actually "Autotrain TimingGen
Override" and after a quick check it seems we don't use autotrain.
Also, by looking at the IVB mode set sequence it seems Auto Train is
the *recommended* method since manual is listed as "testing only". So
I'm not sure if we need this code now, but it seems we could try to
implement the auto train...

Also, I'd move the code that sets/unsets the chicken bit to
intel_enable_transcoder/intel_disable_transcoder.

>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  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 */
> --
> 1.7.11.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni

  reply	other threads:[~2012-10-26 14:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26  8:58 [PATCH 0/9] some ivb fdi b/c fixes Daniel Vetter
2012-10-26  8:58 ` [PATCH 1/9] drm/i915: shut up spurious message in intel_dp_get_hw_state Daniel Vetter
2012-10-26 14:01   ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 2/9] drm/i915: Write the FDI RX TU size reg at the right time Daniel Vetter
2012-10-27 11:51   ` Paulo Zanoni
2012-10-27 12:59     ` Daniel Vetter
2012-10-27 13:03       ` Paulo Zanoni
2012-10-27 13:04         ` Daniel Vetter
2012-10-27 13:18           ` Paulo Zanoni
2012-10-27 13:50             ` Daniel Vetter
2012-10-27 13:20   ` [PATCH] " Daniel Vetter
2012-10-26  8:58 ` [PATCH 3/9] drm/i915: set FDI_RX_MISC to recommended values on CPT/PPT Daniel Vetter
2012-10-27 12:02   ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 4/9] drm/i915: add comment about pch pll enabling rules Daniel Vetter
2012-10-27 12:15   ` Paulo Zanoni
2012-10-27 12:57     ` Daniel Vetter
2012-10-27 16:46   ` [PATCH] " Daniel Vetter
2012-10-29 12:02     ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 5/9] drm/i915: CPT/PPT pch dp transcoder workaround Daniel Vetter
2012-10-26 14:21   ` Paulo Zanoni [this message]
2012-10-29 15:38     ` Daniel Vetter
2012-10-29 17:02       ` Paulo Zanoni
2012-10-29 17:14         ` Daniel Vetter
2012-10-31 17:41           ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 6/9] drm/i915: BUG on impossible pch dp port Daniel Vetter
2012-10-26 15:04   ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 7/9] drm/i915: drop unnecessary check from fdi_link_train code Daniel Vetter
2012-10-26 15:32   ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 8/9] drm/i915: add ->display.modeset_global_resources callback Daniel Vetter
2012-10-27 12:18   ` Paulo Zanoni
2012-10-26  8:58 ` [PATCH 9/9] drm/i915: check fdi B/C lane sharing constraint Daniel Vetter
2012-10-27 12:56   ` Paulo Zanoni
2012-10-27 13:03     ` Daniel Vetter
2012-10-27 13:58   ` [PATCH] " Daniel Vetter
2012-10-29 12:06     ` Paulo Zanoni
2012-10-29 17:42       ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+gsUGTWddRp6kFnD07QmZ6-SnP9Js4oDRgX5tgsMff3rc3tFA@mail.gmail.com \
    --to=przanoni@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).