[Intel-gfx] [PATCH 1/5] drm/i915: preserve SSC if previously set v2
Jani Nikula
jani.nikula at linux.intel.com
Fri Jun 6 13:04:21 CEST 2014
On Thu, 05 Jun 2014, Jesse Barnes <jbarnes at 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 at gmail.com>
> Signed-off-by: Jesse Barnes <jbarnes at 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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list