Skip to content

Commit 38a94b3

Browse files
authored
fix(linux/kms): skip NVIDIA cards for VAAPI on hybrid GPU laptops (#4473)
1 parent 5ecf7dc commit 38a94b3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/platform/linux/kmsgrab.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,14 @@ namespace platf {
618618
}
619619
}
620620

621+
// Skip Nvidia cards if we're looking for VAAPI devices
622+
// This is important for hybrid GPU laptops where the display
623+
// may be connected through NVIDIA but rendering happens on Intel
624+
if (mem_type == mem_type_e::vaapi && card.is_nvidia()) {
625+
BOOST_LOG(debug) << file << " is an NVIDIA card, skipping for VAAPI"sv;
626+
continue;
627+
}
628+
621629
auto end = std::end(card);
622630
for (auto plane = std::begin(card); plane != end; ++plane) {
623631
// Skip unused planes
@@ -1623,6 +1631,14 @@ namespace platf {
16231631
}
16241632
}
16251633

1634+
// Skip Nvidia cards if we're looking for VAAPI devices
1635+
// This is important for hybrid GPU laptops where the display
1636+
// may be connected through NVIDIA but rendering happens on Intel
1637+
if (hwdevice_type == mem_type_e::vaapi && card.is_nvidia()) {
1638+
BOOST_LOG(debug) << file << " is an NVIDIA card, skipping for VAAPI"sv;
1639+
continue;
1640+
}
1641+
16261642
auto crtc_to_monitor = kms::map_crtc_to_monitor(card.monitors(conn_type_count));
16271643

16281644
auto end = std::end(card);

0 commit comments

Comments
 (0)