struct vga_switcheroo_handler — handler callbacks
struct vga_switcheroo_handler { int (* init) (void); int (* switchto) (enum vga_switcheroo_client_id id); int (* power_state) (enum vga_switcheroo_client_id id,enum vga_switcheroo_state state); enum vga_switcheroo_client_id (* get_client_id) (struct pci_dev *pdev); };
initialize handler. Optional. This gets called when vga_switcheroo is enabled, i.e. when two vga clients have registered. It allows the handler to perform some delayed initialization that depends on the existence of the vga clients. Currently only the radeon and amdgpu drivers use this. The return value is ignored
switch outputs to given client. Mandatory. For muxless machines this should be a no-op. Returning 0 denotes success, anything else failure (in which case the switch is aborted)
cut or reinstate power of given client. Optional. The return value is ignored
determine if given pci device is integrated or discrete GPU. Mandatory