[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#712880: [Beignet] *** SPAM LEVEL 4.823 *** Re: Bug#712903: beignet: libEGL ABI abuse (getting at symbols not intended to be public)



On Thu, Jun 27, 2013 at 11:00:09AM +0800, Zhigang Gong wrote:
> 
> 
> > -----Original Message-----
> > From: beignet-bounces+zhigang.gong=linux.intel.com@lists.freedesktop.org
> >
> [mailto:beignet-bounces+zhigang.gong=linux.intel.com@lists.freedesktop.org]
> > On Behalf Of Simon Richter
> > Sent: Wednesday, June 26, 2013 5:26 PM
> > To: beignet@lists.freedesktop.org
> > Cc: 712903-forwarded@bugs.debian.org; 712880@bugs.debian.org
> > Subject: [Beignet] *** SPAM LEVEL 4.823 *** Re: Bug#712903: beignet:
> libEGL
> > ABI abuse (getting at symbols not intended to be public)
> > 
> > Hi,
> > 
> > On 26.06.2013 10:38, Julien Cristau wrote:
> > 
> > >> the beignet package builds against libegl1-mesa, and uses the symbol
> > >> "image_lookup_extension", which according to the symbols file exists
> > >> since version 8.1.
> > 
> > > Actually that seems like a bug in beignet.  image_lookup_extension is
> > > not a public libEGL symbol AFAICT.  If it was, it would be declared in
> > > a public header.
> > 
> > Okay, so beignet needs to go through the proper extension lookup
> mechanism,
> > got that. Forwarding the bug.
> 
> Right, that's a beignet bug and we need to fix that. Thanks for reporting
> it.

The root cause of this bug is, there lacks of official way to get an eglImage's
attributes. We can use EGL_KHR_gl_texture_2D_image extension to create an EGLimage
from a normal gl texture. Then we have to export the EGL image to the gbm device,
and leverage the gbm to get the image's attributes. But there is one gap:

The gbm device doesn't init lookup_image method and the user data. The lookup_image is only
initialized when use the gbm device to create an egl display and then initialize the egl drm
platform which is not our use model. In our cl gl sharing extension, the gl texture is created
in an existing egl context and the most common case is in an x11 platform rather than a drm platform.
And the existing egl display is different from our newly created gbm device's internal display.
So there is no way to use gbm to get the egl image's attribute without any dirty hacking.

So I have to hack the gbm part to set the internal symbol (image_lookup_extension)
from the egl_dri2.c to the gbm device's lookup_image method and set the user data to the
existing egl display. Thus we can lookup those attributes latter.

There is no good method to fix this currently. One possible solution is to extent the
gbm library to create a gbm device from a egl dri2 display. But I'm not very sure
whether it can be accepted by the mesa community, I may submit a patch after beignet
0.2 release.

Any comments?

> 
> > 
> >    Simon
> 
> 
> _______________________________________________
> Beignet mailing list
> Beignet@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


Reply to: