diff options
author | Jie Zhou <b30303@freescale.com> | 2010-08-23 09:59:36 +0800 |
---|---|---|
committer | Jie Zhou <b30303@freescale.com> | 2010-08-24 12:43:44 +0800 |
commit | eb417cd19dfcd8f4a51335d4a1b4edbd9c58e954 (patch) | |
tree | c82df9541bed3999f1c054bff06e9c6b105fc0d9 | |
parent | 3114fcd3ea13a4083eb79b52a64322d28d21f770 (diff) |
ENGR00126565-2 GPU: Provide z160 precision info to user space libraries
MX50 Z160 has higher gradient/texture precision than MX51/53.
Signed-off-by: Jie Zhou <b30303@freescale.com>
-rw-r--r-- | drivers/mxc/amd-gpu/common/gsl_g12.c | 6 | ||||
-rw-r--r-- | drivers/mxc/amd-gpu/common/gsl_yamato.c | 1 | ||||
-rw-r--r-- | drivers/mxc/amd-gpu/include/api/gsl_types.h | 1 | ||||
-rw-r--r-- | drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c | 6 |
4 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_g12.c b/drivers/mxc/amd-gpu/common/gsl_g12.c index 513f6728a842..14cfdb61b6a1 100644 --- a/drivers/mxc/amd-gpu/common/gsl_g12.c +++ b/drivers/mxc/amd-gpu/common/gsl_g12.c @@ -91,6 +91,8 @@ typedef struct static gsl_z1xx_t g_z1xx = {0}; +extern int z160_version; + //---------------------------------------------------------------------------- @@ -463,6 +465,10 @@ 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 d74c9efe2f36..e52d4274c6a6 100644 --- a/drivers/mxc/amd-gpu/common/gsl_yamato.c +++ b/drivers/mxc/amd-gpu/common/gsl_yamato.c @@ -541,6 +541,7 @@ 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; } diff --git a/drivers/mxc/amd-gpu/include/api/gsl_types.h b/drivers/mxc/amd-gpu/include/api/gsl_types.h index 99f389deee84..310c1a9f5d00 100644 --- a/drivers/mxc/amd-gpu/include/api/gsl_types.h +++ b/drivers/mxc/amd-gpu/include/api/gsl_types.h @@ -267,6 +267,7 @@ typedef struct _gsl_devinfo_t { unsigned int gmem_gpubaseaddr; void * gmem_hostbaseaddr; // if gmem_hostbaseaddr is NULL, we would know its not mapped into mmio space unsigned int gmem_sizebytes; + unsigned int high_precision; /* mx50 z160 has higher gradient/texture precision */ } gsl_devinfo_t; diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c index bd8d60d47274..bef8684ad131 100644 --- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c +++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c @@ -48,6 +48,7 @@ int gpu_3d_regsize; int gmem_size; phys_addr_t gpu_reserved_mem; int gpu_reserved_mem_size; +int z160_version; static ssize_t gsl_kmod_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr); static ssize_t gsl_kmod_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr); @@ -753,6 +754,11 @@ static int gpu_probe(struct platform_device *pdev) struct resource *res; struct device *dev; + if (pdev->dev.platform_data) + z160_version = *((int *)(pdev->dev.platform_data)); + else + z160_version = 0; + for(i = 0; i < 2; i++){ res = platform_get_resource(pdev, IORESOURCE_IRQ, i); if (!res) { |