diff options
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 1a532a9bc3a3..d8319dae8358 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -1578,11 +1578,21 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon) | |||
| 1578 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); | 1578 | drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); |
| 1579 | } | 1579 | } |
| 1580 | 1580 | ||
| 1581 | /* unpin the front buffers */ | 1581 | /* unpin the front buffers and cursors */ |
| 1582 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 1582 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
| 1583 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | ||
| 1583 | struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->primary->fb); | 1584 | struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->primary->fb); |
| 1584 | struct radeon_bo *robj; | 1585 | struct radeon_bo *robj; |
| 1585 | 1586 | ||
| 1587 | if (radeon_crtc->cursor_bo) { | ||
| 1588 | struct radeon_bo *robj = gem_to_radeon_bo(radeon_crtc->cursor_bo); | ||
| 1589 | r = radeon_bo_reserve(robj, false); | ||
| 1590 | if (r == 0) { | ||
| 1591 | radeon_bo_unpin(robj); | ||
| 1592 | radeon_bo_unreserve(robj); | ||
| 1593 | } | ||
| 1594 | } | ||
| 1595 | |||
| 1586 | if (rfb == NULL || rfb->obj == NULL) { | 1596 | if (rfb == NULL || rfb->obj == NULL) { |
| 1587 | continue; | 1597 | continue; |
| 1588 | } | 1598 | } |
| @@ -1645,6 +1655,7 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) | |||
| 1645 | { | 1655 | { |
| 1646 | struct drm_connector *connector; | 1656 | struct drm_connector *connector; |
| 1647 | struct radeon_device *rdev = dev->dev_private; | 1657 | struct radeon_device *rdev = dev->dev_private; |
| 1658 | struct drm_crtc *crtc; | ||
| 1648 | int r; | 1659 | int r; |
| 1649 | 1660 | ||
| 1650 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | 1661 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
| @@ -1684,6 +1695,27 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) | |||
| 1684 | 1695 | ||
| 1685 | radeon_restore_bios_scratch_regs(rdev); | 1696 | radeon_restore_bios_scratch_regs(rdev); |
| 1686 | 1697 | ||
| 1698 | /* pin cursors */ | ||
| 1699 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | ||
| 1700 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | ||
| 1701 | |||
| 1702 | if (radeon_crtc->cursor_bo) { | ||
| 1703 | struct radeon_bo *robj = gem_to_radeon_bo(radeon_crtc->cursor_bo); | ||
| 1704 | r = radeon_bo_reserve(robj, false); | ||
| 1705 | if (r == 0) { | ||
| 1706 | /* Only 27 bit offset for legacy cursor */ | ||
| 1707 | r = radeon_bo_pin_restricted(robj, | ||
| 1708 | RADEON_GEM_DOMAIN_VRAM, | ||
| 1709 | ASIC_IS_AVIVO(rdev) ? | ||
| 1710 | 0 : 1 << 27, | ||
| 1711 | &radeon_crtc->cursor_addr); | ||
| 1712 | if (r != 0) | ||
| 1713 | DRM_ERROR("Failed to pin cursor BO (%d)\n", r); | ||
| 1714 | radeon_bo_unreserve(robj); | ||
| 1715 | } | ||
| 1716 | } | ||
| 1717 | } | ||
| 1718 | |||
| 1687 | /* init dig PHYs, disp eng pll */ | 1719 | /* init dig PHYs, disp eng pll */ |
| 1688 | if (rdev->is_atom_bios) { | 1720 | if (rdev->is_atom_bios) { |
| 1689 | radeon_atom_encoder_init(rdev); | 1721 | radeon_atom_encoder_init(rdev); |
