summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/radeon_cp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/shared/radeon_cp.c b/shared/radeon_cp.c
index f7b99e8a..6a05490b 100644
--- a/shared/radeon_cp.c
+++ b/shared/radeon_cp.c
@@ -1388,13 +1388,18 @@ int radeon_cp_stop( DRM_IOCTL_ARGS )
void radeon_do_release( drm_device_t *dev )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
+ int ret;
if (dev_priv) {
- /* Stop the cp */
- radeon_do_cp_flush( dev_priv );
- radeon_do_cp_idle( dev_priv );
- radeon_do_cp_stop( dev_priv );
- radeon_do_engine_reset( dev );
+ if (dev_priv->cp_running) {
+ /* Stop the cp */
+ while ((ret = radeon_do_cp_idle( dev_priv )) != 0) {
+ DRM_DEBUG("radeon_do_cp_idle %d\n", ret);
+ schedule(); /* BSD? */
+ }
+ radeon_do_cp_stop( dev_priv );
+ radeon_do_engine_reset( dev );
+ }
/* Disable *all* interrupts */
RADEON_WRITE( RADEON_GEN_INT_CNTL, 0 );