Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Use mesa gl with sgx #116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrey-konovalov
Copy link
Contributor

I am not sure where the change done in mesa-gl_%.bbappend belongs to. Hence the RFC. Thanks

The SGX side is the GPU userland driver plus TI's libgbm. They both
provide the libraries and the header files. So with SGX one needs to
use mesa-gl, not mesa.

Signed-off-by: Andrey Konovalov <[email protected]>
Using mesa-gl instead of mesa as libgl and mesa provider in the SGX case
is not enough.

I also had to add the bbappend to remove libgbm and libgbm-dev from mesa-gl's
PACKAGES as mesa-gl (with gbm removed from PACKAGECONFIG) creates zero-sized
libgbm and libgbm-dev packages which confuse libgbm's do_packagedata.

Signed-off-by: Andrey Konovalov <[email protected]>
@fboudra
Copy link
Member

fboudra commented Oct 25, 2017

@ndechesne discussed today at the sync. I asked Andrey to send an RFC. The layer where it should go is still TBD.

features = d.getVar('MACHINE_FEATURES', True).split()

mali_libs = d.getVar('MALI_USERLAND_LIBARIES', True);
sgx_libs = d.getVar('SGX_USERLAND_LIBARIES', True);

if 'mali450' in features:
provider = mali_libs.split()[0]
if target == 'mesa' or target == 'libgl':
provider = "mesa"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this specific case correspond to? when would we use mesa if mali450 is in features?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mali450 driver is only binaries (libMali.so and the lib[gbm|EGL|GLES].so symlinks pointing to the former). So the process is essentially building mesa, and replacing the corresponding mesa binaries with the mali450's ones. So that the include and the pkgconfig files comes from mesa in the mali450 case.

The SGX driver comes with the relevant include and the *.pc files, and mesa-gl is the best fit there.

@@ -0,0 +1 @@
PACKAGES_remove = "${@bb.utils.contains("MACHINE_FEATURES", "sgx", "libgbm libgbm-dev", "", d)}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should fix mesa recipe instead of this hack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So producing empty libgbm and libgbm-dev instead of not building them at all is a bug in mesa - not the other's inability to handle empty packages. Then yes, fixing mesa is the most correct approach. Will try this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants