/** * intel_fbc_init_pipe_state - initialize FBC's CRTC visibility tracking * @dev_priv: i915 device instance * * The FBC code needs to track CRTC visibility since the older platforms can't * have FBC enabled while multiple pipes are used. This function does the * initial setup at driver load to make sure FBC is matching the real hardware. */ void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv) { struct intel_crtc *crtc; /* Don't even bother tracking anything if we don't need. */ if (!no_fbc_on_multiple_pipes(dev_priv)) return; for_each_intel_crtc(dev_priv->dev, crtc) if (intel_crtc_active(&crtc->base) && to_intel_plane_state(crtc->base.primary->state)->visible) dev_priv->fbc.visible_pipes_mask |= (1 << crtc->pipe); }
static bool multiple_pipes_ok(struct intel_crtc *crtc, struct intel_plane_state *plane_state) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct intel_fbc *fbc = &dev_priv->fbc; enum pipe pipe = crtc->pipe; /* Don't even bother tracking anything we don't need. */ if (!no_fbc_on_multiple_pipes(dev_priv)) return true; if (plane_state->base.visible) fbc->visible_pipes_mask |= (1 << pipe); else fbc->visible_pipes_mask &= ~(1 << pipe); return (fbc->visible_pipes_mask & ~(1 << pipe)) != 0; }
static bool multiple_pipes_ok(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; struct drm_plane *primary = crtc->base.primary; struct intel_fbc *fbc = &dev_priv->fbc; enum pipe pipe = crtc->pipe; /* Don't even bother tracking anything we don't need. */ if (!no_fbc_on_multiple_pipes(dev_priv)) return true; WARN_ON(!drm_modeset_is_locked(&primary->mutex)); if (to_intel_plane_state(primary->state)->visible) fbc->visible_pipes_mask |= (1 << pipe); else fbc->visible_pipes_mask &= ~(1 << pipe); return (fbc->visible_pipes_mask & ~(1 << pipe)) != 0; }