summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJie Zhou <b30303@freescale.com>2010-07-28 12:04:04 +0800
committerJie Zhou <b30303@freescale.com>2010-07-29 09:39:45 +0800
commit0e46b52536b83148c547298cbe9a3b5b25b1d0fe (patch)
treeb67664bc2d3e8bea1511be6bd9ac09876af3c04b
parent71a720f2f78effa6000355d03f2c346b8c52a44a (diff)
ENGR00125616 GPU: make sure device is stopped before closerel_imx_2.6.31_10.07.11
When terminating some applications such as OpenGL ES2.0 conf. test, kgsl_device_stop is not triggered. And run such kind of application for several times, system hang happens for inconsistency of device states. So make sure device is stopped in kgsl_device_close, which is only called by last running caller process. Signed-off-by: Jie Zhou <b30303@freescale.com>
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_device.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_device.c b/drivers/mxc/amd-gpu/common/gsl_device.c
index 6fc51eb1bdc2..bcb557e69d6d 100644
--- a/drivers/mxc/amd-gpu/common/gsl_device.c
+++ b/drivers/mxc/amd-gpu/common/gsl_device.c
@@ -161,6 +161,15 @@ kgsl_device_close(gsl_device_t *device)
kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE,
"--> int kgsl_device_close(gsl_device_t *device=0x%08x )\n", device );
+ /* make sure the device is stopped before close
+ kgsl_device_close is only called for last running caller process
+ */
+ while (device->refcnt > 0) {
+ GSL_API_MUTEX_UNLOCK();
+ kgsl_device_stop(device->id);
+ GSL_API_MUTEX_LOCK();
+ }
+
// close cmdstream
status = kgsl_cmdstream_close(device);
if( status != GSL_SUCCESS ) return status;