• Keith Packard's avatar
    drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operations · 9e44af79
    Keith Packard authored
    To synchronize clip lists with the X server, the DRM lock must be held while
    looking at drawable clip lists. To synchronize with other ring access, the
    ring mutex must be held while inserting commands into the ring.  Failure to
    do the first resulted in easy visual corruption when moving windows, and the
    second could have corrupted the ring with DRI2.
    
    Grabbing the DRM lock involves using the DRM tasklet mechanism, grabbing the
    ring mutex means potentially sleeping. Deal with both of these by always
    running the tasklet from a work handler.
    
    Also, protect from clip list changes since the vblank request was queued by
    making sure the window has at least one rectangle while looking inside,
    preventing oopses .
    Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
    Signed-off-by: default avatarEric Anholt <eric@anholt.net>
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    9e44af79
drm_lock.c 10.9 KB