<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add rendernode support to headless-GL backend"
href="https://bugs.freedesktop.org/show_bug.cgi?id=83985#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Add rendernode support to headless-GL backend"
href="https://bugs.freedesktop.org/show_bug.cgi?id=83985">bug 83985</a>
from <span class="vcard"><a class="email" href="mailto:gajownik@gmail.com" title="Dawid Gajownik <gajownik@gmail.com>"> <span class="fn">Dawid Gajownik</span></a>
</span></b>
<pre>(In reply to Pekka Paalanen from <a href="show_bug.cgi?id=83985#c4">comment #4</a>)
<span class="quote">> We will want to run all headless backend tests with the Pixman renderer by
> default, and if EGL is enabled, re-run the screenshot and EGL related tests
> with the gl-renderer. I'm not sure how easy that is with the current test
> harness, and the new test harness is still lacking the client helpers and
> could use converting buffer-count-test and internal-screenshot-test over
> before it's clear how to do this. So that may need to wait for later. Or
> maybe you already implemented this?</span >
As for now I've been only changing/adding 'server_parameters' string in the
tests.
<span class="quote">> --disable-egl should definitely only disable the gl-renderer part, not
> headless altogether.</span >
OK, I'll fix the code.
<span class="quote">> I don't think we should have it as a build time option only, either. Of
> course, --disable-egl prevents gl-renderer from being built, but linking it
> in should be a runtime option.</span >
That's how I implemented it. I based my code a lot on compositor-drm and
compositor-fbdev.
<span class="quote">> I'd like to see your code to see what you use libudev and libgbm for.</span >
I'll attach the patch shortly.
<span class="quote">> I suppose you use libudev to find the render node?</span >
Exactly, that's how it is used right now. First I used mesa approach to iterate
through /dev/dri/renderD* files, but then I found out libudev from waffle
source code.
<a href="https://github.com/waffle-gl/waffle/blob/master/src/waffle/gbm/wgbm_display.c#L67">https://github.com/waffle-gl/waffle/blob/master/src/waffle/gbm/wgbm_display.c#L67</a>
<span class="quote">> I think that could be
> replaced with EGL_EXT_device_base and EGL_EXT_device_drm extensions, which
> are WIP for Mesa still:
> <a href="http://lists.freedesktop.org/archives/mesa-dev/2015-July/089783.html">http://lists.freedesktop.org/archives/mesa-dev/2015-July/089783.html</a></span >
Thanks, I'll take a look at it.
<span class="quote">> Are you using the EGL surfaceless platform or GBM platform? Could using the
> surfaceless platform remove the direct link from headless backend to libgbm?</span >
GBM platfrom like in EGL_MESA_platform_gbm/EGL_KHR_platform_gbm example
<a href="https://www.khronos.org/registry/egl/extensions/MESA/EGL_MESA_platform_gbm.txt">https://www.khronos.org/registry/egl/extensions/MESA/EGL_MESA_platform_gbm.txt</a>
The main difference is that:
1) I'm using renderD<num> device instead of card0
2) file is opened with "O_RDWR | O_CLOEXEC" not "O_RDWR | FD_CLOEXEC" flags.
On one of my systems FD_CLOEXEC was segfaulting nouveau_dri.so.
I did not experiment more with EGL_surfaceless platform because that it's not
widely available yet and would require more work in gl-renderer.
<span class="quote">> Oh, I suppose our gl-renderer API does not account for rendering into an FBO
> off-screen. It always requires an EGLNativeWindowType to create an
> EGLSurface for. Do you know if there is anything we could pass in with
> surfaceless to get a working EGLSurface, or would it always force us to use
> an FBO because the EGLSurface is a dummy?</span >
As far as I remember I stuck on creating an EGLsurface without gbm_surface
*surface. My knowledge was so small that I started reading "OpenGL ES 3.0
Programming Guide" about EGL and FBO. In the meantime you mentioned this bug so
I left #83984 and surfaceless platform for later.
Right now I don't know if it's possible but back then I was going into
conclusion that FBOs need to be used instead of EGLSurface.
Anyway, many thanks for the all of this information. Such a mentoring helps me
a lot :-)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>