All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Richter <richter@rus.uni-stuttgart.de>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org,
	Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH v2 15/16] drm/i915: Add pipe B force quirk for 830M
Date: Fri, 15 Aug 2014 15:37:39 +0200	[thread overview]
Message-ID: <53EE0D23.4070600@rus.uni-stuttgart.de> (raw)
In-Reply-To: <1408054928-24141-16-git-send-email-ville.syrjala@linux.intel.com>

On 15.08.2014 00:22, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 830M has problems when some of the pipes are disabled. Namely if a
> plane, DVO port etc. is currently assigned to a disabled pipe, it
> can't moved to the other pipe until the current pipe is also enabled.
> To keep things simple just leave both pipes running all the time.
>
> Ideally I think should turn the pipes off if neither is active, and
> when either becomes active we enable both. But that would reuquire
> proper atomic modeset support, and probably a bit of extra care in
> the order things get enabled.
>
> v2: Reorder wrt. double wide handling changes
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Tested-by: Thomas Richter <richter@rus.uni-stuttgart.de>

> ---
>   drivers/gpu/drm/i915/i915_drv.h      |  1 +
>   drivers/gpu/drm/i915/intel_display.c | 39 +++++++++++++++++++++++++-----------
>   2 files changed, 28 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 54895a6..b1ed71e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -706,6 +706,7 @@ enum intel_sbi_destination {
>   #define QUIRK_LVDS_SSC_DISABLE (1<<1)
>   #define QUIRK_INVERT_BRIGHTNESS (1<<2)
>   #define QUIRK_BACKLIGHT_PRESENT (1<<3)
> +#define QUIRK_PIPEB_FORCE (1<<4)
>
>   struct intel_fbdev;
>   struct intel_fbc_work;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e1c0c0b..92baf6f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1194,8 +1194,9 @@ void assert_pipe(struct drm_i915_private *dev_priv,
>   	enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
>   								      pipe);
>
> -	/* if we need the pipe A quirk it must be always on */
> -	if (pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE)
> +	/* if we need the pipe quirk it must be always on */
> +	if ((pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) ||
> +	    (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
>   		state = true;
>
>   	if (!intel_display_power_enabled(dev_priv,
> @@ -1626,8 +1627,9 @@ static void i9xx_disable_pll(struct intel_crtc *crtc)
>   		}
>   	}
>
> -	/* Don't disable pipe A or pipe A PLLs if needed */
> -	if (pipe == PIPE_A && (dev_priv->quirks & QUIRK_PIPEA_FORCE))
> +	/* Don't disable pipe or pipe PLLs if needed */
> +	if ((pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) ||
> +	    (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
>   		return;
>
>   	/* Make sure the pipe isn't still relying on us */
> @@ -1995,8 +1997,8 @@ static void intel_enable_pipe(struct intel_crtc *crtc)
>   	reg = PIPECONF(cpu_transcoder);
>   	val = I915_READ(reg);
>   	if (val & PIPECONF_ENABLE) {
> -		WARN_ON(!(pipe == PIPE_A &&
> -			  dev_priv->quirks & QUIRK_PIPEA_FORCE));
> +		WARN_ON(!((pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) ||
> +			  (pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE)));
>   		return;
>   	}
>
> @@ -2043,7 +2045,8 @@ static void intel_disable_pipe(struct intel_crtc *crtc)
>   		val &= ~PIPECONF_DOUBLE_WIDE;
>
>   	/* Don't disable pipe or pipe PLLs if needed */
> -	if (!(pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE))
> +	if (!(pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) &&
> +	    !(pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
>   		val &= ~PIPECONF_ENABLE;
>
>   	I915_WRITE(reg, val);
> @@ -5968,9 +5971,9 @@ static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc)
>
>   	pipeconf = 0;
>
> -	if (dev_priv->quirks & QUIRK_PIPEA_FORCE &&
> -	    I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE)
> -		pipeconf |= PIPECONF_ENABLE;
> +	if ((intel_crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) ||
> +	    (intel_crtc->pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
> +		pipeconf |= I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE;
>
>   	if (intel_crtc->config.double_wide)
>   		pipeconf |= PIPECONF_DOUBLE_WIDE;
> @@ -10680,8 +10683,9 @@ check_crtc_state(struct drm_device *dev)
>   		active = dev_priv->display.get_pipe_config(crtc,
>   							   &pipe_config);
>
> -		/* hw state is inconsistent with the pipe A quirk */
> -		if (crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE)
> +		/* hw state is inconsistent with the pipe quirk */
> +		if ((crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) ||
> +		    (crtc->pipe == PIPE_B && dev_priv->quirks & QUIRK_PIPEB_FORCE))
>   			active = crtc->active;
>
>   		for_each_intel_encoder(dev, encoder) {
> @@ -12429,6 +12433,14 @@ static void quirk_pipea_force(struct drm_device *dev)
>   	DRM_INFO("applying pipe a force quirk\n");
>   }
>
> +static void quirk_pipeb_force(struct drm_device *dev)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +
> +	dev_priv->quirks |= QUIRK_PIPEB_FORCE;
> +	DRM_INFO("applying pipe b force quirk\n");
> +}
> +
>   /*
>    * Some machines (Lenovo U160) do not work with SSC on LVDS for some reason
>    */
> @@ -12506,6 +12518,9 @@ static struct intel_quirk intel_quirks[] = {
>   	/* 830 needs to leave pipe A & dpll A up */
>   	{ 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
>
> +	/* 830 needs to leave pipe B & dpll B up */
> +	{ 0x3577, PCI_ANY_ID, PCI_ANY_ID, quirk_pipeb_force },
> +
>   	/* Lenovo U160 cannot use SSC on LVDS */
>   	{ 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },
>
>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-08-15 13:37 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-14 22:21 [PATCH 00/16] drm/i915: 830M/ns201 fixes again ville.syrjala
2014-08-14 22:21 ` [PATCH 01/16] drm/i915: Fix gen2 planes B and C max watermark value ville.syrjala
2014-08-15 13:25   ` Thomas Richter
2014-08-14 22:21 ` [PATCH 02/16] drm/i915: Disable trickle feed for gen2/3 ville.syrjala
2014-08-14 22:21 ` [PATCH 03/16] drm/i915: Idle unused rings on gen2/3 during init/resume ville.syrjala
2014-08-14 22:21 ` [PATCH 04/16] drm/i915: Pass intel_crtc to intel_disable_pipe() and intel_wait_for_pipe_off() ville.syrjala
2014-08-15 13:27   ` Thomas Richter
2014-08-14 22:21 ` [PATCH v3 05/16] drm/i915: Disable double wide even when leaving the pipe on ville.syrjala
2014-08-15 13:28   ` Thomas Richter
2014-08-14 22:21 ` [PATCH 06/16] drm/i915: ns2501 is on DVOB ville.syrjala
2014-08-15 13:29   ` Thomas Richter
2014-08-14 22:21 ` [PATCH 07/16] drm/i915: Enable DVO between mode_set and dpms hooks ville.syrjala
2014-08-15 13:29   ` Thomas Richter
2014-08-14 22:22 ` [PATCH 08/16] drm/i915: Don't call DVO mode_set hook on DPMS changes ville.syrjala
2014-08-15 13:30   ` Thomas Richter
2014-08-14 22:22 ` [PATCH 09/16] drm/i915: Kill useless ns2501_dump_regs ville.syrjala
2014-08-15 13:08   ` Thomas Richter
2014-08-15 13:31   ` Thomas Richter
2014-08-14 22:22 ` [PATCH 10/16] drm/i915: Rewrite ns2501 driver a bit ville.syrjala
2014-08-15 13:13   ` Thomas Richter
2014-08-15 13:32   ` Thomas Richter
2014-08-14 22:22 ` [PATCH 11/16] drm/i915: Init important ns2501 registers ville.syrjala
2014-08-15 13:18   ` Thomas Richter
2014-08-15 13:33   ` Thomas Richter
2014-09-01  8:42   ` Daniel Vetter
2014-08-14 22:22 ` [PATCH 12/16] drm/i915: Check pixel clock in ns2501 mode_valid hook ville.syrjala
2014-08-15 13:19   ` Thomas Richter
2014-08-15 13:33   ` Thomas Richter
2014-08-14 22:22 ` [PATCH 13/16] drm/i915: Fix DVO 2x clock enable on 830M ville.syrjala
2014-08-15 13:34   ` Thomas Richter
2014-09-01  8:46   ` Daniel Vetter
2014-09-05 18:52   ` [PATCH v2 " ville.syrjala
2014-09-08  7:33     ` Daniel Vetter
2014-08-14 22:22 ` [PATCH 14/16] Revert "drm/i915: Nuke pipe A quirk on i830M" ville.syrjala
2014-08-15 13:36   ` Thomas Richter
2014-08-14 22:22 ` [PATCH v2 15/16] drm/i915: Add pipe B force quirk for 830M ville.syrjala
2014-08-15 13:37   ` Thomas Richter [this message]
2014-08-14 22:22 ` [PATCH 16/16] drm/i915: Preserve VGACNTR bits from the BIOS ville.syrjala
2014-08-15 13:39   ` Thomas Richter
2014-08-15  7:57 ` [PATCH 00/16] drm/i915: 830M/ns201 fixes again Ville Syrjälä
     [not found]   ` <53EE59E8.7030101@rus.uni-stuttgart.de>
     [not found]     ` <20140816181342.GU4193@intel.com>
2014-08-16 18:25       ` S6010 - brightness adjustment not available Thomas Richter
2014-08-16 20:34         ` Ville Syrjälä
2014-09-01  8:53   ` [PATCH 00/16] drm/i915: 830M/ns201 fixes again Daniel Vetter
2014-09-05 18:54     ` [PATCH] drm/i915: Limit the watermark to at least 8 entries on gen2/3 ville.syrjala
2014-09-05 19:03       ` Thomas Richter
2014-09-06 17:33         ` Ville Syrjälä
2014-09-06 17:50           ` Thomas Richter
2014-09-08  7:39       ` Daniel Vetter
2014-09-08  7:41         ` Thomas Richter

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=53EE0D23.4070600@rus.uni-stuttgart.de \
    --to=richter@rus.uni-stuttgart.de \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.