All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium
@ 2014-04-29  6:39 Carlos Rafael Giani
  2014-04-29  6:39 ` [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option Carlos Rafael Giani
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29  6:39 UTC (permalink / raw)
  To: openembedded-devel

This set of patches extends the chromium recipe to allow for EGL&GLESv2 based 2D rendering,
considerably improving performance. This also adds hardware-accelerated WebGL support.

Three new PACKAGECONFIG for chromium are introduced:

* "component-build" : If set, Chromium is built in component mode. Each subsystem of Chromium
  ends up in a separate shared object. The alternative is the regular mode, which links everything
  into one big binary. Component builds are useful for development and testing, and consumes
  significantly less RAM during building. It is essential when building Chromium on a 32-bit OS.

* "use-egl" : Ordinarily, Chromium will try to use GLX and regular (= Desktop) OpenGL for 2D
  acceleration. If that fails, software rendering is used. If use-egl is set, it will use EGL
  instead of GLX and OpenGL ES 2.0 instead of regular OpenGL. This is very useful if the
  target platform provides hardware acceleration for this API. Chromium will then render all 2D
  components as well as WebGL contents with hardware acceleration, Canvas being an exception
  (see below).

* "ignore-lost-context" : Without this flag, HTML Canvas will not be accelerated, even with the
  "use-egl" flag set. The reason for this is a conceptual problem: HTML Canvas expects the
  backing store of the canvas to persist until the web page goes away. But if the backing store
  is a GLES texture, then in theory the associated EGL context could get lost (for example, during
  a power management cycle), and the texture along with it. This violates requirements for canvas.
  So, one has to choose: either remain fully standards compliant, and have no acceleration, or
  have acceleration, and risk losing the Canvas content. Note that context losses do not happen on
  all platforms (they haven't been observed with Vivante GPUs for example, and internals of its
  galcore module do not show anything that could cause a lost context). But since these recipes
  do not depend on a specific platform, this option must be explicitely enabled.

Carlos Rafael Giani (4):
  chromium: Add component-build PACKAGECONFIG option
  chromium: Add variable to contain extra command-line arguments
  chromium: Add use-egl PACKAGECONFIG option
  chromium: Add ignore-lost-context PACKAGECONFIG option

 .../chromium/chromium/component-build.gypi         |  5 ++++
 recipes-browser/chromium/chromium/google-chrome    | 11 +++++---
 .../remove-linux-accel-canvas-from-blacklist.patch | 32 ++++++++++++++++++++++
 recipes-browser/chromium/chromium_35.0.1883.0.bb   | 25 +++++++++++++++--
 4 files changed, 67 insertions(+), 6 deletions(-)
 create mode 100644 recipes-browser/chromium/chromium/component-build.gypi
 create mode 100644 recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch

-- 
1.8.3.2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option
  2014-04-29  6:39 [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
@ 2014-04-29  6:39 ` Carlos Rafael Giani
  2014-04-29 18:25   ` Otavio Salvador
  2014-04-29  6:39 ` [meta-browser][PATCH v2 2/4] chromium: Add variable to contain extra command-line arguments Carlos Rafael Giani
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29  6:39 UTC (permalink / raw)
  To: openembedded-devel

In a component build, the individual Chromium components are contained in
separate shared objects. This is useful when building on a system with
8 GB RAM or less (since the linker needs at least that much for link
time optimization otherwise if a non-component build is done), and during
development and testing of Chromium internals.

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 recipes-browser/chromium/chromium/component-build.gypi |  5 +++++
 recipes-browser/chromium/chromium/google-chrome        |  2 ++
 recipes-browser/chromium/chromium_35.0.1883.0.bb       | 11 +++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 recipes-browser/chromium/chromium/component-build.gypi

diff --git a/recipes-browser/chromium/chromium/component-build.gypi b/recipes-browser/chromium/chromium/component-build.gypi
new file mode 100644
index 0000000..e58b4ca
--- /dev/null
+++ b/recipes-browser/chromium/chromium/component-build.gypi
@@ -0,0 +1,5 @@
+{
+  'variables': {
+     'component' : 'shared_library'
+  },
+}
diff --git a/recipes-browser/chromium/chromium/google-chrome b/recipes-browser/chromium/chromium/google-chrome
index 2f6ad2e..8ce400b 100644
--- a/recipes-browser/chromium/chromium/google-chrome
+++ b/recipes-browser/chromium/chromium/google-chrome
@@ -1,6 +1,8 @@
 #!/bin/sh
 
 export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
