Commit e49a656b authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/fbc: Start passing around intel_fbc

In preparation for multiple FBC instances start passing around
intel_fbc pointers rather than i915 pointers. And once there are
multiple of these we can't rely on container_of() to get back to
the i915, so we toss in a fbc->i915 pointer already.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-17-ville.syrjala@linux.intel.comAcked-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
parent d0618823
...@@ -10815,7 +10815,7 @@ void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915) ...@@ -10815,7 +10815,7 @@ void intel_modeset_driver_remove_noirq(struct drm_i915_private *i915)
destroy_workqueue(i915->flip_wq); destroy_workqueue(i915->flip_wq);
destroy_workqueue(i915->modeset_wq); destroy_workqueue(i915->modeset_wq);
intel_fbc_cleanup_cfb(i915); intel_fbc_cleanup(i915);
} }
/* part #3: call after gem init */ /* part #3: call after gem init */
......
...@@ -52,10 +52,10 @@ static int i915_fbc_status(struct seq_file *m, void *unused) ...@@ -52,10 +52,10 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
mutex_lock(&fbc->lock); mutex_lock(&fbc->lock);
if (intel_fbc_is_active(dev_priv)) { if (intel_fbc_is_active(fbc)) {
seq_puts(m, "FBC enabled\n"); seq_puts(m, "FBC enabled\n");
seq_printf(m, "Compressing: %s\n", seq_printf(m, "Compressing: %s\n",
yesno(intel_fbc_is_compressing(dev_priv))); yesno(intel_fbc_is_compressing(fbc)));
} else { } else {
seq_printf(m, "FBC disabled: %s\n", fbc->no_fbc_reason); seq_printf(m, "FBC disabled: %s\n", fbc->no_fbc_reason);
} }
...@@ -79,7 +79,7 @@ static int i915_fbc_false_color_set(void *data, u64 val) ...@@ -79,7 +79,7 @@ static int i915_fbc_false_color_set(void *data, u64 val)
{ {
struct drm_i915_private *dev_priv = data; struct drm_i915_private *dev_priv = data;
return intel_fbc_set_false_color(dev_priv, val); return intel_fbc_set_false_color(&dev_priv->fbc, val);
} }
DEFINE_SIMPLE_ATTRIBUTE(i915_fbc_false_color_fops, DEFINE_SIMPLE_ATTRIBUTE(i915_fbc_false_color_fops,
...@@ -2063,7 +2063,7 @@ i915_fifo_underrun_reset_write(struct file *filp, ...@@ -2063,7 +2063,7 @@ i915_fifo_underrun_reset_write(struct file *filp,
return ret; return ret;
} }
ret = intel_fbc_reset_underrun(dev_priv); ret = intel_fbc_reset_underrun(&dev_priv->fbc);
if (ret) if (ret)
return ret; return ret;
......
This diff is collapsed.
...@@ -14,17 +14,19 @@ struct drm_i915_private; ...@@ -14,17 +14,19 @@ struct drm_i915_private;
struct intel_atomic_state; struct intel_atomic_state;
struct intel_crtc; struct intel_crtc;
struct intel_crtc_state; struct intel_crtc_state;
struct intel_fbc;
struct intel_plane_state; struct intel_plane_state;
void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
struct intel_atomic_state *state); struct intel_atomic_state *state);
bool intel_fbc_is_active(struct drm_i915_private *dev_priv); bool intel_fbc_is_active(struct intel_fbc *fbc);
bool intel_fbc_is_compressing(struct drm_i915_private *dev_priv); bool intel_fbc_is_compressing(struct intel_fbc *fbc);
bool intel_fbc_pre_update(struct intel_atomic_state *state, bool intel_fbc_pre_update(struct intel_atomic_state *state,
struct intel_crtc *crtc); struct intel_crtc *crtc);
void intel_fbc_post_update(struct intel_atomic_state *state, void intel_fbc_post_update(struct intel_atomic_state *state,
struct intel_crtc *crtc); 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_cleanup(struct drm_i915_private *dev_priv);
void intel_fbc_update(struct intel_atomic_state *state, void intel_fbc_update(struct intel_atomic_state *state,
struct intel_crtc *crtc); struct intel_crtc *crtc);
void intel_fbc_disable(struct intel_crtc *crtc); void intel_fbc_disable(struct intel_crtc *crtc);
...@@ -34,10 +36,8 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv, ...@@ -34,10 +36,8 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
enum fb_op_origin origin); enum fb_op_origin origin);
void intel_fbc_flush(struct drm_i915_private *dev_priv, void intel_fbc_flush(struct drm_i915_private *dev_priv,
unsigned int frontbuffer_bits, enum fb_op_origin origin); unsigned int frontbuffer_bits, enum fb_op_origin origin);
void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv); void intel_fbc_handle_fifo_underrun_irq(struct intel_fbc *fbc);
void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv); int intel_fbc_reset_underrun(struct intel_fbc *fbc);
int intel_fbc_reset_underrun(struct drm_i915_private *dev_priv); int intel_fbc_set_false_color(struct intel_fbc *fbc, bool enable);
int intel_fbc_set_false_color(struct drm_i915_private *i915,
bool enable);
#endif /* __INTEL_FBC_H__ */ #endif /* __INTEL_FBC_H__ */
...@@ -434,7 +434,7 @@ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv, ...@@ -434,7 +434,7 @@ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
drm_err(&dev_priv->drm, "CPU pipe %c FIFO underrun\n", pipe_name(pipe)); drm_err(&dev_priv->drm, "CPU pipe %c FIFO underrun\n", pipe_name(pipe));
} }
intel_fbc_handle_fifo_underrun_irq(dev_priv); intel_fbc_handle_fifo_underrun_irq(&dev_priv->fbc);
} }
/** /**
......
...@@ -407,6 +407,7 @@ struct intel_fbc_funcs; ...@@ -407,6 +407,7 @@ struct intel_fbc_funcs;
#define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */ #define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */
struct intel_fbc { struct intel_fbc {
struct drm_i915_private *i915;
const struct intel_fbc_funcs *funcs; const struct intel_fbc_funcs *funcs;
/* This is always the inner lock when overlapping with struct_mutex and /* This is always the inner lock when overlapping with struct_mutex and
......
...@@ -3375,7 +3375,7 @@ static void ilk_wm_merge(struct drm_i915_private *dev_priv, ...@@ -3375,7 +3375,7 @@ static void ilk_wm_merge(struct drm_i915_private *dev_priv,
* enabled sometime later. * enabled sometime later.
*/ */
if (DISPLAY_VER(dev_priv) == 5 && !merged->fbc_wm_enabled && if (DISPLAY_VER(dev_priv) == 5 && !merged->fbc_wm_enabled &&
intel_fbc_is_active(dev_priv)) { intel_fbc_is_active(&dev_priv->fbc)) {
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