Skip to content
Snippets Groups Projects

loader/dri3: Check for window destruction in dri3_wait_for_event_locked

Merged Michel Dänzer requested to merge daenzer/mesa:dri3_wait_for_event_locked-poll into master
1 unresolved thread

If the underlying X11 window gets destroyed, the event we're waiting for may never be delivered, in which case xcb_wait_for_special_event would hang indefinitely.

Solution:

  1. Use xcb_poll_for_special_event to check if an event has arrived yet.
  2. If not, Wait up to ~1s for XCB's file descriptor to become readable; if it does, go back to step 1.
  3. If the file descriptor didn't become readable, make a round-trip to the X server to check that the window still exists. Go back to step 1 if it does, otherwise bail.

Also add an early bail-out when it's known that the window was destroyed.

Closes: #116 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • My expertise here is not great, but this looks good to me.

    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

  • I tested it, it fixes #3162 (closed)/#116 (closed) for me. VLC takes a couple seconds to fully close.

  • Michel Dänzer added 882 commits

    added 882 commits

    • 5fd9d013...7a5e6fd2 - 879 commits from branch mesa:master
    • 215b2fac - loader/dri3: Add dri3_wait_for_event_locked full_sequence out parameter
    • 935844a4 - loader/dri3: Use dri3_wait_for_event_locked in loader_dri3_wait_for_msc
    • f6c7e39e - loader/dri3: Check for window destruction in dri3_wait_for_event_locked

    Compare with previous version

  • Michel Dänzer resolved all threads

    resolved all threads

  • Marge Bot added 8 commits

    added 8 commits

    • f6c7e39e...622c5489 - 5 commits from branch mesa:master
    • b5622bf2 - loader/dri3: Add dri3_wait_for_event_locked full_sequence out parameter
    • 7a03d708 - loader/dri3: Use dri3_wait_for_event_locked in loader_dri3_wait_for_msc
    • 878b7c0a - loader/dri3: Check for window destruction in dri3_wait_for_event_locked

    Compare with previous version

  • Marge Bot assigned to @daenzer and unassigned @marge-bot

    assigned to @daenzer and unassigned @marge-bot

  • I couldn't merge this branch: CI failed!

  • Michel Dänzer assigned to @marge-bot and unassigned @daenzer

    assigned to @marge-bot and unassigned @daenzer

  • Marge Bot added 7 commits

    added 7 commits

    • 878b7c0a...08c39a8a - 4 commits from branch mesa:master
    • ee779517 - loader/dri3: Add dri3_wait_for_event_locked full_sequence out parameter
    • 7c226116 - loader/dri3: Use dri3_wait_for_event_locked in loader_dri3_wait_for_msc
    • d7d76878 - loader/dri3: Check for window destruction in dri3_wait_for_event_locked

    Compare with previous version

  • merged

  • Michel Dänzer mentioned in commit e6091908

    mentioned in commit e6091908

  • Michel Dänzer mentioned in commit a7c5c983

    mentioned in commit a7c5c983

  • Michel Dänzer mentioned in commit 195dd044

    mentioned in commit 195dd044

  • mentioned in issue #3214 (closed)

  • mentioned in issue xorg/lib/libxcb#38

  • Michel Dänzer mentioned in merge request xorg/lib/libxcb!9

    mentioned in merge request xorg/lib/libxcb!9

  • Michel Dänzer mentioned in merge request !13564 (merged)

    mentioned in merge request !13564 (merged)

  • Please register or sign in to reply
    Loading