<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div style="font-family:Arial;">Hi,<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">I'm not sure exactly what mechanism you're using to implement the WPE interfaces, so I'll just list a few options.<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Focusing on wpe_renderer_backend_egl_offscreen_target_interface that's used as the basis for the sharing context and WebGL contexts, the simplest implementation would just return NULL in get_native_window(). That effectively enforces creation of a pbuffer-based context, but that isn't available on some platforms.<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">A workaround for this is using dummy surfaces, if possible. Here's implementations for WPE backend implementations that are based on libgbm and wayland-egl:<br></div>
<div style="font-family:Arial;"><a href="https://github.com/WebKitForWayland/wpe-mesa/blob/master/src/gbm/renderer-backend-egl-gbm.cpp#L237">https://github.com/WebKitForWayland/wpe-mesa/blob/master/src/gbm/renderer-backend-egl-gbm.cpp#L237</a><br></div>
<div style="font-family:Arial;"><a href="https://github.com/WebKitForWayland/wpe-mesa/blob/master/src/nc/renderer-backend-egl.cpp#L269">https://github.com/WebKitForWayland/wpe-mesa/blob/master/src/nc/renderer-backend-egl.cpp#L269</a><br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Those were developed and tested on top of the Mesa library, but weren't tested with the Freedreno driver, at least not to my knowledge.<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Hope that helps,<br></div>
<div style="font-family:Arial;">Zan</div>
<div><br></div>
<div><br></div>
<div>On Mon, Feb 6, 2017, at 07:32 AM, Sivasubramanian Patchaiperumal wrote:<br></div>
<blockquote type="cite"><div dir="ltr">Tried writing a simple EGL pbuffer application and tested it on DB410c. As expected, eglChooseConfig returned no matched config available. Is there something we can do to get pbuffer support on Mesa?<br></div>
<div><div style="font-family:Arial;"><br></div>
<div defang_data-gmailquote="yes"><div style="font-family:Arial;">On 3 February 2017 at 20:33, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>></span> wrote:<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div style="font-family:Arial;">Hmm, could be that westeros is doing something wrong that causes the<br></div>
<div style="font-family:Arial;"> pbuffer path to be hit.  I'm not entirely sure why pbuffer is not<br></div>
<div style="font-family:Arial;"> supported in wayland (other than just that these days there are better<br></div>
<div style="font-family:Arial;"> ways to do things than pbuffer), although I thought I remembered<br></div>
<div style="font-family:Arial;"> seeing a fallback to surfaceless in webkit..<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> BR,<br></div>
<div style="font-family:Arial;"> -R<br></div>
<div style="font-family:Arial;"> <br></div>
<div style="font-family:Arial;"> On Fri, Feb 3, 2017 at 1:05 AM, Sivasubramanian Patchaiperumal<br></div>
<div style="font-family:Arial;"> <br></div>
<div><div><div style="font-family:Arial;"><<a href="mailto:sivasubramanian.patchaiperumal@linaro.org">sivasubramanian.<wbr>patchaiperumal@linaro.org</a>> wrote:<br></div>
<div style="font-family:Arial;"> > One more point is westeros always return null window for offscreen target,<br></div>
<div style="font-family:Arial;"> > that why WPE falls back to pbuffer on HiKey and DB410c cases.<br></div>
<div style="font-family:Arial;"> ><br></div>
<div style="font-family:Arial;"> > On 3 February 2017 at 11:30, Sivasubramanian Patchaiperumal<br></div>
<div style="font-family:Arial;"> > <<a href="mailto:sivasubramanian.patchaiperumal@linaro.org">sivasubramanian.<wbr>patchaiperumal@linaro.org</a>> wrote:<br></div>
<div style="font-family:Arial;"> >><br></div>
<div style="font-family:Arial;"> >> Thanks Rob for your inputs. Yes, you are looking at the right place. But<br></div>
<div style="font-family:Arial;"> >> the HiKey which takes same pbuffer path and it working with Mali is the<br></div>
<div style="font-family:Arial;"> >> reference now. I'm trying to write a simple egl app that uses pbuffer to<br></div>
<div style="font-family:Arial;"> >> confirm the support with Mesa. Does it sounds correct or you have any<br></div>
<div style="font-family:Arial;"> >> suggestions?<br></div>
<div style="font-family:Arial;"> >><br></div>
<div style="font-family:Arial;"> >> On 3 February 2017 at 02:06, Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>><br></div>
<div style="font-family:Arial;"> >>> btw, where exactly is it crashing?  I grabbed the WebKitForWayland<br></div>
<div style="font-family:Arial;"> >>> tree.. if I'm looking at the right thing, the only place where it<br></div>
<div style="font-family:Arial;"> >>> should try to create a pbuffer is in<br></div>
<div style="font-family:Arial;"> >>> Source/WebCore/platform/<wbr>graphics/egl/GLContextEGL.cpp and that looks<br></div>
<div style="font-family:Arial;"> >>> like it should only be a fallback after createWaylandContext() fails??<br></div>
<div style="font-family:Arial;"> >>><br></div>
<div style="font-family:Arial;"> >>> I suspect pbuffer is not the root problem, that looks like a fallback<br></div>
<div style="font-family:Arial;"> >>> path that shouldn't be hit..<br></div>
<div style="font-family:Arial;"> >>><br></div>
<div style="font-family:Arial;"> >>> BR,<br></div>
<div style="font-family:Arial;"> >>> -R<br></div>
<div style="font-family:Arial;"> >>><br></div>
<div style="font-family:Arial;"> >>> On Thu, Feb 2, 2017 at 9:55 AM, Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>> > hmm, just looking at dri2_wl_display_vtbl:<br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> >    .create_pbuffer_surface = dri2_fallback_create_pbuffer_<wbr>surface,<br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> > which just returns null.. so I guess pbuffers are not supported under<br></div>
<div style="font-family:Arial;"> >>> > wayland.<br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> > Bit of google search reveals:<br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> > <a href="https://lists.freedesktop.org/archives/wayland-devel/2012-April/002928.html">https://lists.freedesktop.org/<wbr>archives/wayland-devel/2012-<wbr>April/002928.html</a><br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> > so I think the answer is don't use pbuffers.<br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> > BR,<br></div>
<div style="font-family:Arial;"> >>> > -R<br></div>
<div style="font-family:Arial;"> >>> ><br></div>
<div style="font-family:Arial;"> >>> > On Thu, Feb 2, 2017 at 9:50 AM, Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>> >> hmm, tons of older stuff uses pbuffers w/ x11.. although a quick look<br></div>
<div style="font-family:Arial;"> >>> >> at mesa/demos.git and it doesn't look like any of them that build for<br></div>
<div style="font-family:Arial;"> >>> >> wayland do.  I don't think pbuffers are used much anymore.  But I<br></div>
<div style="font-family:Arial;"> >>> >> would expect there should be some piglit tests which do.<br></div>
<div style="font-family:Arial;"> >>> >><br></div>
<div style="font-family:Arial;"> >>> >> (Plus, firefox and chromium have been ported to wayland.. and quite a<br></div>
<div style="font-family:Arial;"> >>> >> lot of other sw.  And a lot of us are using wayland on our<br></div>
<div style="font-family:Arial;"> >>> >> laptops/desktops these days.)<br></div>
<div style="font-family:Arial;"> >>> >><br></div>
<div style="font-family:Arial;"> >>> >> BR,<br></div>
<div style="font-family:Arial;"> >>> >> -R<br></div>
<div style="font-family:Arial;"> >>> >><br></div>
<div style="font-family:Arial;"> >>> >> On Thu, Feb 2, 2017 at 9:39 AM, Sivasubramanian Patchaiperumal<br></div>
<div style="font-family:Arial;"> >>> >> <<a href="mailto:sivasubramanian.patchaiperumal@linaro.org">sivasubramanian.<wbr>patchaiperumal@linaro.org</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>> >>> Yes, WebProcess(in WebKit) is crashing on DB410c. Any client that<br></div>
<div style="font-family:Arial;"> >>> >>> uses<br></div>
<div style="font-family:Arial;"> >>> >>> pbuffer surfaces will crash I suspect. Is there is any simple egl<br></div>
<div style="font-family:Arial;"> >>> >>> application that uses pixel buffer to verify and confirm?<br></div>
<div style="font-family:Arial;"> >>> >>><br></div>
<div style="font-family:Arial;"> >>> >>> On 2 February 2017 at 19:00, Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>> >>>><br></div>
<div style="font-family:Arial;"> >>> >>>> hmm, ok, so it is a *client* process that is crashing?  The wayland<br></div>
<div style="font-family:Arial;"> >>> >>>> winsys (used by client processes, as opposed to gbm/drm winsys used<br></div>
<div style="font-family:Arial;"> >>> >>>> by<br></div>
<div style="font-family:Arial;"> >>> >>>> compositor) does support pbuffers.<br></div>
<div style="font-family:Arial;"> >>> >>>><br></div>
<div style="font-family:Arial;"> >>> >>>> BR,<br></div>
<div style="font-family:Arial;"> >>> >>>> -R<br></div>
<div style="font-family:Arial;"> >>> >>>><br></div>
<div style="font-family:Arial;"> >>> >>>> On Thu, Feb 2, 2017 at 7:43 AM, Sivasubramanian Patchaiperumal<br></div>
<div style="font-family:Arial;"> >>> >>>> <<a href="mailto:sivasubramanian.patchaiperumal@linaro.org">sivasubramanian.<wbr>patchaiperumal@linaro.org</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>> >>>> > Westeros code uses EGL window surface only, but the WPE code (at<br></div>
<div style="font-family:Arial;"> >>> >>>> > <a href="https://github.com/Metrological/WebKitForWayland/">https://github.com/<wbr>Metrological/WebKitForWayland/</a><wbr>) which uses<br></div>
<div style="font-family:Arial;"> >>> >>>> > pbuffer<br></div>
<div style="font-family:Arial;"> >>> >>>> > works<br></div>
<div style="font-family:Arial;"> >>> >>>> > on HiKey and RPI as mentioned.<br></div>
<div style="font-family:Arial;"> >>> >>>> ><br></div>
<div style="font-family:Arial;"> >>> >>>> > On 2 February 2017 at 17:38, Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>><br></div>
<div style="font-family:Arial;"> >>> >>>> > wrote:<br></div>
<div style="font-family:Arial;"> >>> >>>> >><br></div>
<div style="font-family:Arial;"> >>> >>>> >> On Thu, Feb 2, 2017 at 2:13 AM, Sivasubramanian Patchaiperumal<br></div>
<div style="font-family:Arial;"> >>> >>>> >> <<a href="mailto:sivasubramanian.patchaiperumal@linaro.org">sivasubramanian.<wbr>patchaiperumal@linaro.org</a>> wrote:<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > Hi,<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > I'm trying to port WPE on DB410c with Westeros compositor, but<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > the<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > webprocess crashes due to null sharingcontext. Webprocess fails<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > to<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > create gl<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > context as eglChooseConfig fails when the surface type<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > attribute is<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > pbuffer.<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > Also, Westeros sample app works fine and the issue is only when<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > surface<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > type<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > attribute is pbuffer. But the same issue is not observed on<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > similar<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > scenerios, HiKey and RPI with westeros. Is there something to<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > do with<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > db410c<br></div>
<div style="font-family:Arial;"> >>> >>>> >> > for eglChooseConfig failure when surface type is pbuffer?<br></div>
<div style="font-family:Arial;"> >>> >>>> >><br></div>
<div style="font-family:Arial;"> >>> >>>> >> Can you point me at the code?  Not 100% sure but possibly gbm/drm<br></div>
<div style="font-family:Arial;"> >>> >>>> >> egl<br></div>
<div style="font-family:Arial;"> >>> >>>> >> implementation does not support pbuffer surfaces.  I don't see<br></div>
<div style="font-family:Arial;"> >>> >>>> >> weston<br></div>
<div style="font-family:Arial;"> >>> >>>> >> using pbuffer's, for example.<br></div>
<div style="font-family:Arial;"> >>> >>>> >><br></div>
<div style="font-family:Arial;"> >>> >>>> >> Has this code ever worked with anything other than closed src<br></div>
<div style="font-family:Arial;"> >>> >>>> >> gles<br></div>
<div style="font-family:Arial;"> >>> >>>> >> drivers?  (Like the vc4 driver on r-pi or on x86?)<br></div>
<div style="font-family:Arial;"> >>> >>>> >><br></div>
<div style="font-family:Arial;"> >>> >>>> >> BR,<br></div>
<div style="font-family:Arial;"> >>> >>>> >> -R<br></div>
<div style="font-family:Arial;"> >>> >>>> ><br></div>
<div style="font-family:Arial;"> >>> >>>> ><br></div>
<div style="font-family:Arial;"> >>> >>>> ><br></div>
<div style="font-family:Arial;"> >>> >>>> ><br></div>
<div style="font-family:Arial;"> >>> >>>> > --<br></div>
<div style="font-family:Arial;"> >>> >>>> > Regards,<br></div>
<div style="font-family:Arial;"> >>> >>>> > Sivasubramanian<br></div>
<div style="font-family:Arial;"> >>> >>><br></div>
<div style="font-family:Arial;"> >>> >>><br></div>
<div style="font-family:Arial;"> >>> >>><br></div>
<div style="font-family:Arial;"> >>> >>><br></div>
<div style="font-family:Arial;"> >>> >>> --<br></div>
<div style="font-family:Arial;"> >>> >>> Regards,<br></div>
<div style="font-family:Arial;"> >>> >>> Sivasubramanian<br></div>
<div style="font-family:Arial;"> >><br></div>
<div style="font-family:Arial;"> >><br></div>
<div style="font-family:Arial;"> >><br></div>
<div style="font-family:Arial;"> >><br></div>
<div style="font-family:Arial;"> >> --<br></div>
<div style="font-family:Arial;"> >> Regards,<br></div>
<div style="font-family:Arial;"> >> Sivasubramanian<br></div>
<div style="font-family:Arial;"> ><br></div>
<div style="font-family:Arial;"> ><br></div>
<div style="font-family:Arial;"> ><br></div>
<div style="font-family:Arial;"> ><br></div>
<div style="font-family:Arial;"> > --<br></div>
<div style="font-family:Arial;"> > Regards,<br></div>
<div style="font-family:Arial;"> > Sivasubramanian<br></div>
</div>
</div>
</blockquote></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">-- <br></div>
<div><div dir="ltr"><div>Regards,<br></div>
<div style="font-family:Arial;">Sivasubramanian<br></div>
</div>
</div>
</div>
<div><u>_______________________________________________</u><br></div>
<div>mesa-dev mailing list<br></div>
<div><a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br></div>
<div><a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br></div>
</blockquote><div style="font-family:Arial;"><br></div>
</body>
</html>