Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 32f57f3

Browse files
JakeMerdichAMDqiaojbao
authored andcommitted
Fix wayland present perf drop
Change-Id: Iae7a54828d08a61a609e1190db5297700bd9540a
1 parent a56eddc commit 32f57f3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/core/os/amdgpu/wayland/waylandWindowSystem.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,20 +1281,20 @@ void WaylandWindowSystem::ConfigPresentOnSameGpu()
12811281

12821282
PAL_ASSERT(result == Result::Success);
12831283

1284-
int64 drmNodeMajor, drmNodeMinor;
1285-
if (drmProps.flags.hasRenderDrmNode)
1284+
// If the compositor is running on either the same primary or render node as our device, it's on the same gpu.
1285+
m_presentOnSameGpu = false;
1286+
if (drmProps.flags.hasRenderDrmNode &&
1287+
(major(m_DmaDevice) == drmProps.renderDrmNodeMajor) &&
1288+
(minor(m_DmaDevice) == drmProps.renderDrmNodeMinor))
12861289
{
1287-
drmNodeMajor = drmProps.renderDrmNodeMajor;
1288-
drmNodeMinor = drmProps.renderDrmNodeMinor;
1290+
m_presentOnSameGpu = true;
12891291
}
1290-
if (drmProps.flags.hasPrimaryDrmNode)
1292+
if (drmProps.flags.hasPrimaryDrmNode &&
1293+
(major(m_DmaDevice) == drmProps.primaryDrmNodeMajor) &&
1294+
(minor(m_DmaDevice) == drmProps.primaryDrmNodeMinor))
12911295
{
1292-
drmNodeMajor = drmProps.primaryDrmNodeMajor;
1293-
drmNodeMinor = drmProps.primaryDrmNodeMinor;
1294-
1296+
m_presentOnSameGpu = true;
12951297
}
1296-
m_presentOnSameGpu = ((major(m_DmaDevice) == drmNodeMajor) &&
1297-
(minor(m_DmaDevice) == drmNodeMinor));
12981298
}
12991299
else
13001300
{

0 commit comments

Comments
 (0)