+export LD_LIBRARY_PATH=/usr/lib/chrome
+
 if [ "${USER}" = "root" ] ; then 
 	/usr/bin/chrome/chrome --user-data-dir=${HOME}/.chromium/ $@
 else
diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index 2497f10..203474d 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -6,6 +6,7 @@ SRC_URI = "\
         http://gsdview.appspot.com/chromium-browser-official/${P}.tar.xz \
         file://include.gypi \
         file://oe-defaults.gypi \
+        ${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'file://component-build.gypi', '', d)} \
         file://unistd-2.patch \
         file://google-chrome \
         file://google-chrome.desktop \
@@ -27,6 +28,7 @@ EXTRA_OEGYP =	" \
 	${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '', '-Dlinux_use_gold_flags=0', d)} \
 	-I ${WORKDIR}/oe-defaults.gypi \
 	-I ${WORKDIR}/include.gypi \
+	${@bb.utils.contains('PACKAGECONFIG', 'component-build', '-I ${WORKDIR}/component-build.gypi', '', d)} \
 	-f ninja \
 "
 ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
@@ -65,6 +67,11 @@ do_install() {
 	install -m 0644 ${S}/out/Release/product_logo_48.png ${D}${bindir}/chrome/
 	install -m 0755 ${S}/out/Release/libffmpegsumo.so ${D}${bindir}/chrome/
 
+	install -d ${D}${libdir}/chrome/
+	if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'component-build', '', d)}" ]; then
+		install -m 0755 ${S}/out/Release/lib/*.so ${D}${libdir}/chrome/
+	fi
+
 	install -d ${D}${sbindir}
 	install -m 4755 ${S}/out/Release/chrome_sandbox ${D}${sbindir}/chrome-devel-sandbox
 
@@ -72,8 +79,8 @@ do_install() {
 	install -m 0644 ${S}/out/Release/locales/en-US.pak ${D}${bindir}/chrome/locales
 }
 
-FILES_${PN} = "${bindir}/chrome/ ${bindir}/google-chrome ${datadir}/applications ${sbindir}/"
-FILES_${PN}-dbg += "${bindir}/chrome/.debug/"
+FILES_${PN} = "${bindir}/chrome/ ${bindir}/google-chrome ${datadir}/applications ${sbindir}/ ${libdir}/chrome/"
+FILES_${PN}-dbg += "${bindir}/chrome/.debug/ ${libdir}/chrome/.debug/"
 
 PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
 
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [meta-browser][PATCH v2 2/4] chromium: Add variable to contain extra command-line arguments
  2014-04-29  6:39 [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
  2014-04-29  6:39 ` [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option Carlos Rafael Giani
@ 2014-04-29  6:39 ` Carlos Rafael Giani
  2014-04-29  6:39 ` [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option Carlos Rafael Giani
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29  6:39 UTC (permalink / raw)
  To: openembedded-devel

With this patch it becomes possible to add extra command line options to
the "chrome" call in /usr/bin/google-chrome script .

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 recipes-browser/chromium/chromium/google-chrome  | 9 +++++----
 recipes-browser/chromium/chromium_35.0.1883.0.bb | 6 ++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/recipes-browser/chromium/chromium/google-chrome b/recipes-browser/chromium/chromium/google-chrome
index 8ce400b..78f4a29 100644
--- a/recipes-browser/chromium/chromium/google-chrome
+++ b/recipes-browser/chromium/chromium/google-chrome
@@ -3,8 +3,9 @@
 export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
 export LD_LIBRARY_PATH=/usr/lib/chrome
 
-if [ "${USER}" = "root" ] ; then 
-	/usr/bin/chrome/chrome --user-data-dir=${HOME}/.chromium/ $@
-else
-	/usr/bin/chrome/chrome $@
+CHROME_EXTRA_ARGS=""
+if [ "${USER}" = "root" ] ; then
+	CHROME_EXTRA_ARGS="${CHROME_EXTRA_ARGS} --user-data-dir=${HOME}/.chromium/"
 fi
+
+/usr/bin/chrome/chrome ${CHROME_EXTRA_ARGS} $@
diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index 203474d..1923b4e 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -33,6 +33,8 @@ EXTRA_OEGYP =	" \
 "
 ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
 
+CHROMIUM_EXTRA_ARGS ?= ""
+
 export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
 do_configure() {
 	cd ${S}
@@ -54,6 +56,10 @@ do_install() {
 	install -d ${D}${bindir}
 	install -m 0755 ${WORKDIR}/google-chrome ${D}${bindir}/
 
+	# Add extra command line arguments to google-chrome script by modifying
+	# the dummy "CHROME_EXTRA_ARGS" line
+	sed -i "s/^CHROME_EXTRA_ARGS=\"\"/CHROME_EXTRA_ARGS=\"${CHROMIUM_EXTRA_ARGS}\"/" ${D}${bindir}/google-chrome
+
 	install -d ${D}${datadir}/applications
 	install -m 0644 ${WORKDIR}/google-chrome.desktop ${D}${datadir}/applications/
 
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option
  2014-04-29  6:39 [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
  2014-04-29  6:39 ` [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option Carlos Rafael Giani
  2014-04-29  6:39 ` [meta-browser][PATCH v2 2/4] chromium: Add variable to contain extra command-line arguments Carlos Rafael Giani
@ 2014-04-29  6:39 ` Carlos Rafael Giani
  2014-04-29 18:30   ` Otavio Salvador
  2014-04-29  6:39 ` [meta-browser][PATCH v2 4/4] chromium: Add ignore-lost-context " Carlos Rafael Giani
  2014-04-29 18:31 ` [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Otavio Salvador
  4 siblings, 1 reply; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29  6:39 UTC (permalink / raw)
  To: openembedded-devel

By default, Chromium will try to use GLX and regular OpenGL. On embedded
platforms, these are often not present, or unaccelerated, and using EGL
and OpenGL ES instead makes more sense. To produce builds that use EGL and
OpenGL ES by default instead, this PACKAGECONFIG option can be used.

An EGL/OpenGLES-enabled build produces a chromium version that renders
2D and WebGL with GPU acceleration (if present).

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 recipes-browser/chromium/chromium_35.0.1883.0.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index 1923b4e..1fb050f 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -23,6 +23,10 @@ COMPATIBLE_MACHINE_armv7a = "(.*)"
 
 inherit gettext
 
+# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
+# automatically and silently fall back to GLX
+PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"
+
 EXTRA_OEGYP =	" \
 	${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '', '-Dlinux_use_gold_binary=0', d)} \
 	${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '', '-Dlinux_use_gold_flags=0', d)} \
@@ -33,7 +37,9 @@ EXTRA_OEGYP =	" \
 "
 ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
 
-CHROMIUM_EXTRA_ARGS ?= ""
+CHROMIUM_EXTRA_ARGS ?= " \
+	${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
+"
 
 export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
 do_configure() {
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [meta-browser][PATCH v2 4/4] chromium: Add ignore-lost-context PACKAGECONFIG option
  2014-04-29  6:39 [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
                   ` (2 preceding siblings ...)
  2014-04-29  6:39 ` [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option Carlos Rafael Giani
@ 2014-04-29  6:39 ` Carlos Rafael Giani
  2014-04-29 18:31 ` [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Otavio Salvador
  4 siblings, 0 replies; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29  6:39 UTC (permalink / raw)
  To: openembedded-devel

Accelerating the HTML5 canvas element rendering with OpenGL ES is tricky,
because an EGL context can get lost with some drivers. Since pages using
canvas assume they can paint into the canvas and the pixels inside will
never vanish, this is a problem. Workarounds like periodic snapshots are
being considered. The WHATWG discussion about this problem can be found at:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-September/206450.html

Until then, one has to choose: either no acceleration and full standards
compliance, or acceleration and potentially lost pixels.

Using this PACKAGECONFIG chooses the second option.

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 .../remove-linux-accel-canvas-from-blacklist.patch | 32 ++++++++++++++++++++++
 recipes-browser/chromium/chromium_35.0.1883.0.bb   |  2 ++
 2 files changed, 34 insertions(+)
 create mode 100644 recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch

diff --git a/recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch b/recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch
new file mode 100644
index 0000000..635e563
--- /dev/null
+++ b/recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch
@@ -0,0 +1,32 @@
+Together with the --gpu-no-context-lost command line switch, this patch is
+necessary to enable hardware accelerated 2D canvas rendering when using
+EGL.
+
+Note the implications on the behavior of Canvas, in particular with lost
+contexts, as discussed here:
+
+http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-September/206450.html
+
+Upstream-Status: Inappropiate [see link above]
+
+diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
+index 35060a9..4bd6ef5 100644
+--- a/gpu/config/software_rendering_list_json.cc
++++ b/gpu/config/software_rendering_list_json.cc
+@@ -232,16 +232,6 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
+       ]
+     },
+     {
+-      "id": 24,
+-      "description": "Accelerated 2d canvas is unstable in Linux at the moment",
+-      "os": {
+-        "type": "linux"
+-      },
+-      "features": [
+-        "accelerated_2d_canvas"
+-      ]
+-    },
+-    {
+       "id": 27,
+       "description": "ATI/AMD cards with older drivers in Linux are crash-prone",
+       "cr_bugs": [95934, 94973, 136240],
diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index 1fb050f..e895223 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -7,6 +7,7 @@ SRC_URI = "\
         file://include.gypi \
         file://oe-defaults.gypi \
         ${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'file://component-build.gypi', '', d)} \
+        ${@bb.utils.contains('PACKAGECONFIG', 'ignore-lost-context', 'file://remove-linux-accel-canvas-from-blacklist.patch', '', d)} \
         file://unistd-2.patch \
         file://google-chrome \
         file://google-chrome.desktop \
@@ -39,6 +40,7 @@ ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard',
 
 CHROMIUM_EXTRA_ARGS ?= " \
 	${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
+	${@bb.utils.contains('PACKAGECONFIG', 'ignore-lost-context', '--gpu-no-context-lost', '', d)} \
 "
 
 export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option
  2014-04-29  6:39 ` [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option Carlos Rafael Giani
@ 2014-04-29 18:25   ` Otavio Salvador
  2014-04-29 19:07     ` Carlos Rafael Giani
  0 siblings, 1 reply; 11+ messages in thread
From: Otavio Salvador @ 2014-04-29 18:25 UTC (permalink / raw)
  To: OpenEmbedded Devel List

On Tue, Apr 29, 2014 at 3:39 AM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> In a component build, the individual Chromium components are contained in
> separate shared objects. This is useful when building on a system with
> 8 GB RAM or less (since the linker needs at least that much for link
> time optimization otherwise if a non-component build is done), and during
> development and testing of Chromium internals.
>
> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
> ---
>  recipes-browser/chromium/chromium/component-build.gypi |  5 +++++
>  recipes-browser/chromium/chromium/google-chrome        |  2 ++
>  recipes-browser/chromium/chromium_35.0.1883.0.bb       | 11 +++++++++--
>  3 files changed, 16 insertions(+), 2 deletions(-)
>  create mode 100644 recipes-browser/chromium/chromium/component-build.gypi
>
> diff --git a/recipes-browser/chromium/chromium/component-build.gypi b/recipes-browser/chromium/chromium/component-build.gypi
> new file mode 100644
> index 0000000..e58b4ca
> --- /dev/null
> +++ b/recipes-browser/chromium/chromium/component-build.gypi
> @@ -0,0 +1,5 @@
> +{
> +  'variables': {
> +     'component' : 'shared_library'
> +  },
> +}
> diff --git a/recipes-browser/chromium/chromium/google-chrome b/recipes-browser/chromium/chromium/google-chrome
> index 2f6ad2e..8ce400b 100644
> --- a/recipes-browser/chromium/chromium/google-chrome
> +++ b/recipes-browser/chromium/chromium/google-chrome
> @@ -1,6 +1,8 @@
>  #!/bin/sh
>
>  export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
> +export LD_LIBRARY_PATH=/usr/lib/chrome
> +
>  if [ "${USER}" = "root" ] ; then
>         /usr/bin/chrome/chrome --user-data-dir=${HOME}/.chromium/ $@
>  else
> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> index 2497f10..203474d 100644
> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> @@ -6,6 +6,7 @@ SRC_URI = "\
>          http://gsdview.appspot.com/chromium-browser-official/${P}.tar.xz \
>          file://include.gypi \
>          file://oe-defaults.gypi \
> +        ${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'file://component-build.gypi', '', d)} \
>          file://unistd-2.patch \
>          file://google-chrome \
>          file://google-chrome.desktop \
> @@ -27,6 +28,7 @@ EXTRA_OEGYP = " \
>         ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '', '-Dlinux_use_gold_flags=0', d)} \
>         -I ${WORKDIR}/oe-defaults.gypi \
>         -I ${WORKDIR}/include.gypi \
> +       ${@bb.utils.contains('PACKAGECONFIG', 'component-build', '-I ${WORKDIR}/component-build.gypi', '', d)} \
>         -f ninja \
>  "
>  ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
> @@ -65,6 +67,11 @@ do_install() {
>         install -m 0644 ${S}/out/Release/product_logo_48.png ${D}${bindir}/chrome/
>         install -m 0755 ${S}/out/Release/libffmpegsumo.so ${D}${bindir}/chrome/
>
> +       install -d ${D}${libdir}/chrome/

This ought to b done inside of the 'if' block.

> +       if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'component-build', '', d)}" ]; then
> +               install -m 0755 ${S}/out/Release/lib/*.so ${D}${libdir}/chrome/
> +       fi
> +
>         install -d ${D}${sbindir}
>         install -m 4755 ${S}/out/Release/chrome_sandbox ${D}${sbindir}/chrome-devel-sandbox
>
> @@ -72,8 +79,8 @@ do_install() {
>         install -m 0644 ${S}/out/Release/locales/en-US.pak ${D}${bindir}/chrome/locales
>  }
>
> -FILES_${PN} = "${bindir}/chrome/ ${bindir}/google-chrome ${datadir}/applications ${sbindir}/"
> -FILES_${PN}-dbg += "${bindir}/chrome/.debug/"
> +FILES_${PN} = "${bindir}/chrome/ ${bindir}/google-chrome ${datadir}/applications ${sbindir}/ ${libdir}/chrome/"
> +FILES_${PN}-dbg += "${bindir}/chrome/.debug/ ${libdir}/chrome/.debug/"
>
>  PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
>
> --
> 1.8.3.2
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel



-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option
  2014-04-29  6:39 ` [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option Carlos Rafael Giani
@ 2014-04-29 18:30   ` Otavio Salvador
  2014-04-29 19:53     ` Carlos Rafael Giani
  0 siblings, 1 reply; 11+ messages in thread
From: Otavio Salvador @ 2014-04-29 18:30 UTC (permalink / raw)
  To: OpenEmbedded Devel List

On Tue, Apr 29, 2014 at 3:39 AM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> By default, Chromium will try to use GLX and regular OpenGL. On embedded
> platforms, these are often not present, or unaccelerated, and using EGL
> and OpenGL ES instead makes more sense. To produce builds that use EGL and
> OpenGL ES by default instead, this PACKAGECONFIG option can be used.
>
> An EGL/OpenGLES-enabled build produces a chromium version that renders
> 2D and WebGL with GPU acceleration (if present).
>
> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
> ---
>  recipes-browser/chromium/chromium_35.0.1883.0.bb | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> index 1923b4e..1fb050f 100644
> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> @@ -23,6 +23,10 @@ COMPATIBLE_MACHINE_armv7a = "(.*)"
>
>  inherit gettext
>
> +# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
> +# automatically and silently fall back to GLX
> +PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"

There is any way to 'force' build to use egl here and fail if
something here is missing?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium
  2014-04-29  6:39 [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
                   ` (3 preceding siblings ...)
  2014-04-29  6:39 ` [meta-browser][PATCH v2 4/4] chromium: Add ignore-lost-context " Carlos Rafael Giani
@ 2014-04-29 18:31 ` Otavio Salvador
  4 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2014-04-29 18:31 UTC (permalink / raw)
  To: OpenEmbedded Devel List

Hello Carlos,

On Tue, Apr 29, 2014 at 3:39 AM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> This set of patches extends the chromium recipe to allow for EGL&GLESv2 based 2D rendering,
> considerably improving performance. This also adds hardware-accelerated WebGL support.

Commented in the specific patches with issues/questions.


-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option
  2014-04-29 18:25   ` Otavio Salvador
@ 2014-04-29 19:07     ` Carlos Rafael Giani
  2014-04-29 19:10       ` Otavio Salvador
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29 19:07 UTC (permalink / raw)
  To: openembedded-devel

On 2014-04-29 20:25, Otavio Salvador wrote:
> On Tue, Apr 29, 2014 at 3:39 AM, Carlos Rafael Giani
> <dv@pseudoterminal.org> wrote:
>> In a component build, the individual Chromium components are contained in
>> separate shared objects. This is useful when building on a system with
>> 8 GB RAM or less (since the linker needs at least that much for link
>> time optimization otherwise if a non-component build is done), and during
>> development and testing of Chromium internals.
>>
>> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
>> ---
>>   recipes-browser/chromium/chromium/component-build.gypi |  5 +++++
>>   recipes-browser/chromium/chromium/google-chrome        |  2 ++
>>   recipes-browser/chromium/chromium_35.0.1883.0.bb       | 11 +++++++++--
>>   3 files changed, 16 insertions(+), 2 deletions(-)
>>   create mode 100644 recipes-browser/chromium/chromium/component-build.gypi
>>
>> diff --git a/recipes-browser/chromium/chromium/component-build.gypi b/recipes-browser/chromium/chromium/component-build.gypi
>> new file mode 100644
>> index 0000000..e58b4ca
>> --- /dev/null
>> +++ b/recipes-browser/chromium/chromium/component-build.gypi
>> @@ -0,0 +1,5 @@
>> +{
>> +  'variables': {
>> +     'component' : 'shared_library'
>> +  },
>> +}
>> diff --git a/recipes-browser/chromium/chromium/google-chrome b/recipes-browser/chromium/chromium/google-chrome
>> index 2f6ad2e..8ce400b 100644
>> --- a/recipes-browser/chromium/chromium/google-chrome
>> +++ b/recipes-browser/chromium/chromium/google-chrome
>> @@ -1,6 +1,8 @@
>>   #!/bin/sh
>>
>>   export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
>> +export LD_LIBRARY_PATH=/usr/lib/chrome
>> +
>>   if [ "${USER}" = "root" ] ; then
>>          /usr/bin/chrome/chrome --user-data-dir=${HOME}/.chromium/ $@
>>   else
>> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
>> index 2497f10..203474d 100644
>> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
>> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
>> @@ -6,6 +6,7 @@ SRC_URI = "\
>>           http://gsdview.appspot.com/chromium-browser-official/${P}.tar.xz \
>>           file://include.gypi \
>>           file://oe-defaults.gypi \
>> +        ${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'file://component-build.gypi', '', d)} \
>>           file://unistd-2.patch \
>>           file://google-chrome \
>>           file://google-chrome.desktop \
>> @@ -27,6 +28,7 @@ EXTRA_OEGYP = " \
>>          ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '', '-Dlinux_use_gold_flags=0', d)} \
>>          -I ${WORKDIR}/oe-defaults.gypi \
>>          -I ${WORKDIR}/include.gypi \
>> +       ${@bb.utils.contains('PACKAGECONFIG', 'component-build', '-I ${WORKDIR}/component-build.gypi', '', d)} \
>>          -f ninja \
>>   "
>>   ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
>> @@ -65,6 +67,11 @@ do_install() {
>>          install -m 0644 ${S}/out/Release/product_logo_48.png ${D}${bindir}/chrome/
>>          install -m 0755 ${S}/out/Release/libffmpegsumo.so ${D}${bindir}/chrome/
>>
>> +       install -d ${D}${libdir}/chrome/
> This ought to b done inside of the 'if' block.


I am not sure about this, because the export 
LD_LIBRARY_PATH=/usr/lib/chrome line is also introduced. What would be 
preferred? Set LD_LIBRARY_PATH to a potentially nonexisting path or 
always create /usr/lib/chrome ?
I could also do a trick similar to the one for the chromium args, but I 
doubt more library paths will ever be added.

>
>> +       if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'component-build', '', d)}" ]; then
>> +               install -m 0755 ${S}/out/Release/lib/*.so ${D}${libdir}/chrome/
>> +       fi
>> +
>>          install -d ${D}${sbindir}
>>          install -m 4755 ${S}/out/Release/chrome_sandbox ${D}${sbindir}/chrome-devel-sandbox
>>
>> @@ -72,8 +79,8 @@ do_install() {
>>          install -m 0644 ${S}/out/Release/locales/en-US.pak ${D}${bindir}/chrome/locales
>>   }
>>
>> -FILES_${PN} = "${bindir}/chrome/ ${bindir}/google-chrome ${datadir}/applications ${sbindir}/"
>> -FILES_${PN}-dbg += "${bindir}/chrome/.debug/"
>> +FILES_${PN} = "${bindir}/chrome/ ${bindir}/google-chrome ${datadir}/applications ${sbindir}/ ${libdir}/chrome/"
>> +FILES_${PN}-dbg += "${bindir}/chrome/.debug/ ${libdir}/chrome/.debug/"
>>
>>   PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
>>
>> --
>> 1.8.3.2
>>
>> --
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option
  2014-04-29 19:07     ` Carlos Rafael Giani
@ 2014-04-29 19:10       ` Otavio Salvador
  0 siblings, 0 replies; 11+ messages in thread
From: Otavio Salvador @ 2014-04-29 19:10 UTC (permalink / raw)
  To: OpenEmbedded Devel List

On Tue, Apr 29, 2014 at 4:07 PM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> On 2014-04-29 20:25, Otavio Salvador wrote:
>>
>> On Tue, Apr 29, 2014 at 3:39 AM, Carlos Rafael Giani
>> <dv@pseudoterminal.org> wrote:
>>>
>>> In a component build, the individual Chromium components are contained in
>>> separate shared objects. This is useful when building on a system with
>>> 8 GB RAM or less (since the linker needs at least that much for link
>>> time optimization otherwise if a non-component build is done), and during
>>> development and testing of Chromium internals.
>>>
>>> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
>>> ---
>>>   recipes-browser/chromium/chromium/component-build.gypi |  5 +++++
>>>   recipes-browser/chromium/chromium/google-chrome        |  2 ++
>>>   recipes-browser/chromium/chromium_35.0.1883.0.bb       | 11 +++++++++--
>>>   3 files changed, 16 insertions(+), 2 deletions(-)
>>>   create mode 100644
>>> recipes-browser/chromium/chromium/component-build.gypi
>>>
>>> diff --git a/recipes-browser/chromium/chromium/component-build.gypi
>>> b/recipes-browser/chromium/chromium/component-build.gypi
>>> new file mode 100644
>>> index 0000000..e58b4ca
>>> --- /dev/null
>>> +++ b/recipes-browser/chromium/chromium/component-build.gypi
>>> @@ -0,0 +1,5 @@
>>> +{
>>> +  'variables': {
>>> +     'component' : 'shared_library'
>>> +  },
>>> +}
>>> diff --git a/recipes-browser/chromium/chromium/google-chrome
>>> b/recipes-browser/chromium/chromium/google-chrome
>>> index 2f6ad2e..8ce400b 100644
>>> --- a/recipes-browser/chromium/chromium/google-chrome
>>> +++ b/recipes-browser/chromium/chromium/google-chrome
>>> @@ -1,6 +1,8 @@
>>>   #!/bin/sh
>>>
>>>   export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
>>> +export LD_LIBRARY_PATH=/usr/lib/chrome
>>> +
>>>   if [ "${USER}" = "root" ] ; then
>>>          /usr/bin/chrome/chrome --user-data-dir=${HOME}/.chromium/ $@
>>>   else
>>> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb
>>> b/recipes-browser/chromium/chromium_35.0.1883.0.bb
>>> index 2497f10..203474d 100644
>>> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
>>> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
>>> @@ -6,6 +6,7 @@ SRC_URI = "\
>>>
>>> http://gsdview.appspot.com/chromium-browser-official/${P}.tar.xz \
>>>           file://include.gypi \
>>>           file://oe-defaults.gypi \
>>> +        ${@bb.utils.contains('PACKAGECONFIG', 'component-build',
>>> 'file://component-build.gypi', '', d)} \
>>>           file://unistd-2.patch \
>>>           file://google-chrome \
>>>           file://google-chrome.desktop \
>>> @@ -27,6 +28,7 @@ EXTRA_OEGYP = " \
>>>          ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '',
>>> '-Dlinux_use_gold_flags=0', d)} \
>>>          -I ${WORKDIR}/oe-defaults.gypi \
>>>          -I ${WORKDIR}/include.gypi \
>>> +       ${@bb.utils.contains('PACKAGECONFIG', 'component-build', '-I
>>> ${WORKDIR}/component-build.gypi', '', d)} \
>>>          -f ninja \
>>>   "
>>>   ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES',
>>> 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
>>> @@ -65,6 +67,11 @@ do_install() {
>>>          install -m 0644 ${S}/out/Release/product_logo_48.png
>>> ${D}${bindir}/chrome/
>>>          install -m 0755 ${S}/out/Release/libffmpegsumo.so
>>> ${D}${bindir}/chrome/
>>>
>>> +       install -d ${D}${libdir}/chrome/
>>
>> This ought to b done inside of the 'if' block.
>
>
>
> I am not sure about this, because the export LD_LIBRARY_PATH=/usr/lib/chrome
> line is also introduced. What would be preferred? Set LD_LIBRARY_PATH to a
> potentially nonexisting path or always create /usr/lib/chrome ?
> I could also do a trick similar to the one for the chromium args, but I
> doubt more library paths will ever be added.

I see your point.

Ok so keep it as is now but please add a comment there.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option
  2014-04-29 18:30   ` Otavio Salvador
@ 2014-04-29 19:53     ` Carlos Rafael Giani
  0 siblings, 0 replies; 11+ messages in thread
From: Carlos Rafael Giani @ 2014-04-29 19:53 UTC (permalink / raw)
  To: openembedded-devel

On 2014-04-29 20:30, Otavio Salvador wrote:
> On Tue, Apr 29, 2014 at 3:39 AM, Carlos Rafael Giani
> <dv@pseudoterminal.org> wrote:
>> By default, Chromium will try to use GLX and regular OpenGL. On embedded
>> platforms, these are often not present, or unaccelerated, and using EGL
>> and OpenGL ES instead makes more sense. To produce builds that use EGL and
>> OpenGL ES by default instead, this PACKAGECONFIG option can be used.
>>
>> An EGL/OpenGLES-enabled build produces a chromium version that renders
>> 2D and WebGL with GPU acceleration (if present).
>>
>> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
>> ---
>>   recipes-browser/chromium/chromium_35.0.1883.0.bb | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
>> index 1923b4e..1fb050f 100644
>> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
>> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
>> @@ -23,6 +23,10 @@ COMPATIBLE_MACHINE_armv7a = "(.*)"
>>
>>   inherit gettext
>>
>> +# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
>> +# automatically and silently fall back to GLX
>> +PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"
> There is any way to 'force' build to use egl here and fail if
> something here is missing?
>

That is actually tough. Chromium does not simply link to the EGL and 
GLESv2 libraries; it opens them with dlopen() and gets the GL function 
pointers with dlsym() , as part of the sandboxing strategy. Furthermore, 
cairo requires virtual/egl too (not virtual/libgles2 though). As for 
compilation errors, I haven't found a way to provoke them. I am not 
entirely sure if Chromium is using system EGL/GLES headers, or if it is 
always using its internal copy of the Khronos headers instead. I got 
conflicting responses. So, to be sure (and also to emphasize the 
dependency in the recipe), I added it.

What is certain is that without the --use-gl=egl switch, Chromium will 
always use GLX.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-29 19:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  6:39 [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
2014-04-29  6:39 ` [meta-browser][PATCH v2 1/4] chromium: Add component-build PACKAGECONFIG option Carlos Rafael Giani
2014-04-29 18:25   ` Otavio Salvador
2014-04-29 19:07     ` Carlos Rafael Giani
2014-04-29 19:10       ` Otavio Salvador
2014-04-29  6:39 ` [meta-browser][PATCH v2 2/4] chromium: Add variable to contain extra command-line arguments Carlos Rafael Giani
2014-04-29  6:39 ` [meta-browser][PATCH v2 3/4] chromium: Add use-egl PACKAGECONFIG option Carlos Rafael Giani
2014-04-29 18:30   ` Otavio Salvador
2014-04-29 19:53     ` Carlos Rafael Giani
2014-04-29  6:39 ` [meta-browser][PATCH v2 4/4] chromium: Add ignore-lost-context " Carlos Rafael Giani
2014-04-29 18:31 ` [meta-browser][PATCH v2 0/4] Introduce EGL/GLES and component build patches for Chromium Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.