@@ -96,6 +96,16 @@ static void vga_switcheroo_enable(void)
return;
client->id = ret;
+
+ if (!client->active && client->ops->reprobe_connectors) {
+ int old_id = (client->id == VGA_SWITCHEROO_IGD) ?
+ VGA_SWITCHEROO_DIS : VGA_SWITCHEROO_IGD;
+ if (vgasr_priv.handler->switch_ddc)
+ vgasr_priv.handler->switch_ddc(client->id);
+ client->ops->reprobe_connectors(client->pdev);
+ if (vgasr_priv.handler->switch_ddc)
+ vgasr_priv.handler->switch_ddc(old_id);
+ }
}
vga_switcheroo_debugfs_init(&vgasr_priv);
vgasr_priv.active = true;
@@ -40,6 +40,7 @@ struct vga_switcheroo_handler {
struct vga_switcheroo_client_ops {
void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state);
void (*reprobe)(struct pci_dev *dev);
+ void (*reprobe_connectors)(struct pci_dev *dev);
bool (*can_switch)(struct pci_dev *dev);
};
If display MUXing is handled by an external driver, the handler may not initialise until some time after the graphics drivers originally bound. If the driver is unable to detect some drivers unless appropriately MUXed, this will cause problems. This patch adds a callback to allow switcheroo to retrigger the driver's output probing. Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> --- drivers/gpu/vga/vga_switcheroo.c | 10 ++++++++++ include/linux/vga_switcheroo.h | 1 + 2 files changed, 11 insertions(+)