gfxstream: Add gfxstream TLS connection manager reset
... which is still needed to keep the end2end tests happy when one thread creates and destroys instances multiple times (which happens in the MultiThreadedShutdown test). Test: GfxstreamEnd2EndTests Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36471>
This commit is contained in:
@@ -67,6 +67,21 @@ GfxStreamConnectionManager* GfxStreamConnectionManager::getThreadLocalInstance(
|
||||
return tls;
|
||||
}
|
||||
|
||||
void GfxStreamConnectionManager::resetThreadLocalInstance() {
|
||||
if (unlikely(!gfxstream_connection_manager_tls_key_valid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GfxStreamConnectionManager* tls =
|
||||
(GfxStreamConnectionManager*)tss_get(gfxstream_connection_manager_tls_key);
|
||||
if (unlikely(!tls)) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete tls;
|
||||
tss_set(gfxstream_connection_manager_tls_key, nullptr);
|
||||
}
|
||||
|
||||
GfxStreamConnectionManager::GfxStreamConnectionManager(GfxStreamTransportType type,
|
||||
VirtGpuCapset capset)
|
||||
: mTransportType(type), mCapset(capset) {}
|
||||
|
||||
@@ -31,6 +31,7 @@ class GfxStreamConnectionManager {
|
||||
public:
|
||||
static GfxStreamConnectionManager* getThreadLocalInstance(GfxStreamTransportType type,
|
||||
VirtGpuCapset capset);
|
||||
static void resetThreadLocalInstance();
|
||||
|
||||
GfxStreamConnectionManager(GfxStreamTransportType type, VirtGpuCapset capset);
|
||||
~GfxStreamConnectionManager();
|
||||
|
||||
@@ -417,6 +417,7 @@ void gfxstream_vk_DestroyInstance(VkInstance _instance, const VkAllocationCallba
|
||||
// To make End2EndTests happy, since now the host connection is statically linked to
|
||||
// libvulkan_ranchu.so [separate HostConnections now].
|
||||
#if defined(END2END_TESTS)
|
||||
GfxStreamConnectionManager::resetThreadLocalInstance();
|
||||
VirtGpuDevice::resetInstance();
|
||||
gSeqno = 0;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user