Bug 2373

Summary: No virtual/egl provider on Mesa
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Ross Burton <ross.burton>
Component: meta-yoctoAssignee: Edwin Zhai <edwin.zhai>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: alexandrux.palalau, poky.bs.watcher, poky.watcher, richard.purdie, sgw, song.liu, tf+bugs.yocto
Version: 1.1.1   
Target Milestone: 1.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: patch ready for test, May2, 2012
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
Enable egl in mesa none

Description Ross Burton 2012-04-26 11:57:08 UTC
I'm trying to build mex with EGL on my Atom, but Mesa doesn't PROVIDE virtual/egl.
Comment 1 Edwin Zhai 2012-04-27 08:22:40 UTC
(In reply to comment #0)
> I'm trying to build mex with EGL on my Atom, but Mesa doesn't PROVIDE
> virtual/egl.

Ross,
You mean enable EGL support in MESA, right? Adding extra configure option should be okay.

What's mex?

Thanks,
Edwin
Comment 2 Ross Burton 2012-04-27 08:28:53 UTC
mex is Media Explorer - http://media-explorer.org/.  Whilst typically build using GLX, it's possible to build it using EGL.

Mesa is already building libegl, but virtual/egl (as used by the TI drivers IIRC) isn't a provides in Mesa anywhere.
Comment 3 Edwin Zhai 2012-05-02 07:54:12 UTC
(In reply to comment #2)
> mex is Media Explorer - http://media-explorer.org/.  Whilst typically build
> using GLX, it's possible to build it using EGL.
> 
> Mesa is already building libegl, but virtual/egl (as used by the TI drivers
> IIRC) isn't a provides in Mesa anywhere.

I find "--disable-egl" is appended to the mesa-dri(package of libegl is empty), maybe TI layers orerride it.

I'm not sure just adding following line can fix you issue:
PROVIDES = "virtual/egl"
Comment 4 Edwin Zhai 2012-05-02 08:25:53 UTC
Created attachment 498 [details]
Enable egl in mesa

Ross,
Does this patch fix your issue. Sorry, I have no environment to test mex.

Thanks,
Edwin
Comment 5 tf 2012-05-08 10:13:05 UTC
IIRC, if you turn on egl with --enable-egl you also have to add --enable-shared-glapi.

The other thing that is missing from the mesa packaging for building mex (or more precisely cogl) is the gbm library; this gets enabled with --enable-gbm and then has to be packaged.

The following bbappend is what I needed to get cogl with kms egl backend to build: https://github.com/Guacamole/meta-guacamole/blob/master/meta-guacamole/recipes-graphics/mesa/mesa-dri_7.11.bbappend.
Comment 6 Edwin Zhai 2012-05-09 01:46:52 UTC
(In reply to comment #5)
> 
> The following bbappend is what I needed to get cogl with kms egl backend to
> build:
> https://github.com/Guacamole/meta-guacamole/blob/master/meta-guacamole/
> recipes-graphics/mesa/mesa-dri_7.11.bbappend.

TF,
Thanks for your patch. Maybe you can push it into the repo for related layer? If making changes in meta/(i.e. oe-core), we need clear usage model:
* mesa-dri provides virtual/egl
* others inside meta/ also provides virtual/egl
* pushed mex into oe-core, to requires virtual/egl

oe-core is independent part, other recipes sit in different layer from different repo. 

So pushing this patch into related repo is a good choice.
Comment 7 Edwin Zhai 2012-06-21 05:56:44 UTC
Mark it as WONTFIX, because all the required changes are limited in specific layer out of yocto and oe-core.

TF already provided patch.
Comment 8 tf 2012-06-21 07:07:03 UTC
I guess the question is *why* you oe-core is building mesa with egl and dbm disabled?
Comment 9 Edwin Zhai 2012-06-25 00:57:42 UTC
(In reply to comment #8)
> I guess the question is *why* you oe-core is building mesa with egl and dbm
> disabled?

I guess oe-core is just for common usage like qemu-XXX and other common device. We can ask for turning on egl on the oe-core mailing list with patch. But adding PROVIDES = "virtual/egl" without anybody depending on it is not acceptable.(In reply to comment #8)
Comment 10 Ross Burton 2012-07-24 13:26:20 UTC
I totally disagree.

oe-core should be building all useful variations of Mesa and letting the image/layer pick the ones it needs.  If someone is using (say) Clutter on X they'll want GLX, and we're already building that.  It's equally useful to use Clutter without X using EGL instead of GLX.

oe-core shouldn't be saying that we only support Mesa+GLX, that's the *opposite* of being layer-independent.

Also Guacamole was renamed Guacamayo, so the correct URL from Tomas is now https://github.com/Guacamayo/meta-guacamayo/blob/master/meta-guacamayo/recipes-graphics/mesa/mesa-dri_7.11.bbappend.
Comment 11 Edwin Zhai 2012-07-25 00:30:45 UTC
(In reply to comment #10)
> I totally disagree.
> 
> oe-core should be building all useful variations of Mesa and letting the
> image/layer pick the ones it needs.  If someone is using (say) Clutter on X
> they'll want GLX, and we're already building that.  It's equally useful to
> use Clutter without X using EGL instead of GLX.
> 
> oe-core shouldn't be saying that we only support Mesa+GLX, that's the
> *opposite* of being layer-independent.

I don't remember I said only support Mesa+GLX. oe-core can support everything as long as it follow the general rules. For PROVIDE/REQUIRE case, we need following:
* mesa-dri provides virtual/egl
* others inside meta/ also provides virtual/egl
* pushed mex into oe-core, to requires virtual/egl.

oe-core can support everything, but it should be self-contained system. one provides egl, but nobody inside oe-core requires it, which will be challenged by  community.

Again, I'm not arguing whether need support egl, but the way how to support. Current patch based on provides/requires is not good enough, until you keep it in your layer. Maybe you can try packages or features?

Thanks,
Edwin
Comment 12 Ross Burton 2012-07-25 08:30:39 UTC
> * mesa-dri provides virtual/egl

The bbappend does this.

> * others inside meta/ also provides virtual/egl

Nothing else inside oe-core/meta/ provides EGL.

> * pushed mex into oe-core, to requires virtual/egl.

mex isn't appropriate for oe-core, it's a large application.
Comment 13 Richard Purdie 2012-07-25 08:35:12 UTC
I think it is reasonable to enable egl and gbm as long as they get packaged separately.
Comment 14 Ross Burton 2012-07-31 15:32:56 UTC
I've a branch ross/mesa in poky-contrib that does this along with plenty of other things.
Comment 15 Ross Burton 2012-08-20 22:00:45 UTC
Richard landed this in oe-core, rev: 03136ebc529dbc82f2db14055e124114da7e84b3.
Comment 16 Alexandru Palalau 2012-11-09 14:32:15 UTC
Verified on master branch, commit ID:78983e939ab17f02f8911c8b0d0e326b419856b9