summaryrefslogtreecommitdiff
path: root/drivers/mxc/amd-gpu/common
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mxc/amd-gpu/common')
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_device.c50
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_driver.c9
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_g12.c6
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_yamato.c1
4 files changed, 20 insertions, 46 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);
diff --git a/drivers/mxc/amd-gpu/common/gsl_driver.c b/drivers/mxc/amd-gpu/common/gsl_driver.c
index b8c5170a1425..fd4bcc0df96a 100644
--- a/drivers/mxc/amd-gpu/common/gsl_driver.c
+++ b/drivers/mxc/amd-gpu/common/gsl_driver.c
@@ -198,12 +198,13 @@ kgsl_driver_entry(gsl_flags_t flags)
if (status == GSL_SUCCESS)
{
// init devices
- status = GSL_FAILURE;
for (i = 0; i < GSL_DEVICE_MAX; i++)
{
- if (kgsl_device_init(&gsl_driver.device[i], (gsl_deviceid_t)(i + 1)) == GSL_SUCCESS) {
- status = GSL_SUCCESS;
- }
+ status = kgsl_device_init(&gsl_driver.device[i], (gsl_deviceid_t)(i + 1));
+ if (status != GSL_SUCCESS)
+ {
+ break;
+ }
}
}
diff --git a/drivers/mxc/amd-gpu/common/gsl_g12.c b/drivers/mxc/amd-gpu/common/gsl_g12.c
index 14cfdb61b6a1..513f6728a842 100644
--- a/drivers/mxc/amd-gpu/common/gsl_g12.c
+++ b/drivers/mxc/amd-gpu/common/gsl_g12.c
@@ -91,8 +91,6 @@ typedef struct
static gsl_z1xx_t g_z1xx = {0};
-extern int z160_version;
-
//----------------------------------------------------------------------------
@@ -465,10 +463,6 @@ kgsl_g12_getproperty(gsl_device_t *device, gsl_property_type_t type, void *value
#ifndef GSL_NO_MMU
devinfo->mmu_enabled = kgsl_mmu_isenabled(&device->mmu);
#endif
- if (z160_version == 1)
- devinfo->high_precision = 1;
- else
- devinfo->high_precision = 0;
status = GSL_SUCCESS;
}
diff --git a/drivers/mxc/amd-gpu/common/gsl_yamato.c b/drivers/mxc/amd-gpu/common/gsl_yamato.c
index e52d4274c6a6..d74c9efe2f36 100644
--- a/drivers/mxc/amd-gpu/common/gsl_yamato.c
+++ b/drivers/mxc/amd-gpu/common/gsl_yamato.c
@@ -541,7 +541,6 @@ kgsl_yamato_getproperty(gsl_device_t *device, gsl_property_type_t type, void *va
devinfo->gmem_hostbaseaddr = device->gmemspace.mmio_virt_base;
devinfo->gmem_gpubaseaddr = device->gmemspace.gpu_base;
devinfo->gmem_sizebytes = device->gmemspace.sizebytes;
- devinfo->high_precision = 0;
status = GSL_SUCCESS;
}