mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-04 05:37:36 +00:00
drm/i915: abstract intel_panel_sanitize_ssc() from intel_modeset_init()
The code is too specific and detailed to have open in a high level function. Abstract away. As a drive-by improvement switch to using enableddisabled() in logging and git rid of a redundant !!. No functional changes. v2: drop the !! while at it too (Chris) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190920185421.17822-4-jani.nikula@intel.com
This commit is contained in:
parent
9980c3c110
commit
064bd628fd
1 changed files with 22 additions and 17 deletions
|
@ -7552,6 +7552,27 @@ intel_link_compute_m_n(u16 bits_per_pixel, int nlanes,
|
||||||
constant_n);
|
constant_n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void intel_panel_sanitize_ssc(struct drm_i915_private *dev_priv)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* There may be no VBT; and if the BIOS enabled SSC we can
|
||||||
|
* just keep using it to avoid unnecessary flicker. Whereas if the
|
||||||
|
* BIOS isn't using it, don't assume it will work even if the VBT
|
||||||
|
* indicates as much.
|
||||||
|
*/
|
||||||
|
if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)) {
|
||||||
|
bool bios_lvds_use_ssc = I915_READ(PCH_DREF_CONTROL) &
|
||||||
|
DREF_SSC1_ENABLE;
|
||||||
|
|
||||||
|
if (dev_priv->vbt.lvds_use_ssc != bios_lvds_use_ssc) {
|
||||||
|
DRM_DEBUG_KMS("SSC %s by BIOS, overriding VBT which says %s\n",
|
||||||
|
enableddisabled(bios_lvds_use_ssc),
|
||||||
|
enableddisabled(dev_priv->vbt.lvds_use_ssc));
|
||||||
|
dev_priv->vbt.lvds_use_ssc = bios_lvds_use_ssc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
|
static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
|
||||||
{
|
{
|
||||||
if (i915_modparams.panel_use_ssc >= 0)
|
if (i915_modparams.panel_use_ssc >= 0)
|
||||||
|
@ -16203,23 +16224,7 @@ int intel_modeset_init(struct drm_device *dev)
|
||||||
|
|
||||||
intel_init_pm(dev_priv);
|
intel_init_pm(dev_priv);
|
||||||
|
|
||||||
/*
|
intel_panel_sanitize_ssc(dev_priv);
|
||||||
* There may be no VBT; and if the BIOS enabled SSC we can
|
|
||||||
* just keep using it to avoid unnecessary flicker. Whereas if the
|
|
||||||
* BIOS isn't using it, don't assume it will work even if the VBT
|
|
||||||
* indicates as much.
|
|
||||||
*/
|
|
||||||
if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)) {
|
|
||||||
bool bios_lvds_use_ssc = !!(I915_READ(PCH_DREF_CONTROL) &
|
|
||||||
DREF_SSC1_ENABLE);
|
|
||||||
|
|
||||||
if (dev_priv->vbt.lvds_use_ssc != bios_lvds_use_ssc) {
|
|
||||||
DRM_DEBUG_KMS("SSC %sabled by BIOS, overriding VBT which says %sabled\n",
|
|
||||||
bios_lvds_use_ssc ? "en" : "dis",
|
|
||||||
dev_priv->vbt.lvds_use_ssc ? "en" : "dis");
|
|
||||||
dev_priv->vbt.lvds_use_ssc = bios_lvds_use_ssc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum framebuffer dimensions, chosen to match
|
* Maximum framebuffer dimensions, chosen to match
|
||||||
|
|
Loading…
Add table
Reference in a new issue