How bumblebee-project/bbswitch works
bbswitch is a Linux kernel module for detecting an Optimus discrete GPU and controlling its power through ACPI. The principal workflow is a privileged write to /proc/acpi/bbswitch, which requests the card be turned on or off; users can also read its status. Initialization discovers graphics devices and ACPI handles, while suspend/resume handling restores the prior disabled state. The graph reflects the single sampled runtime source and README-documented interfaces; details of omitted code are not inferred.
Main entry points: bbswitch.c Card power control
Components 8
User Interface
- Proc interface
bbswitch.c
Device Control
- GPU discovery
bbswitch.c - Card power control
bbswitch.c
Module Lifecycle
- Module lifecycle
bbswitch.c
Other components
- Root user
- ACPI firmware
- PCI subsystem
- Power events
Connections 10
- Root user → Proc interface: reads or writes
README.md - Proc interface → Card power control: requests switching
README.md - Proc interface → Root user: reports status
README.md - Module lifecycle → GPU discovery: discovers devices
bbswitch.c - GPU discovery → PCI subsystem: scans devices
bbswitch.c - GPU discovery → ACPI firmware: finds handles
bbswitch.c - Card power control → ACPI firmware: evaluates DSM
bbswitch.c - Card power control → PCI subsystem: sets power state
bbswitch.c - Power events → Card power control: restores state
bbswitch.c - Module lifecycle → Card power control: applies options
README.md