Support for AMD APU+NVIDIA setup
authorDebian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>
Sat, 27 Jan 2024 00:28:10 +0000 (01:28 +0100)
committerAndreas Beckmann <anbe@debian.org>
Sat, 27 Jan 2024 00:28:10 +0000 (01:28 +0100)
Origin: upstream, https://github.com/Bumblebee-Project/Bumblebee/pull/1009
Applied-Upstream: commit:7c75fd5e8aa9311aed5de6083634c863595924be

Gbp-Pq: Name amd-apu.patch

src/bumblebeed.c
src/pci.h

index 6e0ade5d4601546775eb6d4fb6ff9280914d19ea..3fa9ddc83f5c36bab632787cfe3f6cbf9767e054 100644 (file)
@@ -464,12 +464,19 @@ int main(int argc, char* argv[]) {
 
   /* First look for an intel card */
   struct pci_bus_id *pci_id_igd = pci_find_gfx_by_vendor(PCI_VENDOR_ID_INTEL, 0);
+
+  /* Then look for an amd card */
+  if (!pci_id_igd) {
+    bb_log(LOG_INFO, "No Intel video card found, testing for system with an AMD APU.\n");
+    pci_id_igd = pci_find_gfx_by_vendor(PCI_VENDOR_ID_AMD, 0);
+  }
+
   if (!pci_id_igd) {
     /* This is no Optimus configuration. But maybe it's a
        dual-nvidia configuration. Let us test that.
     */
     pci_id_igd = pci_find_gfx_by_vendor(PCI_VENDOR_ID_NVIDIA, 1);
-    bb_log(LOG_INFO, "No Intel video card found, testing for dual-nvidia system.\n");
+    bb_log(LOG_INFO, "No Intel/AMD video card found, testing for dual-nvidia system.\n");
 
     if (!pci_id_igd) {
       /* Ok, this is not a double gpu setup supported (there is at most
index 476c3a1464a1403a22f0b8599c6e80ad0d21ba91..7f2e5bcc38e2859509ecaca27617600336ff30f2 100644 (file)
--- a/src/pci.h
+++ b/src/pci.h
@@ -21,6 +21,7 @@
 #pragma once
 #include <sys/types.h> /* necessary for int32_t */
 
+#define PCI_VENDOR_ID_AMD     0x1002
 #define PCI_VENDOR_ID_NVIDIA  0x10de
 #define PCI_VENDOR_ID_INTEL   0x8086
 #define PCI_CLASS_DISPLAY_VGA 0x0300