[idd] clipboard: optimize write-combined reads

Add a reusable copy path for moving data from write-combined mappings
into normal cacheable memory. Dispatch to MOVNTDQA-based SSE4.1 or AVX2
loads when the processor and OS support them, with a fenced fallback.

Use the optimized path when staging inbound clipboard stream records from
the IVSHMEM mapping.
This commit is contained in:
Geoffrey McRae
2026-08-15 16:09:28 +10:00
parent 9e9bf6b88c
commit 4477ac0de1
6 changed files with 272 additions and 1 deletions

View File

@@ -26,6 +26,7 @@
#include "CDebug.h"
#include "Seq.h"
#include "WCCopy.h"
#include "transport/lgmp/CLGMPHost.h"
#include <limits>
@@ -637,7 +638,7 @@ bool CLGMPClipboardTransport::QueueStreamTarget(
(m_streamTargetHead + m_streamTargetCount) % STREAM_TARGET_COUNT];
target.record = record;
if (record.length)
memcpy(target.data, data, record.length);
WCCopy::Copy(target.data, data, record.length);
++m_streamTargetCount;
return true;
}