For the convenience of those who didn't witness yesterday's IRC.<br>Yes, a blog-worthy topic.<br><br><<b>madeeha</b>> Hi<br><<b>madeeha</b>> Is it possible to write an egl native wrapper for Wayland for a closed source driver. <br>
<<b>madeeha</b>> I want to keep the native implementation shm based like in mesa which supports both <br><<b>madeeha</b>> shm and drm.Is it possible without availability of the egl source code of the driver?<br>
<<b>pq</b>> madeeha, it all depends on whether your proprietary graphics stack offers anything that allows you to implement graphics buffer sharing<br><<b>pq</b>> madeeha, that's for Wayland clients. Are you talking about clients or servers? They have different requirements.<br>
<<b>pq</b>> madeeha, also what do you mean by shm in this context? Using a rendering API with EGL, copying the image into an shm buffer, and sending that to a server?<br><<b>madeeha</b>> pq: only Wayland client. On the server side, we are managing with fbdev. (i am using the genivi layer manager wayland plugin which allows compositor to work with fbdev)<br>
<<b>madeeha</b>> on the client side, there is an egl/wayland client<br><<b>madeeha</b>> pq: hence the need for egl native for wayland<br><<b>madeeha</b>> pq: can we have the egl native on shm like in mesa/gallium native_wayland.c with native_shm.c<br>
<<b>madeeha</b>> ?<br><<b>pq</b>> err, I still don't quite get the question, maybe because I'm not familiar with native_shm.c of Mesa. But I would bet, that any Wayland shm in Mesa is only for software renderers.<br>
<<b>pq</b>> madeeha, so, you would basically want to have Wayland clients, that use EGL and hardware rendering, to work on your platform, right?<br><<b>pq</b>> Wayland client support in EGL has two parts: the client side which is the EGL Wayland platform + wayland-egl API, and the server side which is basically the EGL_WL_bind_wayland_display extension or something to the same effect<br>
<<b>pq</b>> how the server renders itself, using EGL, fbdev, or whatever, is not too relevant, as long as it is compatible with the way you implement the EGL_WL_bind_wayland_display-equivalent<br><<b>pq</b>> madeeha, can you explain in more words on what you want to do, and what is the "egl native" you refer to?<br>
<<b>madeeha</b>> pq: yes sure, so we have Wayland client applications that use GLES as rendering api ... but the graphics stack has no EGL Wayland platform available<br><<b>pq</b>> right<br><<b>madeeha</b>> pq: the graphics stack supports EGL fbdev platform<br>
<<b>pq</b>> the first thing to get such client apps going, is to find a way you can pass graphics buffers from one process that renders into it, to another process that uses it (as a texture or putting it into an overlay or hw compositor or...)<br>
<<b>pq</b>> step 2 is creating a Wayland protocol extension for the buffer passing<br><<b>madeeha</b>> pq: for the first thing, can't SHM buffers be used if the compositor can handle those?<br><<b>pq</b>> then, try to integrate it into your compositor and the client side, perhaps in a libEGL wrapper<br>
<<b>pq</b>> madeeha, most likely not: buffer that a GPU renders into, are usually badly suited for CPU usage, or impossible to access directly. Hence you would be forced to do a copy, like glReadPixels, into an shm buffer before sending it to the server.<br>
<<b>madeeha</b>> pq: that is what we are doing on compositor side :)<br><<b>madeeha</b>> oh sorry<br><<b>madeeha</b>> pq: please ignore my last comment<br><<b>pq</b>> heh<br><<b>pq</b>> such glReadPixels kind of a copy is a huge performance hit, and then if your server is again using GLES, you have to do glTexImage2D, which is another copy between CPU and GPU domains.<br>
<<b>pq</b>> the best thing would be to find a way to avoid both such copies, and pass the buffer directly, e.g. by passing some handles so you don't have to copy<br><<b>pq</b>> that is what the wl_drm protocol extension does<br>
<<b>madeeha</b>> pq: things are much clearer now .. <br><<b>pq</b>> great :-)<br><<b>madeeha</b>> pq: for wl_drm, the graphics driver has to be drm , right?<br><<b>pq</b>> yeah, wl_drm has been designed for the Linux DRM stuff<br>
<<b>pq</b>> you could design your own protocol extension for the same purpose<br><<b>madeeha</b>> pq: thanks so much!<br><<b>pq</b>> I once made a protocol extension for passing buffers in Android<br><<b>madeeha</b>> pq: do you think i should get some suggestions from your Android branch? .. i browsed it a bit<br>
<<b>madeeha</b>> will that help in my situation<br><<b>pq</b>> hmm... maybe not before you know about your own graphics platform<br><<b>pq</b>> madeeha, the key problem is to find what your handles would be, ans how you create and use them.<br>
<<b>pq</b>> then, passing then through the Wayland protocol, carried by an extension, should not be a big problem.<br><<b>madeeha</b>> pq: true, i will investigate on that side now. thanks<br><br><br><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Nov 21, 2012 at 1:03 PM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@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 class="HOEnZb"><div class="h5">On Wed, 21 Nov 2012 12:36:45 +0530<br>
Abhijit Potnis <<a href="mailto:abhijitpotnis@gmail.com">abhijitpotnis@gmail.com</a>> wrote:<br>
<br>
> On Wed, Nov 21, 2012 at 12:23 PM, Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com">ppaalanen@gmail.com</a>>wrote:<br>
><br>
> > On Wed, 21 Nov 2012 11:38:57 +0800<br>
> > Henius Dong <<a href="mailto:donglw@pset.suntec.net">donglw@pset.suntec.net</a>> wrote:<br>
> ><br>
> > > Hi Abhijit<br>
> > ><br>
> > > -----Original Message-----<br>
> > > From: Abhijit Potnis<br>
> > > Sent: 2012/11/20 15:04<br>
> > ><br>
> > > > On Mon, Nov 19, 2012 at 3:34 PM, Henius Dong <<a href="mailto:donglw@pset.suntec.net">donglw@pset.suntec.net</a><br>
> > > > <mailto:<a href="mailto:donglw@pset.suntec.net">donglw@pset.suntec.net</a>>> wrote:<br>
> > > ><br>
> > > > Hello Abhijit<br>
> > > ><br>
> > > > I saw the topic "Wayland on Embedded" in wayland-devel mailing<br>
> > list.<br>
> > > > I'm interested in this topic too. But, I'm naive in this topic now.<br>
> > > > So, I write a mail to you to see whether you could give me some<br>
> > > > hints or not?<br>
> > > ><br>
> > > > Now, I'm going to port the wayland onto freescale iMX6 board. It<br>
> > > > supports Linux/WinCE/Android OS. I want to use the Linux OS<br>
> > > > "without" DRM support. So, it going to be difficult to use the<br>
> > > > compositor-drm.<br>
> > > > But, freescale offers the GLES2 implementation. So, I wonder I<br>
> > might<br>
> > > > need the same GLES2 >> framebuffer back-end.<br>
> > > ><br>
> > > ><br>
> > > > Freescale iMX6 driver releases do show that they now support drm in<br>
> > > > their kernel. You may want to try that.<br>
> > > > But as such writing a GLES2 over FB backend will work, but with<br>
> > > > restricted features as listed in the<br>
> > > > below mail chain. With much of the work now abstracted by<br>
> > gles2-renderer<br>
> > > > (gl-renderer as its called now) , it must be simple enough to write the<br>
> > > > back-end.<br>
> > > Thanks for your information. I would confirm with Freescale.<br>
> > ><br>
> > > ><br>
> > > > Could you give me some help?<br>
> > > > Anything is welcome.<br>
> > > ><br>
> > > > This will be of some help<br>
> > > > <<br>
> > <a href="http://lists.freedesktop.org/archives/wayland-devel/2012-September/005324.html" target="_blank">http://lists.freedesktop.org/archives/wayland-devel/2012-September/005324.html</a><br>
> > ><br>
> > > I've checked this mail chain. The "restricted features" you mentioned is<br>
> > > I won't able to run GL client by using GLES2 over FB backend, right? But<br>
> > > since iMX6 has the DRM support, using DRM backend may be easier.<br>
> ><br>
> > Whether or not Wayland clients that use GL will work, essentially<br>
> > depends on libEGL, and not really about the backend the compositor is<br>
> > using. In fact, client support and compositor backend are orthogonal.<br>
> > They only need to be compatible in the sense, that what clients<br>
> > provide, the compositor can use.<br>
> ><br>
> > LibEGL is the standard place to implement the support for clients that<br>
> > use GL, but nothing prevents you from inventing your own way, if you<br>
> > control all the applications. Qt5 AFAIU supports its own thing, and so<br>
> > it is not dependant on libEGL's Wayland platform support.<br>
> ><br>
> > The Freescale driver release does have a few Wayland definitions<br>
> in their header files. But no document explaining if they support Wayland/<br>
> Weston. Also there is no explicit mention from freescale that they have<br>
> Wayland EGL platform ( wayland-egl API) implemented.<br>
><br>
> Correct me if I am wrong, with this scenario: we will have to end up<br>
> writing a<br>
> EGL wrapper for their proprietary driver to handle buffers. Or invent ones<br>
> on way.<br>
<br>
</div></div>You're probably right. But the very first thing you have to do is to<br>
find out, if there is a way to pass gfx buffers from one process that<br>
renders into it, to another process that uses it as a texture or<br>
pushes it to the screen somehow. Once you know that, and know what the<br>
buffer handles are, you can start looking at how to use a Wayland<br>
protocol extension to send buffer handles, and then how to wrap it all<br>
in your own libEGL.<br>
<br>
Déjà vu, I think I just explained the same thing to someone on #wayland<br>
last evening. :-P Clearly a blog-worthy topic...<br>
<br>
<br>
Thanks,<br>
pq<br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Abhijit Potnis<br><br>
</div>