Patchwork [3/3] Prepare mesa-dri for weston compatibility

login
register
mail settings
Submitter Alexandru DAMIAN
Date Dec. 20, 2012, 4:48 p.m.
Message ID <5f9c3b67176f90714a2fd394e64f7d8da3cb0258.1356021837.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/41421/
State New
Headers show

Comments

Alexandru DAMIAN - Dec. 20, 2012, 4:48 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

This patch enables mesa-git to build wayland-compatible
packages for usage with weston.

It adds wayland platform support, packs the wayland-egl
files, and sets the -git version as preffered provider.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 meta/recipes-graphics/mesa/mesa-common.inc |    5 ++++-
 meta/recipes-graphics/mesa/mesa-dri.inc    |    1 +
 meta/recipes-graphics/mesa/mesa-dri_git.bb |    3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)
Martin Jansa - Dec. 20, 2012, 5:17 p.m.
On Thu, Dec 20, 2012 at 06:48:38PM +0200, Alex DAMIAN wrote:
> From: Alexandru DAMIAN <alexandru.damian@intel.com>
> 
> This patch enables mesa-git to build wayland-compatible
> packages for usage with weston.
> 
> It adds wayland platform support, packs the wayland-egl
> files, and sets the -git version as preffered provider.
> 
> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> ---
>  meta/recipes-graphics/mesa/mesa-common.inc |    5 ++++-
>  meta/recipes-graphics/mesa/mesa-dri.inc    |    1 +
>  meta/recipes-graphics/mesa/mesa-dri_git.bb |    3 ++-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-graphics/mesa/mesa-common.inc b/meta/recipes-graphics/mesa/mesa-common.inc
> index 70957eb..db1bec4 100644
> --- a/meta/recipes-graphics/mesa/mesa-common.inc
> +++ b/meta/recipes-graphics/mesa/mesa-common.inc
> @@ -18,7 +18,7 @@ PE = "2"
>  DEPENDS = "libxml2-native makedepend-native flex-native bison-native"
>  
>  PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
> -
> +PROVIDES += "wayland-egl libgbm libglapi"
>  # for mesa-dri and mesa-xlib
>  FILESEXTRAPATHS_append := "${THISDIR}/mesa:"
>  
> @@ -49,6 +49,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
>               libgles1-mesa libgles1-mesa-dev \
>               libgles2-mesa libgles2-mesa-dev \
>               libgles3-mesa libgles3-mesa-dev \
> +             wayland-egl wayland-egl-dev \
>              "
>  
>  do_install_append () {
> @@ -90,8 +91,10 @@ FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
>  FILES_libgl-mesa = "${libdir}/libGL.so.*"
>  FILES_libglapi = "${libdir}/libglapi.so.*"
>  FILES_libosmesa = "${libdir}/libOSMesa.so.*"
> +FILES_wayland-egl = "${libdir}/libwayland-egl.so.*"
>  
>  FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
> +FILES_wayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
>  FILES_libdricore-dev = "${libdir}/libdricore*.*"
>  FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
>  FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
> diff --git a/meta/recipes-graphics/mesa/mesa-dri.inc b/meta/recipes-graphics/mesa/mesa-dri.inc
> index 07544ab..1f6ec78 100644
> --- a/meta/recipes-graphics/mesa/mesa-dri.inc
> +++ b/meta/recipes-graphics/mesa/mesa-dri.inc
> @@ -13,6 +13,7 @@ PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-
>  
>  EGL_PLATFORMS  = "drm"
>  EGL_PLATFORMS .="${@base_contains('DISTRO_FEATURES', 'x11', ',x11', '', d)}"
> +EGL_PLATFORMS .="${@base_contains('DISTRO_FEATURES', 'wayland', ',wayland', '', d)}"
>  PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
>  
>  python populate_packages_prepend() {
> diff --git a/meta/recipes-graphics/mesa/mesa-dri_git.bb b/meta/recipes-graphics/mesa/mesa-dri_git.bb
> index 69a433e..7fd0d39 100644
> --- a/meta/recipes-graphics/mesa/mesa-dri_git.bb
> +++ b/meta/recipes-graphics/mesa/mesa-dri_git.bb
> @@ -3,6 +3,7 @@ require mesa-git.inc
>  require mesa-dri.inc
>  
>  # this needs to be lower than -1 because all mesa-dri have -1 and git version has highest PV, but shouldn't be default
> -DEFAULT_PREFERENCE = "-2"
> +# adamian - switch to git version
> +DEFAULT_PREFERENCE = "1"

Isn't default preference 0 good enough? as meta-dri_git also has highest
PV?

>  
>  PR = "${INC_PR}.0"
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Ross Burton - Dec. 20, 2012, 5:20 p.m.
On 20 December 2012 16:48, Alex DAMIAN <alexandru.damian@intel.com> wrote:
> +PROVIDES += "wayland-egl libgbm libglapi"

Remove this.

>  # this needs to be lower than -1 because all mesa-dri have -1 and git version has highest PV, but shouldn't be default
> -DEFAULT_PREFERENCE = "-2"
> +# adamian - switch to git version
> +DEFAULT_PREFERENCE = "1"

Please don't touch this, we can document at the moment that people
need to use mesa-dri-git until the tarball is sufficient (9.0.2 should
work).

I also don't see anything that adds a build-dependency on wayland for
the Wayland EGL backend to build successfully.

Ross
Alexandru DAMIAN - Dec. 21, 2012, 10:10 a.m.
On Thu, Dec 20, 2012 at 7:20 PM, Burton, Ross <ross.burton@intel.com> wrote:

> On 20 December 2012 16:48, Alex DAMIAN <alexandru.damian@intel.com> wrote:
> > +PROVIDES += "wayland-egl libgbm libglapi"
>
> Remove this.


Mesa-dri provides these packages, why shouldn't we let the system know ?


> >  # this needs to be lower than -1 because all mesa-dri have -1 and git
> version has highest PV, but shouldn't be default
> > -DEFAULT_PREFERENCE = "-2"
> > +# adamian - switch to git version
> > +DEFAULT_PREFERENCE = "1"
>
> Please don't touch this, we can document at the moment that people
> need to use mesa-dri-git until the tarball is sufficient (9.0.2 should
> work).
>
> Is there any way to prevent weston being built based on mesa-dri version ?


> I also don't see anything that adds a build-dependency on wayland for
> the Wayland EGL backend to build successfully.
>

It fails gracefully if wayland isn't selected.

Alex


>
> Ross
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
Ross Burton - Dec. 21, 2012, 10:53 a.m.
On 21 December 2012 10:10, Damian, Alexandru <alexandru.damian@intel.com> wrote:
> Mesa-dri provides these packages, why shouldn't we let the system know ?

Because build-time dependencies are expressed as source packages, not
binary packages.  If you add them to mesa-dri then you'll have to
follow it up with a patch for every recipe that builds more than just
${PN}.

> Is there any way to prevent weston being built based on mesa-dri version ?

I don't see any reason to bother with that at the moment - we'll soon
have mesa 9.0.2 in oe-core so there won't be any problem.

>> I also don't see anything that adds a build-dependency on wayland for
>> the Wayland EGL backend to build successfully.
>
> It fails gracefully if wayland isn't selected.

mesa-dri needs wayland headers for the wayland backend to build, but
there isn't anything pulling in wayland if you enable the distro
feature.

All you need is:

+PACKAGECONFIG ??= "...
+                   ${@base_contains('DISTRO_FEATURES', 'wayland',
'wayland', '', d)} \
+                  "
+
+PACKAGECONFIG[wayland] = ",,wayland"

Ross

Patch

diff --git a/meta/recipes-graphics/mesa/mesa-common.inc b/meta/recipes-graphics/mesa/mesa-common.inc
index 70957eb..db1bec4 100644
--- a/meta/recipes-graphics/mesa/mesa-common.inc
+++ b/meta/recipes-graphics/mesa/mesa-common.inc
@@ -18,7 +18,7 @@  PE = "2"
 DEPENDS = "libxml2-native makedepend-native flex-native bison-native"
 
 PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
-
+PROVIDES += "wayland-egl libgbm libglapi"
 # for mesa-dri and mesa-xlib
 FILESEXTRAPATHS_append := "${THISDIR}/mesa:"
 
@@ -49,6 +49,7 @@  PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libgles1-mesa libgles1-mesa-dev \
              libgles2-mesa libgles2-mesa-dev \
              libgles3-mesa libgles3-mesa-dev \
+             wayland-egl wayland-egl-dev \
             "
 
 do_install_append () {
@@ -90,8 +91,10 @@  FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
 FILES_libgl-mesa = "${libdir}/libGL.so.*"
 FILES_libglapi = "${libdir}/libglapi.so.*"
 FILES_libosmesa = "${libdir}/libOSMesa.so.*"
+FILES_wayland-egl = "${libdir}/libwayland-egl.so.*"
 
 FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
+FILES_wayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
 FILES_libdricore-dev = "${libdir}/libdricore*.*"
 FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
 FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
diff --git a/meta/recipes-graphics/mesa/mesa-dri.inc b/meta/recipes-graphics/mesa/mesa-dri.inc
index 07544ab..1f6ec78 100644
--- a/meta/recipes-graphics/mesa/mesa-dri.inc
+++ b/meta/recipes-graphics/mesa/mesa-dri.inc
@@ -13,6 +13,7 @@  PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-
 
 EGL_PLATFORMS  = "drm"
 EGL_PLATFORMS .="${@base_contains('DISTRO_FEATURES', 'x11', ',x11', '', d)}"
+EGL_PLATFORMS .="${@base_contains('DISTRO_FEATURES', 'wayland', ',wayland', '', d)}"
 PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
 
 python populate_packages_prepend() {
diff --git a/meta/recipes-graphics/mesa/mesa-dri_git.bb b/meta/recipes-graphics/mesa/mesa-dri_git.bb
index 69a433e..7fd0d39 100644
--- a/meta/recipes-graphics/mesa/mesa-dri_git.bb
+++ b/meta/recipes-graphics/mesa/mesa-dri_git.bb
@@ -3,6 +3,7 @@  require mesa-git.inc
 require mesa-dri.inc
 
 # this needs to be lower than -1 because all mesa-dri have -1 and git version has highest PV, but shouldn't be default
-DEFAULT_PREFERENCE = "-2"
+# adamian - switch to git version
+DEFAULT_PREFERENCE = "1"
 
 PR = "${INC_PR}.0"