Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/4] drm/i915: scramble reset support for DP port CRC on g4x
Date: Fri, 1 Nov 2013 12:58:44 +0000	[thread overview]
Message-ID: <20131101125844.GA10288@strange.amr.corp.intel.com> (raw)
In-Reply-To: <1383299423-4950-2-git-send-email-daniel.vetter@ffwll.ch>

On Fri, Nov 01, 2013 at 10:50:21AM +0100, Daniel Vetter wrote:
> +	/* DP port CRC needs slight spec mis-compliance to get stable CRCs. */

We could add a slighty better explanation. How about:

/*
 * When the pipe CRC tap point is after the transcoders we need
 * to tweak symbol-level features to produce a deterministic series of
 * symbols for a given frame. We need to reset those features only once
 * a frame (instead of every nth symbol):
 *   - DC-balance: used to ensure a better clock recovery from the data
 *     link (SDVO)
 *   - DisplayPort scrambling: used for EMI reduction
 */

> +	if (need_scramble_reset) {

so then maybe rename this with 'need_stable_symbols'

> +		uint32_t tmp = I915_READ(PORT_DFT2_G4X);
> +
> +		WARN_ON(!IS_G4X(dev));
> +
> +		I915_WRITE(PORT_DFT_I9XX,
> +			   I915_READ(PORT_DFT_I9XX) | DC_BALANCE_RESET);
> +
> +		if (pipe == PIPE_A)
> +			tmp |= PIPE_A_SCRAMBLE_RESET;
> +		else
> +			tmp |= PIPE_B_SCRAMBLE_RESET;
> +
> +		I915_WRITE(PORT_DFT2_G4X, tmp);
> +	}
> +
>  	return 0;
>  }
>  
> +static void g4x_undo_pipe_scramble_reset(struct drm_device *dev,
> +					 enum pipe pipe)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	uint32_t tmp = I915_READ(PORT_DFT2_G4X);
> +
> +	if (pipe == PIPE_A)
> +		tmp &= ~PIPE_A_SCRAMBLE_RESET;
> +	else
> +		tmp &= ~PIPE_B_SCRAMBLE_RESET;
> +	I915_WRITE(PORT_DFT2_G4X, tmp);
> +
> +	if (!(tmp & PIPE_SCRAMBLE_RESET_MASK)) {
> +		I915_WRITE(PORT_DFT_I9XX,
> +			   I915_READ(PORT_DFT_I9XX) & ~DC_BALANCE_RESET);
> +	}
> +}

It took me a bit of time to realize that you were only clearing the
"DC-Balance reset once a frame" bit when you're sure that we have no
pipe CRC needing stable symbols running at all on either pipe. And this
by using the SCRAMBLER_RESET bits in DFT2 as the state tracker.

Maybe add a small comment here to avoid those 20s of head scratching
when reading that code again in a bit.

-- 
Damien

  reply	other threads:[~2013-11-01 12:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 16:28 [PATCH] drm/i916: add "auto" pipe CRC source Daniel Vetter
2013-10-31 22:33 ` Daniel Vetter
2013-11-01  9:50   ` [PATCH 1/4] " Daniel Vetter
2013-11-01  9:50     ` [PATCH 2/4] drm/i915: scramble reset support for DP port CRC on g4x Daniel Vetter
2013-11-01 12:58       ` Damien Lespiau [this message]
2013-11-01  9:50     ` [PATCH 3/4] drm/i915: scramble reset support for DP port CRC on vlv Daniel Vetter
2013-11-01  9:50     ` [PATCH 4/4] drm/i915: Enable DP port CRC for the "auto" source on g4x/vlv Daniel Vetter
2013-11-01 13:05     ` [PATCH 1/4] drm/i916: add "auto" pipe CRC source Damien Lespiau
2013-11-01 17:52       ` 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=20131101125844.GA10288@strange.amr.corp.intel.com \
    --to=damien.lespiau@intel.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