[Intel-gfx] [PATCH 14/18] drm/i915: fix the CFB size check
Paulo Zanoni
paulo.r.zanoni at intel.com
Tue Oct 20 06:50:00 PDT 2015
In function find_compression_threshold() we try to over-allocate CFB
space in order to reudce reallocations and fragmentation, and we're
not considering that at the CFB size check. Consider it.
There is also a longer-term plan to kill
dev_priv->fbc.uncompressed_size, but this will come later.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
drivers/gpu/drm/i915/intel_fbc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 5dab0e0..bf855b2 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -733,7 +733,8 @@ static int intel_fbc_setup_cfb(struct intel_crtc *crtc)
size = intel_fbc_calculate_cfb_size(crtc);
cpp = drm_format_plane_cpp(fb->pixel_format, 0);
- if (size <= dev_priv->fbc.uncompressed_size)
+ if (dev_priv->fbc.compressed_fb.allocated &&
+ size <= dev_priv->fbc.compressed_fb.size * dev_priv->fbc.threshold)
return 0;
/* Release any current block */
--
2.6.1
More information about the Intel-gfx
mailing list