Changeset 242597 in webkit


Ignore:
Timestamp:
Mar 7, 2019 9:17:16 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend
https://bugs.webkit.org/show_bug.cgi?id=195410

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-03-07
Reviewed by Žan Doberšek.

Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent
state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead
of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current
updae tha compositing state. A new method resume() is also added to schedule an update if needed.

  • Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:

(WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer.
(WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled
while suspended.
(WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended.
(WebKit::CompositingRunLoop::compositionCompleted): Ditto.
(WebKit::CompositingRunLoop::updateCompleted): Ditto.
(WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended.

  • Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:

(WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates().
(WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume().

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r242596 r242597  
     12019-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend
     4        https://bugs.webkit.org/show_bug.cgi?id=195410
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent
     9        state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead
     10        of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current
     11        updae tha compositing state. A new method resume() is also added to schedule an update if needed.
     12
     13        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
     14        (WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer.
     15        (WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled
     16        while suspended.
     17        (WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended.
     18        (WebKit::CompositingRunLoop::compositionCompleted): Ditto.
     19        (WebKit::CompositingRunLoop::updateCompleted): Ditto.
     20        (WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended.
     21        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
     22        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
     23        (WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates().
     24        (WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume().
     25
    1262019-03-06  Mark Lam  <mark.lam@apple.com>
    227
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp

    r242266 r242597  
    9595}
    9696
     97void CompositingRunLoop::suspend()
     98{
     99    LockHolder stateLocker(m_state.lock);
     100    m_state.isSuspended = true;
     101    m_updateTimer.stop();
     102}
     103
     104void CompositingRunLoop::resume()
     105{
     106    LockHolder stateLocker(m_state.lock);
     107    m_state.isSuspended = false;
     108    if (m_state.update == UpdateState::Scheduled)
     109        m_updateTimer.startOneShot(0_s);
     110}
     111
    97112void CompositingRunLoop::scheduleUpdate()
    98113{
     
    114129    case UpdateState::Idle:
    115130        m_state.update = UpdateState::Scheduled;
    116         m_updateTimer.startOneShot(0_s);
     131        if (!m_state.isSuspended)
     132            m_updateTimer.startOneShot(0_s);
    117133        return;
    118134    case UpdateState::Scheduled:
     
    157173            m_state.pendingUpdate = false;
    158174            m_state.update = UpdateState::Scheduled;
    159             m_updateTimer.startOneShot(0_s);
     175            if (!m_state.isSuspended)
     176                m_updateTimer.startOneShot(0_s);
    160177            return;
    161178        }
     
    189206            m_state.pendingUpdate = false;
    190207            m_state.update = UpdateState::Scheduled;
    191             m_updateTimer.startOneShot(0_s);
     208            if (!m_state.isSuspended)
     209                m_updateTimer.startOneShot(0_s);
    192210            return;
    193211        }
     
    205223        // Both composition and scene update are now in progress.
    206224        LockHolder locker(m_state.lock);
     225        ASSERT(!m_state.isSuspended);
    207226        m_state.composition = CompositionState::InProgress;
    208227        m_state.update = UpdateState::InProgress;
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h

    r242266 r242597  
    4848    void performTaskSync(Function<void ()>&&);
    4949
     50    void suspend();
     51    void resume();
     52
    5053    Lock& stateLock() { return m_state.lock; }
    5154
     
    8285        UpdateState update { UpdateState::Idle };
    8386        bool pendingUpdate { false };
     87        bool isSuspended { false };
    8488    } m_state;
    8589};
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

    r242364 r242597  
    122122        return;
    123123
    124     m_compositingRunLoop->stopUpdates();
     124    m_compositingRunLoop->suspend();
    125125    m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
    126126        m_scene->setActive(false);
     
    137137        m_scene->setActive(true);
    138138    });
     139    m_compositingRunLoop->resume();
    139140}
    140141
Note: See TracChangeset for help on using the changeset viewer.