diff options
author | Ian Wisbon <ian.wisbon@timesys.com> | 2011-02-14 16:41:03 -0500 |
---|---|---|
committer | Ian Wisbon <ian.wisbon@timesys.com> | 2011-02-14 16:41:03 -0500 |
commit | 8a83780a187ba1961380814eaf9c503043345d12 (patch) | |
tree | 80f5d89cca49330e137688c72fb10c9f42dc5663 /drivers/mxc/amd-gpu/common/gsl_device.c | |
parent | 14a4057959f8ee0a2249eb2abd64fd6b1f571d98 (diff) |
Digi Release Code from del-5.6/main2.6.31-digi-201102141643
Diffstat (limited to 'drivers/mxc/amd-gpu/common/gsl_device.c')
-rw-r--r-- | drivers/mxc/amd-gpu/common/gsl_device.c | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_device.c b/drivers/mxc/amd-gpu/common/gsl_device.c index 537b277918c4..bcb557e69d6d 100644 --- a/drivers/mxc/amd-gpu/common/gsl_device.c +++ b/drivers/mxc/amd-gpu/common/gsl_device.c @@ -15,7 +15,7 @@ * 02110-1301, USA. * */ - + #include "gsl.h" #include "gsl_hal.h" #ifdef _LINUX @@ -55,19 +55,10 @@ kgsl_device_init(gsl_device_t *device, gsl_deviceid_t device_id) { int status = GSL_SUCCESS; gsl_devconfig_t config; - gsl_hal_t *hal = (gsl_hal_t *)gsl_driver.hal; kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "--> int kgsl_device_init(gsl_device_t *device=0x%08x, gsl_deviceid_t device_id=%D )\n", device, device_id ); - if ((GSL_DEVICE_YAMATO == device_id) && !(hal->has_z430)) { - return GSL_FAILURE_NOTSUPPORTED; - } - - if ((GSL_DEVICE_G12 == device_id) && !(hal->has_z160)) { - return GSL_FAILURE_NOTSUPPORTED; - } - if (device->flags & GSL_FLAGS_INITIALIZED) { kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "<-- kgsl_device_init. Return value %B\n", GSL_SUCCESS ); @@ -135,7 +126,7 @@ kgsl_device_init(gsl_device_t *device, gsl_deviceid_t device_id) return (status); } -#ifndef _LINUX +#ifndef _LINUX // Create timestamp event device->timestamp_event = kos_event_create(0); if( !device->timestamp_event ) @@ -146,7 +137,7 @@ kgsl_device_init(gsl_device_t *device, gsl_deviceid_t device_id) #else // Create timestamp wait queue init_waitqueue_head(&device->timestamp_waitq); -#endif +#endif // // Read the chip ID after the device has been initialized. @@ -170,10 +161,6 @@ 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 ); - if (!(device->flags & GSL_FLAGS_INITIALIZED)) { - return status; - } - /* make sure the device is stopped before close kgsl_device_close is only called for last running caller process */ @@ -187,8 +174,12 @@ kgsl_device_close(gsl_device_t *device) status = kgsl_cmdstream_close(device); if( status != GSL_SUCCESS ) return status; - if (device->ftbl.device_close) { - status = device->ftbl.device_close(device); + if (device->flags & GSL_FLAGS_INITIALIZED) + { + if (device->ftbl.device_close) + { + status = device->ftbl.device_close(device); + } } // DumpX allocates memstore from MMU aperture @@ -198,7 +189,7 @@ kgsl_device_close(gsl_device_t *device) kgsl_sharedmem_free0(&device->memstore, GSL_CALLER_PROCESSID_GET()); } -#ifndef _LINUX +#ifndef _LINUX // destroy timestamp event if(device->timestamp_event) { @@ -208,10 +199,10 @@ kgsl_device_close(gsl_device_t *device) } #else wake_up_interruptible_all(&(device->timestamp_waitq)); -#endif +#endif kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "<-- kgsl_device_close. Return value %B\n", status ); - + return (status); } @@ -434,27 +425,16 @@ kgsl_device_start(gsl_deviceid_t device_id, gsl_flags_t flags) { int status = GSL_FAILURE_NOTINITIALIZED; gsl_device_t *device; - gsl_hal_t *hal = (gsl_hal_t *)gsl_driver.hal; kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "--> int kgsl_device_start(gsl_deviceid_t device_id=%D, gsl_flags_t flags=%d)\n", device_id, flags ); GSL_API_MUTEX_LOCK(); - if ((GSL_DEVICE_G12 == device_id) && !(hal->has_z160)) { - GSL_API_MUTEX_UNLOCK(); - return GSL_FAILURE_NOTSUPPORTED; - } - - if ((GSL_DEVICE_YAMATO == device_id) && !(hal->has_z430)) { - GSL_API_MUTEX_UNLOCK(); - return GSL_FAILURE_NOTSUPPORTED; - } - device = &gsl_driver.device[device_id-1]; // device_id is 1 based - + kgsl_device_active(device); - + if (!(device->flags & GSL_FLAGS_INITIALIZED)) { GSL_API_MUTEX_UNLOCK(); @@ -549,7 +529,7 @@ kgsl_device_idle(gsl_deviceid_t device_id, unsigned int timeout) device = &gsl_driver.device[device_id-1]; // device_id is 1 based kgsl_device_active(device); - + if (device->ftbl.device_idle) { status = device->ftbl.device_idle(device, timeout); |