[PATCH 2/2] drm/radeon: Hold the CS mutex across suspend/resume.

Michel Dänzer michel at daenzer.net
Thu Sep 15 11:21:01 PDT 2011


From: Michel Dänzer <michel.daenzer at amd.com>


Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

Not sure the CS ioctl can actually run concurrently with suspend/resume, but
might be better safe than sorry?

 drivers/gpu/drm/radeon/radeon_device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 5f3d02d..80b4799 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -881,6 +881,10 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
 			}
 		}
 	}
+
+	/* Prevent CS ioctl from interfering */
+	cs_mutex_lock(rdev);
+
 	/* evict vram memory */
 	radeon_bo_evict_vram(rdev);
 	/* wait for gpu to finish processing current batch */
@@ -944,6 +948,9 @@ int radeon_resume_kms(struct drm_device *dev)
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
 	}
+
+	cs_mutex_unlock(rdev);
+
 	return 0;
 }
 
-- 
1.7.6.3



More information about the dri-devel mailing list