Commit 2013ab18 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/fbc: Extract {skl,glk}_fbc_program_cfb_stride()

Declutter gen7_fbc_activate() by sucking the override
stride programming stuff into helpers.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-3-ville.syrjala@linux.intel.comAcked-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
parent b50364af
......@@ -360,32 +360,45 @@ static bool ilk_fbc_is_active(struct drm_i915_private *dev_priv)
return intel_de_read(dev_priv, ILK_DPFC_CONTROL) & DPFC_CTL_EN;
}
static void gen7_fbc_activate(struct drm_i915_private *dev_priv)
static void glk_fbc_program_cfb_stride(struct drm_i915_private *i915)
{
struct intel_fbc *fbc = &dev_priv->fbc;
struct intel_fbc *fbc = &i915->fbc;
const struct intel_fbc_reg_params *params = &fbc->params;
u32 dpfc_ctl;
u32 val = 0;
if (DISPLAY_VER(dev_priv) >= 10) {
u32 val = 0;
if (params->override_cfb_stride)
val |= FBC_STRIDE_OVERRIDE |
FBC_STRIDE(params->override_cfb_stride / fbc->limit);
if (params->override_cfb_stride)
val |= FBC_STRIDE_OVERRIDE |
FBC_STRIDE(params->override_cfb_stride / fbc->limit);
intel_de_write(i915, GLK_FBC_STRIDE, val);
}
intel_de_write(dev_priv, GLK_FBC_STRIDE, val);
} else if (DISPLAY_VER(dev_priv) == 9) {
u32 val = 0;
static void skl_fbc_program_cfb_stride(struct drm_i915_private *i915)
{
struct intel_fbc *fbc = &i915->fbc;
const struct intel_fbc_reg_params *params = &fbc->params;
u32 val = 0;
/* Display WA #0529: skl, kbl, bxt. */
if (params->override_cfb_stride)
val |= CHICKEN_FBC_STRIDE_OVERRIDE |
CHICKEN_FBC_STRIDE(params->override_cfb_stride / fbc->limit);
/* Display WA #0529: skl, kbl, bxt. */
if (params->override_cfb_stride)
val |= CHICKEN_FBC_STRIDE_OVERRIDE |
CHICKEN_FBC_STRIDE(params->override_cfb_stride / fbc->limit);
intel_de_rmw(dev_priv, CHICKEN_MISC_4,
CHICKEN_FBC_STRIDE_OVERRIDE |
CHICKEN_FBC_STRIDE_MASK, val);
}
intel_de_rmw(i915, CHICKEN_MISC_4,
CHICKEN_FBC_STRIDE_OVERRIDE |
CHICKEN_FBC_STRIDE_MASK, val);
}
static void gen7_fbc_activate(struct drm_i915_private *dev_priv)
{
struct intel_fbc *fbc = &dev_priv->fbc;
const struct intel_fbc_reg_params *params = &fbc->params;
u32 dpfc_ctl;
if (DISPLAY_VER(dev_priv) >= 10)
glk_fbc_program_cfb_stride(dev_priv);
else if (DISPLAY_VER(dev_priv) == 9)
skl_fbc_program_cfb_stride(dev_priv);
dpfc_ctl = 0;
if (IS_IVYBRIDGE(dev_priv))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment