mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 15:11:31 +00:00
[idd] transport: coordinate recovery requests
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit is contained in:
@@ -493,25 +493,6 @@ bool CDeviceContext::InitializeTransport()
|
||||
CDeviceContext * context =
|
||||
static_cast<CDeviceContext *>(opaque);
|
||||
|
||||
SourceKey source;
|
||||
{
|
||||
CSRWExclusiveLock routeLock(context->m_recoveryRouteLock);
|
||||
if (!route || route != context->m_recoveryRoute ||
|
||||
session != context->m_recoverySession ||
|
||||
serial != context->m_recoverySerial ||
|
||||
active != context->m_recoveryActive)
|
||||
{
|
||||
DEBUG_WARN("Ignoring stale recovery route");
|
||||
return;
|
||||
}
|
||||
source = context->m_recoverySource;
|
||||
context->m_recoveryRoute = 0;
|
||||
context->m_recoverySource = {};
|
||||
context->m_recoverySession = 0;
|
||||
context->m_recoverySerial = 0;
|
||||
context->m_recoveryActive = false;
|
||||
}
|
||||
|
||||
ITransport::Recovery state = ITransport::Recovery::FAILED;
|
||||
uint32_t error = ERROR_SUCCESS;
|
||||
switch (result)
|
||||
@@ -537,7 +518,7 @@ bool CDeviceContext::InitializeTransport()
|
||||
}
|
||||
|
||||
context->m_transport->RecoveryStatus(
|
||||
source, session, serial, active, state, error);
|
||||
route, session, serial, active, state, error);
|
||||
},
|
||||
this);
|
||||
m_recoveryHandlerSet = true;
|
||||
@@ -639,37 +620,8 @@ InteractionResult CDeviceContext::OnSetResolution(const SourceKey& source,
|
||||
return SetResolution(width, height);
|
||||
}
|
||||
|
||||
void CDeviceContext::OnRecoveryRequest(const SourceKey& source,
|
||||
uint64_t session, uint32_t serial, bool active)
|
||||
bool CDeviceContext::OnRecoveryAction(const RecoveryAction& action)
|
||||
{
|
||||
if (!source.backend || !source.epoch || !session || !serial ||
|
||||
(serial & LGPipeMsg::RECOVERY_ACTIVE))
|
||||
return;
|
||||
|
||||
CSRWExclusiveLock publishLock(m_recoveryPublishLock);
|
||||
uint64_t route;
|
||||
{
|
||||
CSRWExclusiveLock routeLock(m_recoveryRouteLock);
|
||||
route = m_nextRecoveryRoute++;
|
||||
if (!m_nextRecoveryRoute)
|
||||
++m_nextRecoveryRoute;
|
||||
|
||||
m_recoveryRoute = route;
|
||||
m_recoverySource = source;
|
||||
m_recoverySession = session;
|
||||
m_recoverySerial = serial;
|
||||
m_recoveryActive = active;
|
||||
}
|
||||
|
||||
if (!g_pipe.SetRecovery(this, route, session, serial, active))
|
||||
{
|
||||
CSRWExclusiveLock routeLock(m_recoveryRouteLock);
|
||||
if (m_recoveryRoute != route)
|
||||
return;
|
||||
m_recoveryRoute = 0;
|
||||
m_recoverySource = {};
|
||||
m_recoverySession = 0;
|
||||
m_recoverySerial = 0;
|
||||
m_recoveryActive = false;
|
||||
}
|
||||
return g_pipe.SetRecovery(this, action.route, action.session,
|
||||
action.serial, action.active);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "display/CMonitorManager.h"
|
||||
#include "transport/CTransportManager.h"
|
||||
|
||||
class CDeviceContext : private ITransportEvents
|
||||
class CDeviceContext : private ITransportActions
|
||||
{
|
||||
private:
|
||||
WDFDEVICE m_wdfDevice;
|
||||
@@ -53,14 +53,6 @@ private:
|
||||
|
||||
WDFTIMER m_transportTimer = nullptr;
|
||||
bool m_recoveryHandlerSet = false;
|
||||
CSRWLock m_recoveryPublishLock;
|
||||
CSRWLock m_recoveryRouteLock;
|
||||
uint64_t m_nextRecoveryRoute = 1;
|
||||
uint64_t m_recoveryRoute = 0;
|
||||
SourceKey m_recoverySource;
|
||||
uint64_t m_recoverySession = 0;
|
||||
uint32_t m_recoverySerial = 0;
|
||||
bool m_recoveryActive = false;
|
||||
|
||||
UINT m_iddCxVersion = 0;
|
||||
bool m_hasIddCx110DDIs = false;
|
||||
@@ -78,8 +70,7 @@ private:
|
||||
const SourceKey& source, int32_t x, int32_t y) override;
|
||||
InteractionResult OnSetResolution(const SourceKey& source,
|
||||
uint32_t width, uint32_t height) override;
|
||||
void OnRecoveryRequest(const SourceKey& source,
|
||||
uint64_t session, uint32_t serial, bool active) override;
|
||||
bool OnRecoveryAction(const RecoveryAction& action) override;
|
||||
InteractionResult SetResolution(uint32_t width, uint32_t height);
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user