[Mesa-users] Need help getting start with EGL/DRM/KMS/GLES2
Albert Freeman
albertwdfreeman at gmail.com
Tue Sep 1 17:57:52 PDT 2015
My mesa config: I am using the git development tree for both libdrm
and mesa. Linux 4.1.6-1 (the 1 is an arch linux maintainer patch).
./autogen.sh --prefix=/usr \
--sysconfdir=/etc \
--with-dri-driverdir=/usr/lib/xorg/modules/dri \
--with-gallium-drivers= \
--with-dri-drivers=i965 \
--with-egl-platforms=x11,drm,wayland \
--enable-egl \
--enable-gbm \
--enable-shared-glapi \
--enable-glx \
--enable-glx-tls \
--enable-dri \
--enable-gles1 \
--enable-gles2 \
--enable-texture-float \
--enable-xa \
--enable-vdpau
On 2 September 2015 at 00:52, Albert Freeman <albertwdfreeman at gmail.com> wrote:
> My mesa config: I am using the git development tree for both libdrm
> and mesa. Linux 4.1.6-1 (the 1 is an arch linux maintainer patch).
>
> ./autogen.sh --prefix=/usr \
> --sysconfdir=/etc \
> --with-dri-driverdir=/usr/lib/xorg/modules/dri \
> --with-gallium-drivers= \
> --with-dri-drivers=i965 \
> --with-egl-platforms=x11,drm,wayland \
> --enable-egl \
> --enable-gbm \
> --enable-shared-glapi \
> --enable-glx \
> --enable-glx-tls \
> --enable-dri \
> --enable-gles1 \
> --enable-gles2 \
> --enable-texture-float \
> --enable-xa \
> --enable-vdpau
>
> On 1 September 2015 at 17:16, Jean-François Doyon <jfdoyon at gmail.com> wrote:
>> 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;
>>
>>
More information about the mesa-users
mailing list