[Mesa-users] Need help getting start with EGL/DRM/KMS/GLES2

Jean-François Doyon jfdoyon at gmail.com
Tue Sep 1 10:16:29 PDT 2015


Albert,

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!

Can I ask what your environment is like? Were you using the vmwgfx driver?
What version of Mesa, libdrm, kernel, etc?

I'll try to get gdb into my image to see if I can glean some more details
...

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 ...

Thanks,
J.F.

On Tue, Sep 1, 2015 at 12:10 AM, Albert Freeman <albertwdfreeman at gmail.com>
wrote:

> Well with these quick and dirty changes I made, it works fine on my
> system, no segfault and the screen displays red.
>
> --- gleskmsorg.c    2015-09-01 14:04:32.853672410 +0000
> +++ gleskms.c    2015-09-01 14:03:57.797005474 +0000
> @@ -24,8 +24,6 @@ EGL_CONFORMANT, EGL_OPENGL_ES2_BIT,
>  EGL_NONE };
>
>  static const char device_name[] = "/dev/dri/card0";
> -static const uint32_t drm_mode_connector_id = 18;
> -static const uint32_t drm_mode_crtc_id = 21;
>
>  int main(void) {
>
> @@ -86,10 +84,12 @@ int main(void) {
>          exit(EXIT_FAILURE);
>      }
>
> +    drmModeRes *res;
>      drmModeConnector *conn;
>      uint32_t conn_id, width, height;
>      drmModeModeInfo modeinfo;
> -    conn = drmModeGetConnector(fd, drm_mode_connector_id);
> +    res = drmModeGetResources(fd);
> +    conn = drmModeGetConnector(fd, *res->connectors);
>      conn_id = conn->connector_id;
>      width = conn->modes[0].hdisplay;
>      height = conn->modes[0].vdisplay;
> @@ -129,7 +129,7 @@ int main(void) {
>          exit(EXIT_FAILURE);
>      }
>
> -    ret = drmModeSetCrtc(fd, drm_mode_crtc_id, drm_fb_id, 0, 0, &conn_id,
> 1,
> +    ret = drmModeSetCrtc(fd, *res->crtcs, drm_fb_id, 0, 0, &conn_id, 1,
>              &modeinfo);
>      if (ret) {
>          printf("failed to set mode: %m\n");
> @@ -143,8 +143,8 @@ int main(void) {
>      gbm_surface_destroy(gs);
>      eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
>      eglDestroyContext(dpy, ctx);
> -//    eglDestroySurface(dpy, surface);
> -//    eglTerminate(dpy);
> +    eglDestroySurface(dpy, surface);
> +    eglTerminate(dpy);
>      gbm_device_destroy(gbm);
>      close(fd);
>      return 0;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20150901/7e0cc3f5/attachment.html>


More information about the mesa-users mailing list