[PATCH] drm/radeon: s2disk: Leave hw powered between freeze()

Oliver Winker oliverml1 at oli1170.net
Fri Jun 12 12:21:40 PDT 2015


Hello,

Below a patch [2] on v4.0 that significantly improves s2disk on my system with 
a HD7850 [1] with an HDMI screen. 

It basically avoids powering down the card hw too much on the system-snapshot 
between freeze() and thaw(). 

Before this patch I had to deactivate dpm to get s2disk at least kind of 
working. Since I activated dpm (for the silent fans), s2disk didn't work 
anymore at all. 

Also the stop/start of the card was really feeling heavy on my system, with 
the monitor going into standby due to the signal loss, to be directly squeezed 
back on thaw() - not easy for a heavy piece of hw like a 3d gfx-card.

With the patch the card hw stays mostly up on freeze(), only dma and irqs 
disabled, then image snapshot is made, and then the card hw is released again. 
Much less heavy, smoother and faster (click-clack and it's done). 

I tested this during a week and on my system s2disk with dpm activated works 
much better now!

Now the patch is basically an experimental guess -  I just post it as feedback 
for the devs for a possible improvement of the pm with freeze()/thaw(). But 
I'm quite satisfied this the result ;-).

Cheers, Oliver

[1] 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] 
Pitcairn PRO [Radeon HD 7850] (prog-if 00 [VGA controller])
        Subsystem: PC Partner Limited / Sapphire Technology Radeon HD 7850 2GB 
GDDR5 DVI-I/DVI-D/HDMI/DP
        Flags: bus master, fast devsel, latency 0, IRQ 37
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Memory at f5000000 (64-bit, non-prefetchable) [size=256K]
        I/O ports at a000 [size=256]
        [virtual] Expansion ROM at f4000000 [disabled] [size=128K]
        Capabilities: [48] Vendor Specific Information: Len=08 <?>
        Capabilities: [50] Power Management version 3
        Capabilities: [58] Express Legacy Endpoint, MSI 00
        Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 
<?>
        Capabilities: [150] Advanced Error Reporting
        Capabilities: [270] #19
        Capabilities: [2b0] Address Translation Service (ATS)
        Capabilities: [2c0] #13
        Capabilities: [2d0] #1b
        Kernel driver in use: radeon


[2]

>From e2018b5ea38c0fffa5a22ac306b2b80c470bfd87 Mon Sep 17 00:00:00 2001
From: Oliver Winker <oliver at oli1170.net>
Date: Sun, 7 Jun 2015 11:23:14 +0200
Subject: [PATCH] WIP: drm/radeon: s2disk: Leave hw powered between freeze()
 and thaw()

This allows a much smoother transition of the hw from freeze() back to thaw() 
on s2disk.
---
 drivers/gpu/drm/radeon/radeon_device.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index bd7519f..21c4223 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1547,10 +1547,12 @@ int radeon_suspend_kms(struct drm_device *dev, bool 
suspend, bool fbcon)
 
 	drm_kms_helper_poll_disable(dev);
 
+	if (suspend) {
 	/* turn off display hw */
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
 	}
+	}
 
 	/* unpin the front buffers */
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -1584,12 +1586,14 @@ int radeon_suspend_kms(struct drm_device *dev, bool 
suspend, bool fbcon)
 
 	radeon_save_bios_scratch_regs(rdev);
 
+	if (suspend) {
 	radeon_suspend(rdev);
 	radeon_hpd_fini(rdev);
 	/* evict remaining vram memory */
 	radeon_bo_evict_vram(rdev);
 
 	radeon_agp_suspend(rdev);
+	}
 
 	pci_save_state(dev->pdev);
 	if (suspend) {
@@ -1636,6 +1640,8 @@ int radeon_resume_kms(struct drm_device *dev, bool 
resume, bool fbcon)
 			return -1;
 		}
 	}
+
+	if (resume) {
 	/* resume AGP if in use */
 	radeon_agp_resume(rdev);
 	radeon_resume(rdev);
@@ -1655,6 +1661,7 @@ int radeon_resume_kms(struct drm_device *dev, bool 
resume, bool fbcon)
 		/* resume old pm late */
 		radeon_pm_resume(rdev);
 	}
+	}
 
 	radeon_restore_bios_scratch_regs(rdev);
 
-- 
2.1.4




More information about the xorg-driver-ati mailing list