<div dir="ltr"><div><div><div><div><div>Hi Prabhu,<br></div>Could you be a little more specific as to what you are doing.  It sounds like you are either writing a client or trying to write the client-side wayland bits for a driver stack.  However, it's kind of hard from you description to tell exactly what you're working on.  Nevertheless, I will try to answer your question as best I can.<br>
<br></div>While Weston itself is single-threaded, the libwayland client library can handle multiple threads rather well.  Look into wl_event_queue which allows you to manage what events get called on what thread.  Also, any request can be called from any thread.  The only issue is in the synchronization that your app may need to do (know when wl_surface.commit occurs relative to wl_shell_surface.set_maximized for instance).  If you want to get a frame completion event in another thread, simply call wl_surface.frame, wl_surface.commit and then add the callback you got from wl_surface.frame to the wl_event_queue for that thread.<br>
<br></div>Also, I'm confused by the relationship between your eglSwapBuffers calls and your wl_surface.commit calls.  eglSwapBuffers should be calling wl_surface.commit before it returns.  Sometimes this means the underlying graphics drivers pass sync fences or do other things to keep from doing a full glFinish and stalling the GPU. Therefore, in most cases, you shouldn't need to be calling wl_surface.commit manually.  Perhaps I'm just misunderstanding something?<br>
<br></div>I hope that helps,<br></div>--Jason Ekstrand<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 7, 2014 at 8:03 AM, Prabhu S <span dir="ltr"><<a href="mailto:prabhusundar@gmail.com" target="_blank">prabhusundar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello,<br>eglSwapBuffers is a non blocking call. Normally, 3D GPU will be used both for content creation and composition, in that case everything will end up the GPU unit. So the end frame will be will be synchronized. (assuming 1 GPU unit).<br>


<br>I have a scenario, where 3D GPU being used for creating content and blit engine used for Weston composition. I'm getting frame completion from 3D engine in different thread (not in the same thread eglSwapBuffers calling thread). Currently eglSwapBuffers calling thread need to wait for the frame completion and then call wl_surface_commit to notify Wayland compositor. This takes out most of the performance since GPUs are not active all the time.<br>


<br></div>wl_surface_commit cannot be called from different thread AFAIK. Some advise, suggestions would be appreciated.<br><br></div>Thanks<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Prabhu<br>
</font></span></div>
<br>_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
<br></blockquote></div><br></div>