]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: fix FBC buffer size checks
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Thu, 1 Oct 2015 22:57:12 +0000 (19:57 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 9 Oct 2015 07:35:50 +0000 (09:35 +0200)
commitacd1b04813fab37bdcdc1732c3196805cb0c4fb4
treedcbcdd7b6576111db6cd79e78722e902ab5b8596
parent5add6184a04d4c59932134e2a10cc9e2caf9fe73
drm/i915: fix FBC buffer size checks

According to my experiments (and later confirmation from the hardware
developers), the maximum sizes mentioned in the specification delimit
how far in the buffer the hardware tracking can go. And the hardware
calculates the size based on the plane address we provide - and the
provided plane address might not be the real x:0,y:0 point due to the
compute_page_offset() function.

On platforms that do the x/y offset adjustment trick it will be really
hard to reproduce a bug, but on the current SKL we can reproduce the
bug with igt/kms_frontbuffer_tracking/fbc-farfromfence. With this
patch, we'll go from "CRC assertion failure" to "FBC unexpectedly
disabled", which is still a failure on the test suite but is not a
perceived user bug - you will just not save as much power as you could
if FBC is disabled.

v2, rewrite patch after clarification from the Hadware guys:
  - Rename function so it's clear what the check is for.
  - Use the new intel_fbc_get_plane_source_sizes() function in order
    to get the proper sizes as seen by FBC.
v3:
  - Rebase after the s/sizes/size/ on the previous patch.
  - Adjust comment wording (Ville).
  - s/used_/effective_/ (Ville).

Testcase: igt/kms_frontbuffer_tracking/fbc-farfromfence (SKL)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_fbc.c