Commit 0e631adc authored by Paulo Zanoni's avatar Paulo Zanoni

drm/i915: introduce is_active/activate/deactivate to the FBC terminology

The long term goal is to have enable/disable as the higher level
functions and activate/deactivate as the lower level functions, just
like we do for PSR and for the CRTC. This way, we'll run enable and
disable once per modeset, while update, activate and deactivate will
be run many times. With this, we can move the checks and code that
need to run only once per modeset to enable(), making the code simpler
and possibly a little faster.

This patch is just the first step on the conversion: it starts by
converting the current low level functions from enable/disable to
activate/deactivate. This patch by itself has no benefits other than
making review and rebase easier. Please see the next patches for more
details on the conversion.

v2:
  - Rebase.
  - Improve commit message (Chris).
v3: Rebase after changing the patch order.
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/
parent 754d1133
...@@ -1639,7 +1639,7 @@ static int i915_fbc_status(struct seq_file *m, void *unused) ...@@ -1639,7 +1639,7 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
intel_runtime_pm_get(dev_priv); intel_runtime_pm_get(dev_priv);
mutex_lock(&dev_priv->fbc.lock); mutex_lock(&dev_priv->fbc.lock);
if (intel_fbc_enabled(dev_priv)) if (intel_fbc_is_active(dev_priv))
seq_puts(m, "FBC enabled\n"); seq_puts(m, "FBC enabled\n");
else else
seq_printf(m, "FBC disabled: %s\n", seq_printf(m, "FBC disabled: %s\n",
......
...@@ -915,9 +915,7 @@ struct i915_fbc { ...@@ -915,9 +915,7 @@ struct i915_fbc {
bool false_color; bool false_color;
/* Tracks whether the HW is actually enabled, not whether the feature is bool active;
* possible. */
bool enabled;
struct intel_fbc_work { struct intel_fbc_work {
struct delayed_work work; struct delayed_work work;
...@@ -926,9 +924,9 @@ struct i915_fbc { ...@@ -926,9 +924,9 @@ struct i915_fbc {
const char *no_fbc_reason; const char *no_fbc_reason;
bool (*fbc_enabled)(struct drm_i915_private *dev_priv); bool (*is_active)(struct drm_i915_private *dev_priv);
void (*enable_fbc)(struct intel_crtc *crtc); void (*activate)(struct intel_crtc *crtc);
void (*disable_fbc)(struct drm_i915_private *dev_priv); void (*deactivate)(struct drm_i915_private *dev_priv);
}; };
/** /**
......
...@@ -3174,8 +3174,8 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, ...@@ -3174,8 +3174,8 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
if (dev_priv->fbc.disable_fbc) if (dev_priv->fbc.deactivate)
dev_priv->fbc.disable_fbc(dev_priv); dev_priv->fbc.deactivate(dev_priv);
dev_priv->display.update_primary_plane(crtc, fb, x, y); dev_priv->display.update_primary_plane(crtc, fb, x, y);
......
...@@ -1322,7 +1322,7 @@ static inline void intel_fbdev_restore_mode(struct drm_device *dev) ...@@ -1322,7 +1322,7 @@ static inline void intel_fbdev_restore_mode(struct drm_device *dev)
#endif #endif
/* intel_fbc.c */ /* intel_fbc.c */
bool intel_fbc_enabled(struct drm_i915_private *dev_priv); bool intel_fbc_is_active(struct drm_i915_private *dev_priv);
void intel_fbc_update(struct intel_crtc *crtc); void intel_fbc_update(struct intel_crtc *crtc);
void intel_fbc_init(struct drm_i915_private *dev_priv); void intel_fbc_init(struct drm_i915_private *dev_priv);
void intel_fbc_disable(struct drm_i915_private *dev_priv); void intel_fbc_disable(struct drm_i915_private *dev_priv);
......
This diff is collapsed.
...@@ -2430,7 +2430,7 @@ static void ilk_wm_merge(struct drm_device *dev, ...@@ -2430,7 +2430,7 @@ static void ilk_wm_merge(struct drm_device *dev,
* enabled sometime later. * enabled sometime later.
*/ */
if (IS_GEN5(dev) && !merged->fbc_wm_enabled && if (IS_GEN5(dev) && !merged->fbc_wm_enabled &&
intel_fbc_enabled(dev_priv)) { intel_fbc_is_active(dev_priv)) {
for (level = 2; level <= max_level; level++) { for (level = 2; level <= max_level; level++) {
struct intel_wm_level *wm = &merged->wm[level]; struct intel_wm_level *wm = &merged->wm[level];
......
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