summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2010-10-12 15:06:10 +0800
committerAlan Tull <alan.tull@freescale.com>2010-10-13 16:37:53 -0500
commitd04e8cb8366abba0d3cbdc936c21f85a6515bbe6 (patch)
tree3521c839382a8de748c1e2b064d4120d44174bc4 /drivers/mxc
parent15f7bc70e4bc3753eba52c455f06ebac6499adf0 (diff)
ENGR00132489 GPU: make g12 context id unique
Add a unique context ID member variable to the gsl_z1xx_t structure to keep track of a true unique context ID. This is simply an unsigned int counter that should provide a large enough pool of unique IDs. Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_g12.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_g12.c b/drivers/mxc/amd-gpu/common/gsl_g12.c
index 637e27c9e264..c8c22a9304d9 100644
--- a/drivers/mxc/amd-gpu/common/gsl_g12.c
+++ b/drivers/mxc/amd-gpu/common/gsl_g12.c
@@ -90,6 +90,7 @@ typedef struct
gsl_timestamp_t timestamp[GSL_HAL_NUMCMDBUFFERS];
unsigned int numcontext;
+ unsigned int nextUniqueContextID;
}gsl_z1xx_t;
static gsl_z1xx_t g_z1xx = {0};
@@ -828,6 +829,7 @@ kgsl_g12_context_create(gsl_device_t* device, gsl_context_type_t type, unsigned
if (g_z1xx.numcontext==0)
{
+ g_z1xx.nextUniqueContextID = 0;
/* todo: move this to device create or start. Error checking!! */
for (i=0;i<GSL_HAL_NUMCMDBUFFERS;i++)
{
@@ -874,7 +876,8 @@ kgsl_g12_context_create(gsl_device_t* device, gsl_context_type_t type, unsigned
if(g_z1xx.numcontext < GSL_CONTEXT_MAX)
{
g_z1xx.numcontext++;
- *drawctxt_id=g_z1xx.numcontext;
+ g_z1xx.nextUniqueContextID++;
+ *drawctxt_id=g_z1xx.nextUniqueContextID;
status = GSL_SUCCESS;
}
else