Commit 5375ce9f authored by Paulo Zanoni's avatar Paulo Zanoni

drm/i915/fbc: set fbc->active from the new activation functions

Now that we have top-level gen-independent hw_activate and
hw_deactivate functions, set fbc->active directly from them, removing
the duplicated code.
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1454101060-23198-3-git-send-email-paulo.r.zanoni@intel.com
parent 8c40074c
...@@ -115,8 +115,6 @@ static void i8xx_fbc_deactivate(struct drm_i915_private *dev_priv) ...@@ -115,8 +115,6 @@ static void i8xx_fbc_deactivate(struct drm_i915_private *dev_priv)
{ {
u32 fbc_ctl; u32 fbc_ctl;
dev_priv->fbc.active = false;
/* Disable compression */ /* Disable compression */
fbc_ctl = I915_READ(FBC_CONTROL); fbc_ctl = I915_READ(FBC_CONTROL);
if ((fbc_ctl & FBC_CTL_EN) == 0) if ((fbc_ctl & FBC_CTL_EN) == 0)
...@@ -139,8 +137,6 @@ static void i8xx_fbc_activate(struct drm_i915_private *dev_priv) ...@@ -139,8 +137,6 @@ static void i8xx_fbc_activate(struct drm_i915_private *dev_priv)
int i; int i;
u32 fbc_ctl; u32 fbc_ctl;
dev_priv->fbc.active = true;
/* Note: fbc.threshold == 1 for i8xx */ /* Note: fbc.threshold == 1 for i8xx */
cfb_pitch = params->cfb_size / FBC_LL_SIZE; cfb_pitch = params->cfb_size / FBC_LL_SIZE;
if (params->fb.stride < cfb_pitch) if (params->fb.stride < cfb_pitch)
...@@ -187,8 +183,6 @@ static void g4x_fbc_activate(struct drm_i915_private *dev_priv) ...@@ -187,8 +183,6 @@ static void g4x_fbc_activate(struct drm_i915_private *dev_priv)
struct intel_fbc_reg_params *params = &dev_priv->fbc.params; struct intel_fbc_reg_params *params = &dev_priv->fbc.params;
u32 dpfc_ctl; u32 dpfc_ctl;
dev_priv->fbc.active = true;
dpfc_ctl = DPFC_CTL_PLANE(params->crtc.plane) | DPFC_SR_EN; dpfc_ctl = DPFC_CTL_PLANE(params->crtc.plane) | DPFC_SR_EN;
if (drm_format_plane_cpp(params->fb.pixel_format, 0) == 2) if (drm_format_plane_cpp(params->fb.pixel_format, 0) == 2)
dpfc_ctl |= DPFC_CTL_LIMIT_2X; dpfc_ctl |= DPFC_CTL_LIMIT_2X;
...@@ -206,8 +200,6 @@ static void g4x_fbc_deactivate(struct drm_i915_private *dev_priv) ...@@ -206,8 +200,6 @@ static void g4x_fbc_deactivate(struct drm_i915_private *dev_priv)
{ {
u32 dpfc_ctl; u32 dpfc_ctl;
dev_priv->fbc.active = false;
/* Disable compression */ /* Disable compression */
dpfc_ctl = I915_READ(DPFC_CONTROL); dpfc_ctl = I915_READ(DPFC_CONTROL);
if (dpfc_ctl & DPFC_CTL_EN) { if (dpfc_ctl & DPFC_CTL_EN) {
...@@ -234,8 +226,6 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv) ...@@ -234,8 +226,6 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv)
u32 dpfc_ctl; u32 dpfc_ctl;
int threshold = dev_priv->fbc.threshold; int threshold = dev_priv->fbc.threshold;
dev_priv->fbc.active = true;
dpfc_ctl = DPFC_CTL_PLANE(params->crtc.plane); dpfc_ctl = DPFC_CTL_PLANE(params->crtc.plane);
if (drm_format_plane_cpp(params->fb.pixel_format, 0) == 2) if (drm_format_plane_cpp(params->fb.pixel_format, 0) == 2)
threshold++; threshold++;
...@@ -274,8 +264,6 @@ static void ilk_fbc_deactivate(struct drm_i915_private *dev_priv) ...@@ -274,8 +264,6 @@ static void ilk_fbc_deactivate(struct drm_i915_private *dev_priv)
{ {
u32 dpfc_ctl; u32 dpfc_ctl;
dev_priv->fbc.active = false;
/* Disable compression */ /* Disable compression */
dpfc_ctl = I915_READ(ILK_DPFC_CONTROL); dpfc_ctl = I915_READ(ILK_DPFC_CONTROL);
if (dpfc_ctl & DPFC_CTL_EN) { if (dpfc_ctl & DPFC_CTL_EN) {
...@@ -295,8 +283,6 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv) ...@@ -295,8 +283,6 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv)
u32 dpfc_ctl; u32 dpfc_ctl;
int threshold = dev_priv->fbc.threshold; int threshold = dev_priv->fbc.threshold;
dev_priv->fbc.active = true;
dpfc_ctl = 0; dpfc_ctl = 0;
if (IS_IVYBRIDGE(dev_priv)) if (IS_IVYBRIDGE(dev_priv))
dpfc_ctl |= IVB_DPFC_CTL_PLANE(params->crtc.plane); dpfc_ctl |= IVB_DPFC_CTL_PLANE(params->crtc.plane);
...@@ -355,6 +341,10 @@ static bool intel_fbc_hw_is_active(struct drm_i915_private *dev_priv) ...@@ -355,6 +341,10 @@ static bool intel_fbc_hw_is_active(struct drm_i915_private *dev_priv)
static void intel_fbc_hw_activate(struct drm_i915_private *dev_priv) static void intel_fbc_hw_activate(struct drm_i915_private *dev_priv)
{ {
struct intel_fbc *fbc = &dev_priv->fbc;
fbc->active = true;
if (INTEL_INFO(dev_priv)->gen >= 7) if (INTEL_INFO(dev_priv)->gen >= 7)
gen7_fbc_activate(dev_priv); gen7_fbc_activate(dev_priv);
else if (INTEL_INFO(dev_priv)->gen >= 5) else if (INTEL_INFO(dev_priv)->gen >= 5)
...@@ -367,6 +357,10 @@ static void intel_fbc_hw_activate(struct drm_i915_private *dev_priv) ...@@ -367,6 +357,10 @@ static void intel_fbc_hw_activate(struct drm_i915_private *dev_priv)
static void intel_fbc_hw_deactivate(struct drm_i915_private *dev_priv) static void intel_fbc_hw_deactivate(struct drm_i915_private *dev_priv)
{ {
struct intel_fbc *fbc = &dev_priv->fbc;
fbc->active = false;
if (INTEL_INFO(dev_priv)->gen >= 5) if (INTEL_INFO(dev_priv)->gen >= 5)
ilk_fbc_deactivate(dev_priv); ilk_fbc_deactivate(dev_priv);
else if (IS_GM45(dev_priv)) else if (IS_GM45(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