diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-10-16 16:44:43 -0300 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2015-12-03 11:13:45 -0200 |
commit | 90d5234fdbccbd03250a54acf1a1793654e7eebf (patch) | |
tree | 9361fb91300033bccbaa3eb82c49dd8792e78cd5 /drivers/gpu | |
parent | bffce907d64042b5683ed3076e839d0249606264 (diff) | |
download | lwn-90d5234fdbccbd03250a54acf1a1793654e7eebf.tar.gz lwn-90d5234fdbccbd03250a54acf1a1793654e7eebf.zip |
drm/i915: fix the CFB size check
In function find_compression_threshold() we try to over-allocate CFB
space in order to reduce 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.
v2: Use drm_mm_node_allocated() (Chris).
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index 11fc5281e8ef..9eb94c04ce69 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -720,7 +720,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 (drm_mm_node_allocated(&dev_priv->fbc.compressed_fb) && + size <= dev_priv->fbc.compressed_fb.size * dev_priv->fbc.threshold) return 0; /* Release any current block */ |