<div dir="ltr">Albert,<div><br></div><div>Thanks for taking the time to investigate ... I'm afraid that made no difference on my end. I guess there's something about my software stack or environment that's causing this then, now that I know I wasn't crazy and my code was indeed supposed to work!</div><div><br></div><div>Can I ask what your environment is like? Were you using the vmwgfx driver? What version of Mesa, libdrm, kernel, etc?</div><div><br></div><div>I'll try to get gdb into my image to see if I can glean some more details ...</div><div><br></div><div>I did try to use buildroot's included libdrm/mesa configs (instead of my own "recipes"), which are also slightly older versions, but that changed nothing either ...</div><div><br></div><div>Thanks,</div><div>J.F.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 12:10 AM, 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">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>
<span class=""> EGL_NONE };<br>
<br>
static const char device_name[] = "/dev/dri/card0";<br>
</span>-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>
<span class=""> drmModeConnector *conn;<br>
uint32_t conn_id, width, height;<br>
drmModeModeInfo modeinfo;<br>
</span>- conn = drmModeGetConnector(fd, drm_mode_connector_id);<br>
+ res = drmModeGetResources(fd);<br>
+ conn = drmModeGetConnector(fd, *res->connectors);<br>
<span class=""> conn_id = conn->connector_id;<br>
width = conn->modes[0].hdisplay;<br>
height = conn->modes[0].vdisplay;<br>
</span>@@ -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, 1,<br>
+ ret = drmModeSetCrtc(fd, *res->crtcs, drm_fb_id, 0, 0, &conn_id, 1,<br>
<span class=""> &modeinfo);<br>
if (ret) {<br>
printf("failed to set mode: %m\n");<br>
</span>@@ -143,8 +143,8 @@ int main(void) {<br>
<span class=""> gbm_surface_destroy(gs);<br>
eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);<br>
eglDestroyContext(dpy, ctx);<br>
</span>-// 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>
</blockquote></div><br></div>