<div dir="ltr">OK, well best I can tell, this is an issue with the vmwgfx driver ... I found another EGL/DRM demo that I can get to work essentially unmodified on my setup no problem.<div><br></div><div>Funny thing is that it starts with glClear as well, and then goes on to render an animated cube ... if I remove the animated cube code, and leave only the glClear (Which has a specific colour also set), black screen.</div><div><br></div><div>Re-enable the rest of the code, beautiful spinning cube appears!</div><div><br></div><div>So it would appear I may have run into 2 bugs, since they didn't occur on your platform(s), and it seems the behaviour for you should've been the correct one :</div><div><br></div><div>- The glClearColor is not respected</div><div>- The double call to gbm_bo_destroy_buffer causes a segfault</div><div><br></div><div>At least I know my basic software stack can work, which is all I really wanted to know for now ...</div><div><br></div><div>Now on to learn GLES ...</div><div><br></div><div>Thanks for the help.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 10:41 PM, Albert Freeman <span dir="ltr"><<a href="mailto:albertwdfreeman@gmail.com" target="_blank">albertwdfreeman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You might try using softpipe via "export GALLIUM_DRIVER=softpipe" and<br>
"export LIBGL_ALWAYS_SOFTWARE=1". Which hopefully will use the<br>
softpipe software renderer instead of svga. You will need to change<br>
--with-gallium-drivers=svga to --with-gallium-drivers=svga,swrast and<br>
recompile mesa.<br>
<div class="HOEnZb"><div class="h5"><br>
On 2 September 2015 at 00:57, Albert Freeman <<a href="mailto:albertwdfreeman@gmail.com">albertwdfreeman@gmail.com</a>> wrote:<br>
> My mesa config: I am using the git development tree for both libdrm<br>
> and mesa. Linux 4.1.6-1 (the 1 is an arch linux maintainer patch).<br>
><br>
> ./autogen.sh --prefix=/usr \<br>
> --sysconfdir=/etc \<br>
> --with-dri-driverdir=/usr/lib/xorg/modules/dri \<br>
> --with-gallium-drivers= \<br>
> --with-dri-drivers=i965 \<br>
> --with-egl-platforms=x11,drm,wayland \<br>
> --enable-egl \<br>
> --enable-gbm \<br>
> --enable-shared-glapi \<br>
> --enable-glx \<br>
> --enable-glx-tls \<br>
> --enable-dri \<br>
> --enable-gles1 \<br>
> --enable-gles2 \<br>
> --enable-texture-float \<br>
> --enable-xa \<br>
> --enable-vdpau<br>
><br>
> On 2 September 2015 at 00:52, Albert Freeman <<a href="mailto:albertwdfreeman@gmail.com">albertwdfreeman@gmail.com</a>> wrote:<br>
>> My mesa config: I am using the git development tree for both libdrm<br>
>> and mesa. Linux 4.1.6-1 (the 1 is an arch linux maintainer patch).<br>
>><br>
>> ./autogen.sh --prefix=/usr \<br>
>> --sysconfdir=/etc \<br>
>> --with-dri-driverdir=/usr/lib/xorg/modules/dri \<br>
>> --with-gallium-drivers= \<br>
>> --with-dri-drivers=i965 \<br>
>> --with-egl-platforms=x11,drm,wayland \<br>
>> --enable-egl \<br>
>> --enable-gbm \<br>
>> --enable-shared-glapi \<br>
>> --enable-glx \<br>
>> --enable-glx-tls \<br>
>> --enable-dri \<br>
>> --enable-gles1 \<br>
>> --enable-gles2 \<br>
>> --enable-texture-float \<br>
>> --enable-xa \<br>
>> --enable-vdpau<br>
>><br>
>> On 1 September 2015 at 17:16, Jean-François Doyon <<a href="mailto:jfdoyon@gmail.com">jfdoyon@gmail.com</a>> wrote:<br>
>>> Albert,<br>
>>><br>
>>> Thanks for taking the time to investigate ... I'm afraid that made no<br>
>>> difference on my end. I guess there's something about my software stack or<br>
>>> environment that's causing this then, now that I know I wasn't crazy and my<br>
>>> code was indeed supposed to work!<br>
>>><br>
>>> Can I ask what your environment is like? Were you using the vmwgfx driver?<br>
>>> What version of Mesa, libdrm, kernel, etc?<br>
>>><br>
>>> I'll try to get gdb into my image to see if I can glean some more details<br>
>>> ...<br>
>>><br>
>>> I did try to use buildroot's included libdrm/mesa configs (instead of my own<br>
>>> "recipes"), which are also slightly older versions, but that changed nothing<br>
>>> either ...<br>
>>><br>
>>> Thanks,<br>
>>> J.F.<br>
>>><br>
>>> On Tue, Sep 1, 2015 at 12:10 AM, Albert Freeman <<a href="mailto:albertwdfreeman@gmail.com">albertwdfreeman@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Well with these quick and dirty changes I made, it works fine on my<br>
>>>> system, no segfault and the screen displays red.<br>
>>>><br>
>>>> --- gleskmsorg.c 2015-09-01 14:04:32.853672410 +0000<br>
>>>> +++ gleskms.c 2015-09-01 14:03:57.797005474 +0000<br>
>>>> @@ -24,8 +24,6 @@ EGL_CONFORMANT, EGL_OPENGL_ES2_BIT,<br>
>>>> EGL_NONE };<br>
>>>><br>
>>>> static const char device_name[] = "/dev/dri/card0";<br>
>>>> -static const uint32_t drm_mode_connector_id = 18;<br>
>>>> -static const uint32_t drm_mode_crtc_id = 21;<br>
>>>><br>
>>>> int main(void) {<br>
>>>><br>
>>>> @@ -86,10 +84,12 @@ int main(void) {<br>
>>>> exit(EXIT_FAILURE);<br>
>>>> }<br>
>>>><br>
>>>> + drmModeRes *res;<br>
>>>> drmModeConnector *conn;<br>
>>>> uint32_t conn_id, width, height;<br>
>>>> drmModeModeInfo modeinfo;<br>
>>>> - conn = drmModeGetConnector(fd, drm_mode_connector_id);<br>
>>>> + res = drmModeGetResources(fd);<br>
>>>> + conn = drmModeGetConnector(fd, *res->connectors);<br>
>>>> conn_id = conn->connector_id;<br>
>>>> width = conn->modes[0].hdisplay;<br>
>>>> height = conn->modes[0].vdisplay;<br>
>>>> @@ -129,7 +129,7 @@ int main(void) {<br>
>>>> exit(EXIT_FAILURE);<br>
>>>> }<br>
>>>><br>
>>>> - ret = drmModeSetCrtc(fd, drm_mode_crtc_id, drm_fb_id, 0, 0, &conn_id,<br>
>>>> 1,<br>
>>>> + ret = drmModeSetCrtc(fd, *res->crtcs, drm_fb_id, 0, 0, &conn_id, 1,<br>
>>>> &modeinfo);<br>
>>>> if (ret) {<br>
>>>> printf("failed to set mode: %m\n");<br>
>>>> @@ -143,8 +143,8 @@ int main(void) {<br>
>>>> gbm_surface_destroy(gs);<br>
>>>> eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);<br>
>>>> eglDestroyContext(dpy, ctx);<br>
>>>> -// eglDestroySurface(dpy, surface);<br>
>>>> -// eglTerminate(dpy);<br>
>>>> + eglDestroySurface(dpy, surface);<br>
>>>> + eglTerminate(dpy);<br>
>>>> gbm_device_destroy(gbm);<br>
>>>> close(fd);<br>
>>>> return 0;<br>
>>><br>
>>><br>
</div></div></blockquote></div><br></div>