From daac86136ce37cc7085771a3169f5310a6c31b70 Mon Sep 17 00:00:00 2001 From: Debian NVIDIA Maintainers Date: Sat, 2 Jan 2021 13:54:24 +0000 Subject: [PATCH] Support for AMD APU+NVIDIA setup Origin: upstream, https://github.com/Bumblebee-Project/Bumblebee/pull/1009 Applied-Upstream: commit:7c75fd5e8aa9311aed5de6083634c863595924be Gbp-Pq: Name amd-apu.patch --- src/bumblebeed.c | 9 ++++++++- src/pci.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bumblebeed.c b/src/bumblebeed.c index 6e0ade5..3fa9ddc 100644 --- a/src/bumblebeed.c +++ b/src/bumblebeed.c @@ -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 diff --git a/src/pci.h b/src/pci.h index 476c3a1..7f2e5bc 100644 --- a/src/pci.h +++ b/src/pci.h @@ -21,6 +21,7 @@ #pragma once #include /* 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 -- 2.30.2