aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2014-09-13 16:51:12 +0200
committerSylvain Munaut <tnt@246tNt.com>2014-09-25 23:46:25 +0200
commitf16d0ffafb29f5004c70d7fde85e7366d2024c8e (patch)
tree6c9b68dc822d4072f38adbe0850e46000f2a2919
parente1348d52aa8ee39fff3d546c652d021a83598ca2 (diff)
fosphor/cl: Make sure that all init is done before first render
If no data was processed, finished would return 0 and then the gl_refresh would not be called which would lead to the GL deferred init to not be executed which can crash the OpenGL driver. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--lib/fosphor/cl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/fosphor/cl.c b/lib/fosphor/cl.c
index fea1dd8..d367469 100644
--- a/lib/fosphor/cl.c
+++ b/lib/fosphor/cl.c
@@ -922,10 +922,17 @@ fosphor_cl_finish(struct fosphor *self)
cl_int err;
- /* Check if we really need to finish */
- if (cl->state != CL_PENDING)
+ /* Check if we really need to do anything */
+ if (cl->state == CL_READY)
return 0;
+ /* If no data was processed, we may need to finish the boot */
+ if (cl->state == CL_BOOTING) {
+ err = cl_queue_clear_buffers(self);
+ if (err != CL_SUCCESS)
+ goto error;
+ }
+
/* Act depending on current mode */
if (self->flags & FLG_FOSPHOR_USE_CLGL_SHARING)
{