• Ville Syrjälä's avatar
    drm/i915: Update pipes in reverse order for bigjoiner · e02ef555
    Ville Syrjälä authored
    With bigjoiner the master crtc is the one that will send out the
    uapi event/etc. We want that to happen after all the slaves are
    done, so let's try to do the commits in reverse order so that
    the master comes last.
    
    Even worse, the modeset helper will simply complete the commit
    on the slave pipe immediately as it consider the crtc to be inactive
    (it can't see our crtc_state->hw.active/etc.).
    
    With regular sync updates this generally doesn't matter all that
    much as the slave pipe should typically finish its work during the
    same frame as the master pipe. However in case the slave pipe's commit
    slips into the next frame we end up in a bit of trouble. This is most
    visible with either async flips (currently disabled with bigjoiner
    exactly for this reason), and DSB gamma updates. With DSB the problem
    happens because the DSB itself will wait until the next start vblank
    before starting to execute. So if the master pipe already finished its
    commit and the DSB on the slave pipe is still waiting for the next
    vblank we will assume the DSB as gotten stuck and terminate it.
    
    Reversing the commit order should ameliarate this for the most part
    as the master pipe is guaranteed to start its commit after the slave
    pipe started. The one thing that can still screw us over is the fact
    that we aren't necessarily going to commit the pipes in the reverse
    order as the actual order is dictated by the DDB overlap avoidance.
    But that can only happen while other pipes are being enabled/disabled,
    and so in the normal steady state we should be safe.
    
    The full fix will involve making the commit machinery aware of the
    slave pipes and not finish their commits prematurely. But that
    will involve a bit more work than this. And this commit order
    reversal will still be beneficial to avoid userspace getting an
    -EBUSY from the following page flip if the second pipe's commit
    does stretch into the next frame.
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240404213441.17637-2-ville.syrjala@linux.intel.comReviewed-by: default avatarArun R Murthy <arun.r.murthy@intel.com>
    Reviewed-by: default avatarVandita Kulkarni <vandita.kulkarni@intel.com>
    e02ef555
intel_display.h 20.6 KB