Skip to content

Commit

Permalink
nouveau/acpi: improve detection of what is IGD and what is DIS.
Browse files Browse the repository at this point in the history
This improves the IGD/DIS picking using firstly if Intel, then
if the bus is bus 0. There may be a correct way to do this, but
I've no idea what it is.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Jan 5, 2011
1 parent 5ccb377 commit d1fbd92
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/gpu/drm/nouveau/nouveau_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,15 @@ static int nouveau_dsm_init(void)

static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
{
if (nouveau_dsm_priv.dhandle == DEVICE_ACPI_HANDLE(&pdev->dev))
/* easy option one - intel vendor ID means Integrated */
if (pdev->vendor == PCI_VENDOR_ID_INTEL)
return VGA_SWITCHEROO_IGD;
else
return VGA_SWITCHEROO_DIS;

/* is this device on Bus 0? - this may need improving */
if (pdev->bus->number == 0)
return VGA_SWITCHEROO_IGD;

return VGA_SWITCHEROO_DIS;
}

static struct vga_switcheroo_handler nouveau_dsm_handler = {
Expand Down

0 comments on commit d1fbd92

Please sign in to comment.