• Mario Kleiner's avatar
    drm/radeon: Slightly more robust flip completion handling for < DCE-4 · 73d4c23f
    Mario Kleiner authored
    Pre DCE4 hardware doesn't have (reliable) pageflip completion
    irqs, therefore we have to use the old polling method for flip
    completion handling in vblank irq.
    
    As vblank irqs fire a bit before start of vblank (when the
    linebuffer fifo read position reaches end of scanout), we
    have some fudge for flip completion handling in the last
    lines of active scanout. Old code assumed the threshold to
    be 99% of active scanout height, a ballpark estimate which
    worked ok. Since we know since a while how to calculate the
    actual threshold from linebuffer size, lets make use of it
    to get a more accurate threshold.
    
    This completion path is still prone to some races in corner
    cases, especially on pre-AVIVO hardware, so document them
    a bit better in the code comments.
    Acked-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
    Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    73d4c23f
radeon_display.c 61.2 KB