[Mesa-dev] Mesa 7.8.2 DRI2 configuration mismatch

Srini srini_rajini at yahoo.com
Thu Mar 3 03:40:05 PST 2011


Dear All,

Sorry for such a big mail, i just want to put in detailed.

 I am trying for hardware acceleration on Mesa 7.8.2 on RHEL6 which has kernel 
version 2.6.32.
I compiled mesa with below configurations.
./configure --enable-gles2 --enable-egl --with-egl-platforms=drm 
--with-dri-drivers=i965 --disable-glw --with-state-trackers=egl,dri,es 
--enable-gallium-intel

it generated the below list of libraries
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[srini at RHEL2 ~]$ ls -l /usr/local/lib/dri/
total 25636
-rwxr-xr-x 1 root root 12435719 Mar  2 17:31 i915_dri.so
-rwxr-xr-x 1 root root 13808225 Mar  3 15:35 i965_dri.so

[srini at RHEL2 ~]$ ls -l /usr/local/lib/egl/
total 7896
-rwxr-xr-x 1 root root   65323 Mar  3 11:06 egl_dri2.so
-rwxr-xr-x 1 root root   41347 Mar  2 17:31 egl_glx.so
-rwxr-xr-x 1 root root 3223726 Mar  2 17:31 egl_x11_i915.so
-rwxr-xr-x 1 root root 4744002 Mar  2 21:24 egl_x11_i965.so

srini at RHEL2 ~]$ ls -l /usr/local/lib/
total 22804
drwxr-xr-x 2 root root    4096 Mar  3 15:35 dri
drwxr-xr-x 2 root root    4096 Mar  3 11:06 egl
lrwxrwxrwx 1 root root      11 Mar  3 15:35 libEGL.so -> libEGL.so.1
lrwxrwxrwx 1 root root      13 Mar  3 15:35 libEGL.so.1 -> libEGL.so.1.0
-rwxr-xr-x 1 root root  240824 Mar  3 15:35 libEGL.so.1.0
lrwxrwxrwx 1 root root      17 Mar  3 15:35 libGLESv1_CM.so -> libGLESv1_CM.so.1
lrwxrwxrwx 1 root root      21 Mar  3 15:35 libGLESv1_CM.so.1 -> 
libGLESv1_CM.so.1.1.0
-rwxr-xr-x 1 root root 9914669 Mar  2 17:31 libGLESv1_CM.so.1.1.0
lrwxrwxrwx 1 root root      14 Mar  3 15:35 libGLESv2.so -> libGLESv2.so.2
lrwxrwxrwx 1 root root      18 Mar  3 15:35 libGLESv2.so.2 -> libGLESv2.so.2.0.0
-rwxr-xr-x 1 root root 9721044 Mar  2 17:31 libGLESv2.so.2.0.0
lrwxrwxrwx 1 root root      10 Mar  3 15:35 libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root      12 Mar  3 15:35 libGL.so.1 -> libGL.so.1.2
-rwxr-xr-x 1 root root 1799639 Mar  2 17:31 libGL.so.1.2
lrwxrwxrwx 1 root root      11 Mar  3 15:35 libGLU.so -> libGLU.so.1
lrwxrwxrwx 1 root root      20 Mar  3 15:35 libGLU.so.1 -> libGLU.so.1.3.070802
-rwxr-xr-x 1 root root 1653469 Mar  2 17:31 libGLU.so.1.3.070802
drwxr-xr-x 2 root root    4096 Mar  3 15:35 pkgconfig
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Runing my test application, i got below error
[srini at RHEL2 check_GLES]$ ./sphere 
libEGL fatal: DRI2: did not find extension DRI_IMAGE version 1

then i changed few stuff in the file egl_dri2.c. the changes are this.

static struct dri2_extension_match dri2_core_extensions[] = {
   { __DRI2_FLUSH, 1, offsetof(struct dri2_egl_display, flush) },
   { __DRI_TEX_BUFFER, 2, offsetof(struct dri2_egl_display, tex_buffer) },
   { NULL },
   { __DRI_IMAGE, 1, offsetof(struct dri2_egl_display, image) }
};
originally it was like this.
static struct dri2_extension_match dri2_core_extensions[] = {
   { __DRI2_FLUSH, 1, offsetof(struct dri2_egl_display, flush) },
   { __DRI_TEX_BUFFER, 2, offsetof(struct dri2_egl_display, tex_buffer) },
   { __DRI_IMAGE, 1, offsetof(struct dri2_egl_display, image) },
   { NULL }   
};
I changed this after seeing the below structure in the file dri_screen.c
static const __DRIextension *dri_screen_extensions[] = {
      &driReadDrawableExtension,
      &driCopySubBufferExtension.base,
      &driSwapControlExtension.base,
      &driFrameTrackingExtension.base,
      &driMediaStreamCounterExtension.base,
      &dri2TexBufferExtension.base,
      &dri2FlushExtension.base,
      NULL
   };
which actually loads the dri_extension, doesn't have entry for image_extension.

with this change build,eglInitilization is successfull. which actually create 
the screen, configurations everything.

but the application when comming to eglChooseConfig(), it could not find the 
matching EGL attributes. below is my attribute list my application is quering 
for.

static const EGLint attribs[] = {
                EGL_RED_SIZE, 1,
                EGL_GREEN_SIZE, 1,
                EGL_BLUE_SIZE, 1,
                EGL_DEPTH_SIZE, 1,
                EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
                EGL_NONE
        };
and i am endup with the error.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[srini at RHEL2 check_GLES]$ ./sphere 
libEGL debug: dlopen(/usr/local/lib/egl/egl_dri2.so)
libEGL debug: DRI2: dlopen(/usr/local/lib/dri/i965_dri.so)
libEGL debug: DRI2: found extension `DRI_Core'
libEGL info: DRI2: found extension DRI_Core version 1
libEGL debug: DRI2: found extension `DRI_Legacy'
libEGL debug: DRI2: found extension `DRI_DRI2'
libEGL info: DRI2: found extension DRI_DRI2 version 1
libEGL debug: DRI2: found extension `DRI_ReadDrawable'
libEGL debug: DRI2: found extension `DRI_CopySubBuffer'
libEGL debug: DRI2: found extension `DRI_SwapControl'
libEGL debug: DRI2: found extension `DRI_FrameTracking'
libEGL debug: DRI2: found extension `DRI_MediaStreamCounter'
libEGL debug: DRI2: found extension `DRI_TexBuffer'
libEGL info: DRI2: found extension DRI_TexBuffer version 2
libEGL debug: DRI2: found extension `DRI2_Flush'
libEGL info: DRI2: found extension DRI2_Flush version 3
Availble configuration for this attributes are 0
libEGL debug: EGL user error 0x3005 (EGL_BAD_CONFIG) in eglCreateWindowSurface

Error returned by eglCreateWindowSurface - error = 0x3005
[srini at RHEL2 check_GLES]$ 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


but this application working fine if i set 
EGL_DRIVER=/usr/local/lib/egl/egl_x11_i965.so

so, i seriously think it must be the bug from i965_dri2.so.

i am peeking in to the code as much as i do, and ends clueless.

please anyone confirm me where it is going wrong.

glade to give more details.

Thanking you.
Srini.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110303/5983aa79/attachment.htm>


More information about the mesa-dev mailing list