diff mbox

[5/5] RFC: add eglWaitGL()

Message ID 1331513325-1554-5-git-send-email-rob.clark@linaro.org
State New
Headers show

Commit Message

Rob Clark March 12, 2012, 12:48 a.m. UTC
From: Rob Clark <rob@ti.com>

For deferred rendering GPUs, some magic under the hood of eglSwapBuffers()
is responsible for making sure rendering has actually started.  (glFlush()
doesn't do the trick.)

I've managed to make weston drm compositor work on sgx/pvr stack (plus
omapdrm providing the KMS bits) by getting eglWaitGL() to do the work
that would normally be done in eglSwapBuffers(), in case that the
surfaceless_gles2 extension is in use (as detected by eglMakeCurrent()
call).

I'm not sure if this eglWaitGL() call would potentially cause issues on
other GL(ES) stacks?  Or if it is a suitable work-around until the
gbm-surface stuff is in use?
---
 src/compositor-drm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Kristian Høgsberg March 20, 2012, 5:45 p.m. UTC | #1
On Sun, Mar 11, 2012 at 07:48:45PM -0500, Rob Clark wrote:
> From: Rob Clark <rob@ti.com>
> 
> For deferred rendering GPUs, some magic under the hood of eglSwapBuffers()
> is responsible for making sure rendering has actually started.  (glFlush()
> doesn't do the trick.)
> 
> I've managed to make weston drm compositor work on sgx/pvr stack (plus
> omapdrm providing the KMS bits) by getting eglWaitGL() to do the work
> that would normally be done in eglSwapBuffers(), in case that the
> surfaceless_gles2 extension is in use (as detected by eglMakeCurrent()
> call).
> 
> I'm not sure if this eglWaitGL() call would potentially cause issues on
> other GL(ES) stacks?  Or if it is a suitable work-around until the
> gbm-surface stuff is in use?

I hope we can land the gbm-surface feature sooner rather than later,
so maybe you can just keep this a local workaround a little longer?

thanks,
Kristian

> ---
>  src/compositor-drm.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index c8e6eaf..f556ac3 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -246,6 +246,7 @@ drm_output_repaint(struct weston_output *output_base,
>  		weston_surface_draw(surface, &output->base, damage);
>  
>  	glFlush();
> +	eglWaitGL();
>  
>  	output->current ^= 1;
>  
> -- 
> 1.7.5.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Rob Clark March 20, 2012, 6:13 p.m. UTC | #2
On Tue, Mar 20, 2012 at 12:45 PM, Kristian Hoegsberg
<hoegsberg@gmail.com> wrote:
> On Sun, Mar 11, 2012 at 07:48:45PM -0500, Rob Clark wrote:
>> From: Rob Clark <rob@ti.com>
>>
>> For deferred rendering GPUs, some magic under the hood of eglSwapBuffers()
>> is responsible for making sure rendering has actually started.  (glFlush()
>> doesn't do the trick.)
>>
>> I've managed to make weston drm compositor work on sgx/pvr stack (plus
>> omapdrm providing the KMS bits) by getting eglWaitGL() to do the work
>> that would normally be done in eglSwapBuffers(), in case that the
>> surfaceless_gles2 extension is in use (as detected by eglMakeCurrent()
>> call).
>>
>> I'm not sure if this eglWaitGL() call would potentially cause issues on
>> other GL(ES) stacks?  Or if it is a suitable work-around until the
>> gbm-surface stuff is in use?
>
> I hope we can land the gbm-surface feature sooner rather than later,
> so maybe you can just keep this a local workaround a little longer?

yeah, that should be fine.. I think the gbm-surface stuff will make
the EGL integration work somewhat smoother..

It might be nice for 0.85 branch, assuming gbm-surface isn't for 0.85
too.  Although maybe I could try and convince ubuntu folks to carry
that as a patch in 12.04 weston deb's.  (Assuming no one things
eglWaitGL() would cause issues w/ other stacks..)

BR,
-R


> thanks,
> Kristian
>
>> ---
>>  src/compositor-drm.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
>> index c8e6eaf..f556ac3 100644
>> --- a/src/compositor-drm.c
>> +++ b/src/compositor-drm.c
>> @@ -246,6 +246,7 @@ drm_output_repaint(struct weston_output *output_base,
>>               weston_surface_draw(surface, &output->base, damage);
>>
>>       glFlush();
>> +     eglWaitGL();
>>
>>       output->current ^= 1;
>>
>> --
>> 1.7.5.4
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
diff mbox

Patch

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index c8e6eaf..f556ac3 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -246,6 +246,7 @@  drm_output_repaint(struct weston_output *output_base,
 		weston_surface_draw(surface, &output->base, damage);
 
 	glFlush();
+	eglWaitGL();
 
 	output->current ^= 1;