mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-07-08 17:56:55 +00:00
ENGR00125615 GPU: disable z160 in gsl when X-Accel enabled
When X-accel is enabled, uio driver is used for X server to access z160 device, so in gsl, we should not operate z160 to avoid conflicts Signed-off-by: Jie Zhou <b30303@freescale.com>
This commit is contained in:
@@ -55,10 +55,19 @@ 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 );
|
||||
@@ -425,12 +434,23 @@ 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);
|
||||
|
||||
@@ -198,13 +198,12 @@ kgsl_driver_entry(gsl_flags_t flags)
|
||||
if (status == GSL_SUCCESS)
|
||||
{
|
||||
// init devices
|
||||
status = GSL_FAILURE;
|
||||
for (i = 0; i < GSL_DEVICE_MAX; i++)
|
||||
{
|
||||
status = kgsl_device_init(&gsl_driver.device[i], (gsl_deviceid_t)(i + 1));
|
||||
if (status != GSL_SUCCESS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (kgsl_device_init(&gsl_driver.device[i], (gsl_deviceid_t)(i + 1)) == GSL_SUCCESS) {
|
||||
status = GSL_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,15 @@ typedef struct _gsl_shmemconfig_t
|
||||
gsl_apertureconfig_t apertures[GSL_SHMEM_MAX_APERTURES];
|
||||
} gsl_shmemconfig_t;
|
||||
|
||||
typedef struct _gsl_hal_t {
|
||||
gsl_memregion_t z160_regspace;
|
||||
gsl_memregion_t z430_regspace;
|
||||
gsl_memregion_t memchunk;
|
||||
gsl_memregion_t memspace[GSL_SHMEM_MAX_APERTURES];
|
||||
unsigned int has_z160;
|
||||
unsigned int has_z430;
|
||||
} gsl_hal_t;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// HAL API
|
||||
|
||||
@@ -40,15 +40,6 @@
|
||||
|
||||
/* #define GSL_HAL_DEBUG */
|
||||
|
||||
typedef struct _gsl_hal_t {
|
||||
gsl_memregion_t z160_regspace;
|
||||
gsl_memregion_t z430_regspace;
|
||||
gsl_memregion_t memchunk;
|
||||
gsl_memregion_t memspace[GSL_SHMEM_MAX_APERTURES];
|
||||
unsigned int has_z160;
|
||||
unsigned int has_z430;
|
||||
} gsl_hal_t;
|
||||
|
||||
extern phys_addr_t gpu_2d_regbase;
|
||||
extern int gpu_2d_regsize;
|
||||
extern phys_addr_t gpu_3d_regbase;
|
||||
@@ -56,6 +47,7 @@ extern int gpu_3d_regsize;
|
||||
extern int gmem_size;
|
||||
extern phys_addr_t gpu_reserved_mem;
|
||||
extern int gpu_reserved_mem_size;
|
||||
extern int gpu_2d_irq, gpu_3d_irq;
|
||||
|
||||
|
||||
KGSLHAL_API int
|
||||
@@ -116,13 +108,13 @@ kgsl_hal_init(void)
|
||||
/* overlay structure on hal memory */
|
||||
hal = (gsl_hal_t *) gsl_driver.hal;
|
||||
|
||||
if (gpu_3d_regbase && gpu_3d_regsize) {
|
||||
if (gpu_3d_regbase && gpu_3d_regsize && gpu_3d_irq) {
|
||||
hal->has_z430 = 1;
|
||||
} else {
|
||||
hal->has_z430 = 0;
|
||||
}
|
||||
|
||||
if (gpu_2d_regbase && gpu_2d_regsize) {
|
||||
if (gpu_2d_regbase && gpu_2d_regsize && gpu_2d_irq) {
|
||||
hal->has_z160 = 1;
|
||||
} else {
|
||||
hal->has_z160 = 0;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
static int gpu_2d_irq, gpu_3d_irq;
|
||||
int gpu_2d_irq, gpu_3d_irq;
|
||||
|
||||
phys_addr_t gpu_2d_regbase;
|
||||
int gpu_2d_regsize;
|
||||
@@ -807,12 +807,6 @@ static int gpu_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
if (kgsl_driver_init() != GSL_SUCCESS)
|
||||
{
|
||||
printk(KERN_ERR "%s: kgsl_driver_init error\n", __func__);
|
||||
goto kgsl_driver_init_error;
|
||||
}
|
||||
|
||||
if (gpu_3d_irq > 0)
|
||||
{
|
||||
if (request_irq(gpu_3d_irq, z430_irq_handler, 0, "ydx", NULL) < 0) {
|
||||
@@ -830,6 +824,11 @@ static int gpu_probe(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
if (kgsl_driver_init() != GSL_SUCCESS) {
|
||||
printk(KERN_ERR "%s: kgsl_driver_init error\n", __func__);
|
||||
goto kgsl_driver_init_error;
|
||||
}
|
||||
|
||||
gsl_kmod_major = register_chrdev(0, "gsl_kmod", &gsl_kmod_fops);
|
||||
gsl_kmod_vmops.fault = gsl_kmod_fault;
|
||||
|
||||
@@ -867,9 +866,15 @@ class_create_error:
|
||||
register_chrdev_error:
|
||||
unregister_chrdev(gsl_kmod_major, "gsl_kmod");
|
||||
|
||||
request_irq_error:
|
||||
kgsl_driver_init_error:
|
||||
kgsl_driver_close();
|
||||
if (gpu_2d_irq > 0) {
|
||||
free_irq(gpu_2d_irq, NULL);
|
||||
}
|
||||
if (gpu_3d_irq > 0) {
|
||||
free_irq(gpu_3d_irq, NULL);
|
||||
}
|
||||
request_irq_error:
|
||||
return 0; // TODO: return proper error code
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user