]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/fbc: fix CFB size calculation for gen8+
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Fri, 21 Oct 2016 15:55:45 +0000 (13:55 -0200)
committerPaulo Zanoni <paulo.r.zanoni@intel.com>
Mon, 24 Oct 2016 19:37:37 +0000 (17:37 -0200)
commit783e1b28307b0fd240a6755dd7ab6e0c3ffbcf4c
tree1d0f613adf8e015d44837ab84246c45cf765b8d7
parent75ed29d01ecf92f39e6b9805408a7941c78508ee
drm/i915/fbc: fix CFB size calculation for gen8+

Broadwell and newer actually compress up to 2560 lines instead of 2048
(as documented in the FBC_CTL page). If we don't take this into
consideration we end up reserving too little stolen memory for the
CFB, so we may allocate something else (such as a ring) right after
what we reserved, and the hardware will overwrite it with the contents
of the CFB when FBC is active, causing GPU hangs. Another possibility
is that the CFB may be allocated at the very end of the available
space, so the CFB will overlap the reserved stolen area, leading to
FIFO underruns.

This bug has always been a problem on BDW (the only affected platform
where FBC is enabled by default), but it's much easier to reproduce
since the following commit:
    commit c2b86cf5b66b1d1ffc2bb00a037f5f298e8120a8
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Thu Aug 18 17:16:57 2016 +0100
        drm/i915: Allocate rings from stolen

Of course, you can only reproduce the bug if your screen is taller
than 2048 lines.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98213
Fixes: abbf02487cc2 ("drm/i915/fbc: enable FBC by default on HSW and BDW")
Cc: <stable@vger.kernel.org> # v4.6+
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477065346-13736-1-git-send-email-paulo.r.zanoni@intel.com
drivers/gpu/drm/i915/intel_fbc.c