Loading drivers/gpu/msm/adreno_drawctxt.c +17 −10 Original line number Diff line number Diff line Loading @@ -159,15 +159,13 @@ static void global_wait_callback(struct kgsl_device *device, void *priv, u32 id, } static int _check_global_timestamp(struct kgsl_device *device, unsigned int timestamp) struct adreno_context *drawctxt, unsigned int timestamp) { int ret; mutex_lock(&device->mutex); ret = kgsl_check_timestamp(device, NULL, timestamp); mutex_unlock(&device->mutex); /* Stop waiting if the context is invalidated */ if (drawctxt->state == ADRENO_CONTEXT_STATE_INVALID) return 1; return ret; return kgsl_check_timestamp(device, NULL, timestamp); } static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, Loading @@ -176,7 +174,7 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, { struct kgsl_device *device = &adreno_dev->dev; struct adreno_context *drawctxt = ADRENO_CONTEXT(context); int ret; int ret = 0; /* Needs to hold the device mutex */ BUG_ON(!mutex_is_locked(&device->mutex)); Loading @@ -186,6 +184,15 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, goto done; } /* * If the context is invalid then return immediately - we may end up * waiting for a timestamp that will never come */ if (drawctxt->state == ADRENO_CONTEXT_STATE_INVALID) { kgsl_context_put(context); goto done; } trace_adreno_drawctxt_wait_start(KGSL_MEMSTORE_GLOBAL, timestamp); ret = kgsl_add_event(device, KGSL_MEMSTORE_GLOBAL, timestamp, Loading @@ -199,7 +206,7 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, if (timeout) { ret = (int) wait_event_timeout(drawctxt->waiting, _check_global_timestamp(device, timestamp), _check_global_timestamp(device, drawctxt, timestamp), msecs_to_jiffies(timeout)); if (ret == 0) Loading @@ -208,7 +215,7 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, ret = 0; } else { wait_event(drawctxt->waiting, _check_global_timestamp(device, timestamp)); _check_global_timestamp(device, drawctxt, timestamp)); } mutex_lock(&device->mutex); Loading Loading
drivers/gpu/msm/adreno_drawctxt.c +17 −10 Original line number Diff line number Diff line Loading @@ -159,15 +159,13 @@ static void global_wait_callback(struct kgsl_device *device, void *priv, u32 id, } static int _check_global_timestamp(struct kgsl_device *device, unsigned int timestamp) struct adreno_context *drawctxt, unsigned int timestamp) { int ret; mutex_lock(&device->mutex); ret = kgsl_check_timestamp(device, NULL, timestamp); mutex_unlock(&device->mutex); /* Stop waiting if the context is invalidated */ if (drawctxt->state == ADRENO_CONTEXT_STATE_INVALID) return 1; return ret; return kgsl_check_timestamp(device, NULL, timestamp); } static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, Loading @@ -176,7 +174,7 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, { struct kgsl_device *device = &adreno_dev->dev; struct adreno_context *drawctxt = ADRENO_CONTEXT(context); int ret; int ret = 0; /* Needs to hold the device mutex */ BUG_ON(!mutex_is_locked(&device->mutex)); Loading @@ -186,6 +184,15 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, goto done; } /* * If the context is invalid then return immediately - we may end up * waiting for a timestamp that will never come */ if (drawctxt->state == ADRENO_CONTEXT_STATE_INVALID) { kgsl_context_put(context); goto done; } trace_adreno_drawctxt_wait_start(KGSL_MEMSTORE_GLOBAL, timestamp); ret = kgsl_add_event(device, KGSL_MEMSTORE_GLOBAL, timestamp, Loading @@ -199,7 +206,7 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, if (timeout) { ret = (int) wait_event_timeout(drawctxt->waiting, _check_global_timestamp(device, timestamp), _check_global_timestamp(device, drawctxt, timestamp), msecs_to_jiffies(timeout)); if (ret == 0) Loading @@ -208,7 +215,7 @@ static int adreno_drawctxt_wait_global(struct adreno_device *adreno_dev, ret = 0; } else { wait_event(drawctxt->waiting, _check_global_timestamp(device, timestamp)); _check_global_timestamp(device, drawctxt, timestamp)); } mutex_lock(&device->mutex); Loading