diff --git a/src/core/os/lnx/dri3/dri3WindowSystem.cpp b/src/core/os/lnx/dri3/dri3WindowSystem.cpp index cf63b93..60b9c28 100644 --- a/src/core/os/lnx/dri3/dri3WindowSystem.cpp +++ b/src/core/os/lnx/dri3/dri3WindowSystem.cpp @@ -442,13 +442,11 @@ int32 Dri3WindowSystem::OpenDri3() // check whether we are running with radeonsi but not amdgpu constexpr char ProDdxVendorString[] = "amdgpu"; + const DrmLoaderFuncs& drmProcs = m_device.GetPlatform()->GetDrmLoader().GetProcsTable(); - const xcb_dri2_connect_cookie_t dri2Cookie = m_dri3Procs.pfnXcbDri2Connect(m_pConnection, m_hWindow, DRI2DriverDRI); - xcb_dri2_connect_reply_t*const pDri2Reply = m_dri3Procs.pfnXcbDri2ConnectReply(m_pConnection, dri2Cookie, NULL); - const int32 nameLength = m_dri3Procs.pfnXcbDri2ConnectDriverNameLength(pDri2Reply); - const char*const pName = m_dri3Procs.pfnXcbDri2ConnectDriverName(pDri2Reply); + drmVersionPtr pVersion = drmProcs.pfnDrmGetVersion(fd); - if ((pName != nullptr) && (strncmp(pName, ProDdxVendorString, nameLength) != 0)) + if ((pVersion->name != nullptr) && (strncmp(pVersion->name, ProDdxVendorString, pVersion->name_len) != 0)) { m_windowSystemProperties.useGbTileEnumInMetaData = 1; m_windowSystemProperties.supportFreeSyncExtension = 0; @@ -459,10 +457,7 @@ int32 Dri3WindowSystem::OpenDri3() m_windowSystemProperties.supportFreeSyncExtension = 1; } - if (pDri2Reply != nullptr) - { - free(pDri2Reply); - } + drmProcs.pfnDrmFreeVersion (pVersion); return fd; }