• Paulo Zanoni's avatar
    drm/i915: fix FBC buffer size checks · 856312ae
    Paulo Zanoni authored
    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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    856312ae
intel_fbc.c 31 KB