All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/i915: preserve SSC if previously set v2
Date: Fri, 06 Jun 2014 14:04:21 +0300	[thread overview]
Message-ID: <87sinicn9m.fsf@intel.com> (raw)
In-Reply-To: <1401992671-2548-1-git-send-email-jbarnes@virtuousgeek.org>

On Thu, 05 Jun 2014, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> Some machines may have a broken VBT or no VBT at all, but we still want
> to use SSC there.  So check for it and keep it enabled if we see it
> already on.  Based on an earlier fix from Kristian.
>
> v2: honor modparam if set too (Daniel)
>     read out at init time and store for panel_use_ssc() use (Jesse)
>
> Reported-by: Kristian Høgsberg <hoegsberg@gmail.com>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  2 ++
>  drivers/gpu/drm/i915/intel_display.c | 11 ++++++++++-
>  2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 8631fb3..f57b752 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1404,6 +1404,8 @@ struct drm_i915_private {
>  	struct intel_opregion opregion;
>  	struct intel_vbt_data vbt;
>  
> +	bool bios_ssc; /* BIOS had SSC enabled at boot? */
> +
>  	/* overlay */
>  	struct intel_overlay *overlay;
>  
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b5cbb28..0e8c9bc 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5355,7 +5355,7 @@ static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
>  {
>  	if (i915.panel_use_ssc >= 0)
>  		return i915.panel_use_ssc != 0;
> -	return dev_priv->vbt.lvds_use_ssc
> +	return (dev_priv->vbt.lvds_use_ssc || dev_priv->bios_ssc)
>  		&& !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
>  }
>  
> @@ -12478,6 +12478,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
>  
>  void intel_modeset_gem_init(struct drm_device *dev)
>  {
> +	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct drm_crtc *c;
>  	struct intel_framebuffer *fb;
>  
> @@ -12485,6 +12486,14 @@ void intel_modeset_gem_init(struct drm_device *dev)
>  	intel_init_gt_powersave(dev);
>  	mutex_unlock(&dev->struct_mutex);
>  
> +	/*
> +	 * There may be no VBT; and if the BIOS enabled SSC we can
> +	 * just keep using it to avoid unnecessary flicker.
> +	 */
> +	if ((HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)) &&
> +	    (I915_READ(PCH_DREF_CONTROL) & DREF_SSC1_ENABLE))
> +			dev_priv->bios_ssc = true;

Do we have any need to differentiate between this and what VBT has? We
could just treat dev_priv->vbt as "VBT or what BIOS did", and do
dev_priv->vbt.lvds_use_ssc = true; here, possibly with a
DRM_DEBUG_KMS. It would simplify code elsewhere and be less error prone.
We already do a similar thing for the eDP bpp (see intel_dp.c, look for
"This is a big fat ugly hack").

BR,
Jani.


> +
>  	intel_modeset_init_hw(dev);
>  
>  	intel_setup_overlay(dev);
> -- 
> 1.8.3.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2014-06-06 11:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 18:24 [PATCH 1/5] drm/i915: preserve SSC if previously set v2 Jesse Barnes
2014-06-05 18:24 ` [PATCH 2/5] drm/i915: preserve swizzle settings if necessary v3 Jesse Barnes
2014-06-10 14:02   ` Daniel Vetter
2014-06-10 17:27     ` Jesse Barnes
2014-06-10 19:33       ` Daniel Vetter
2014-06-10 19:45         ` Jesse Barnes
2014-06-11  9:23           ` Daniel Vetter
2014-06-11 15:13             ` Jesse Barnes
2014-06-11 15:39               ` Daniel Vetter
2014-06-11 15:41                 ` Jesse Barnes
2014-06-27 16:15                   ` Steve Aarnio
2014-07-07  9:03                     ` [Intel-gfx] " Daniel Vetter
2014-06-05 18:24 ` [PATCH 3/5] drm: add drm_mode_same_size function Jesse Barnes
2014-06-05 18:24 ` [PATCH 4/5] drm/i915: use current mode if the size matches the preferred mode Jesse Barnes
2014-06-10 14:05   ` [Intel-gfx] " Daniel Vetter
2014-06-10 17:29     ` Jesse Barnes
2014-06-05 18:24 ` [PATCH 5/5] drm/i915: enable fastboot by default Jesse Barnes
2014-06-06 11:12   ` Jani Nikula
2014-06-10 14:10     ` Daniel Vetter
2014-06-10 14:07   ` [Intel-gfx] " Daniel Vetter
2014-06-10 17:31     ` Jesse Barnes
2014-06-10 18:01       ` Stéphane Marchesin
2014-06-10 18:42         ` [Intel-gfx] " Jesse Barnes
2014-06-11  9:30           ` Daniel Vetter
2014-06-06 11:04 ` Jani Nikula [this message]
2014-06-06 11:06   ` [PATCH 1/5] drm/i915: preserve SSC if previously set v2 Chris Wilson
2014-06-10 14:00 ` [Intel-gfx] " 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=87sinicn9m.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.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 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.