[PATCH 1/2] wip: drm/i915/display/fbc: Make fences a nice-to-have
José Roberto de Souza
jose.souza at intel.com
Sat Jan 25 01:35:29 UTC 2020
dGFX have local memory so it do not have aperture and do not support
CPU fences but even for iGFX it have a small number of fences.
As replacement for fences we have a software tracking that is already
in used by FBC and PSR. PSR don't support fences so it shows that
this tracking is reliable.
So lets make fences a nice-to-have to activate FBC, this will allow
us to enable it for dGFX and on the stress cases of iGFX.
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 28 +++---------------------
1 file changed, 3 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 88a9c2fea695..1587bd804b48 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -599,13 +599,8 @@ static bool pixel_format_is_valid(struct drm_i915_private *dev_priv,
}
}
-/*
- * For some reason, the hardware tracking starts looking at whatever we
- * programmed as the display plane base address register. It does not look at
- * the X and Y offset registers. That's why we look at the crtc->adjusted{x,y}
- * variables instead of just looking at the pipe/plane size.
- */
-static bool intel_fbc_hw_tracking_covers_screen(struct intel_crtc *crtc)
+/* TODO remove adjusted and only compare plane 1A size */
+static bool pipe_size_is_valid(struct intel_crtc *crtc)
{
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
struct intel_fbc *fbc = &dev_priv->fbc;
@@ -709,28 +704,11 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
return false;
}
- if (!intel_fbc_hw_tracking_covers_screen(crtc)) {
+ if (!pipe_size_is_valid(crtc)) {
fbc->no_fbc_reason = "mode too large for compression";
return false;
}
- /* The use of a CPU fence is mandatory in order to detect writes
- * by the CPU to the scanout and trigger updates to the FBC.
- *
- * Note that is possible for a tiled surface to be unmappable (and
- * so have no fence associated with it) due to aperture constaints
- * at the time of pinning.
- *
- * FIXME with 90/270 degree rotation we should use the fence on
- * the normal GTT view (the rotated view doesn't even have a
- * fence). Would need changes to the FBC fence Y offset as well.
- * For now this will effecively disable FBC with 90/270 degree
- * rotation.
- */
- if (cache->fence_id < 0) {
- fbc->no_fbc_reason = "framebuffer not tiled or fenced";
- return false;
- }
if (INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv) &&
cache->plane.rotation != DRM_MODE_ROTATE_0) {
fbc->no_fbc_reason = "rotation unsupported";
--
2.25.0
More information about the Intel-gfx-trybot
mailing list