Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348445
b: refs/heads/master
c: d1f9809
h: refs/heads/master
i:
  348443: 082b6f5
v: v3
  • Loading branch information
Maarten Lankhorst authored and Alex Deucher committed Jan 7, 2013
1 parent 8670bc7 commit 43c6bb6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a10fbb4224e53c6b3528d671051be4b98bd8e9b9
refs/heads/master: d1f9809ed1315c4cdc5760cf2f59626fd3276952
28 changes: 28 additions & 0 deletions trunk/drivers/gpu/drm/radeon/radeon_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,25 @@ static void radeon_check_arguments(struct radeon_device *rdev)
}
}

/**
* radeon_switcheroo_quirk_long_wakeup - return true if longer d3 delay is
* needed for waking up.
*
* @pdev: pci dev pointer
*/
static bool radeon_switcheroo_quirk_long_wakeup(struct pci_dev *pdev)
{

/* 6600m in a macbook pro */
if (pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE &&
pdev->subsystem_device == 0x00e2) {
printk(KERN_INFO "radeon: quirking longer d3 wakeup delay\n");
return true;
}

return false;
}

/**
* radeon_switcheroo_set_state - set switcheroo state
*
Expand All @@ -910,10 +929,19 @@ static void radeon_switcheroo_set_state(struct pci_dev *pdev, enum vga_switchero
struct drm_device *dev = pci_get_drvdata(pdev);
pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
if (state == VGA_SWITCHEROO_ON) {
unsigned d3_delay = dev->pdev->d3_delay;

printk(KERN_INFO "radeon: switched on\n");
/* don't suspend or resume card normally */
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;

if (d3_delay < 20 && radeon_switcheroo_quirk_long_wakeup(pdev))
dev->pdev->d3_delay = 20;

radeon_resume_kms(dev);

dev->pdev->d3_delay = d3_delay;

dev->switch_power_state = DRM_SWITCH_POWER_ON;
drm_kms_helper_poll_enable(dev);
} else {
Expand Down

0 comments on commit 43c6bb6

Please sign in to comment.