All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium
@ 2014-04-27 11:21 Carlos Rafael Giani
  2014-04-27 11:21 ` [meta-browser][PATCH 1/4] Add component-build PACKAGECONFIG option Carlos Rafael Giani
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Carlos Rafael Giani @ 2014-04-27 11:21 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):
  Add component-build PACKAGECONFIG option
  Add variable to contain extra command-line arguments
  Add use-egl PACKAGECONFIG to let chromium use EGL automatically
  Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts

 .../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   | 27 ++++++++++++++++--
 4 files changed, 69 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] 9+ messages in thread

* [meta-browser][PATCH 1/4] Add component-build PACKAGECONFIG option
  2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
@ 2014-04-27 11:21 ` Carlos Rafael Giani
  2014-04-27 11:21 ` [meta-browser][PATCH 2/4] Add variable to contain extra command-line arguments Carlos Rafael Giani
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Carlos Rafael Giani @ 2014-04-27 11:21 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] 9+ messages in thread

* [meta-browser][PATCH 2/4] Add variable to contain extra command-line arguments
  2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
  2014-04-27 11:21 ` [meta-browser][PATCH 1/4] Add component-build PACKAGECONFIG option Carlos Rafael Giani
@ 2014-04-27 11:21 ` Carlos Rafael Giani
  2014-04-28 15:17   ` Otavio Salvador
  2014-04-27 11:21 ` [meta-browser][PATCH 3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically Carlos Rafael Giani
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Carlos Rafael Giani @ 2014-04-27 11:21 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 | 7 +++++++
 2 files changed, 12 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..080282b 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -33,6 +33,9 @@ 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 +57,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] 9+ messages in thread

* [meta-browser][PATCH 3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically
  2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
  2014-04-27 11:21 ` [meta-browser][PATCH 1/4] Add component-build PACKAGECONFIG option Carlos Rafael Giani
  2014-04-27 11:21 ` [meta-browser][PATCH 2/4] Add variable to contain extra command-line arguments Carlos Rafael Giani
@ 2014-04-27 11:21 ` Carlos Rafael Giani
  2014-04-28 15:14   ` Otavio Salvador
  2014-04-27 11:21 ` [meta-browser][PATCH 4/4] Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts Carlos Rafael Giani
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Carlos Rafael Giani @ 2014-04-27 11:21 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 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index 080282b..d0495d8 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -34,8 +34,15 @@ EXTRA_OEGYP =	" \
 ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
 
 CHROMIUM_EXTRA_ARGS = " \
+	${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
 "
 
+python __anonymous() {
+    pkgconfig = d.getVar('PACKAGECONFIG', True)
+    if 'use-egl' in pkgconfig.split():
+        d.appendVar("DEPENDS", " virtual/egl virtual/libgles2")
+}
+
 export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
 do_configure() {
 	cd ${S}
-- 
1.8.3.2



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

* [meta-browser][PATCH 4/4] Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts
  2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
                   ` (2 preceding siblings ...)
  2014-04-27 11:21 ` [meta-browser][PATCH 3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically Carlos Rafael Giani
@ 2014-04-27 11:21 ` Carlos Rafael Giani
  2014-04-28  3:01 ` [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Martin Jansa
  2014-04-28  4:05 ` Martin Jansa
  5 siblings, 0 replies; 9+ messages in thread
From: Carlos Rafael Giani @ 2014-04-27 11:21 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 d0495d8..c7901fc 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 \
@@ -35,6 +36,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)} \
 "
 
 python __anonymous() {
-- 
1.8.3.2



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

* Re: [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium
  2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
                   ` (3 preceding siblings ...)
  2014-04-27 11:21 ` [meta-browser][PATCH 4/4] Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts Carlos Rafael Giani
@ 2014-04-28  3:01 ` Martin Jansa
  2014-04-28  4:05 ` Martin Jansa
  5 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2014-04-28  3:01 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 3357 bytes --]

On Sun, Apr 27, 2014 at 01:21:47PM +0200, Carlos Rafael Giani 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.

All 4 commit messages should start with chromium:

> 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):
>   Add component-build PACKAGECONFIG option
>   Add variable to contain extra command-line arguments
>   Add use-egl PACKAGECONFIG to let chromium use EGL automatically
>   Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts
> 
>  .../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   | 27 ++++++++++++++++--
>  4 files changed, 69 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
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium
  2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
                   ` (4 preceding siblings ...)
  2014-04-28  3:01 ` [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Martin Jansa
@ 2014-04-28  4:05 ` Martin Jansa
  5 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2014-04-28  4:05 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 5006 bytes --]

On Sun, Apr 27, 2014 at 01:21:47PM +0200, Carlos Rafael Giani 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.
> 
> Three new PACKAGECONFIG for chromium are introduced:

Also fails when PACKAGECONFIG is empty:

+ tee -a log.world.20140428_030644.log/bitbake.world.log
NOTE: Started PRServer with DBfile: /home/jenkins/oe/shr-core-branches/shr-core/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 52990, PID: 32499
Parsing recipes...ERROR: Error executing a python function in <code>:

The stack trace of python calls that resulted in this exception/failure was:
File: '<code>', lineno: 9, function: <module>
     0005:__anon_247__home_jenkins_oe_shr_core_branches_shr_core_openembedded_core_meta_classes_package_ipk_bbclass(d)
     0006:__anon_20__home_jenkins_oe_shr_core_branches_shr_core_openembedded_core_meta_classes_debian_bbclass(d)
     0007:__anon_33__home_jenkins_oe_shr_core_branches_shr_core_openembedded_core_meta_classes_devshell_bbclass(d)
     0008:__anon_80__home_jenkins_oe_shr_core_branches_shr_core_openembedded_core_meta_classes_sstate_bbclass(d)
 *** 0009:__anon_46__home_jenkins_oe_shr_core_branches_shr_core_meta_browser_recipes_browser_chromium_chromium_35_0_1883_0_bb(d)
File: '__anon_46__home_jenkins_oe_shr_core_branches_shr_core_meta_browser_recipes_browser_chromium_chromium_35_0_1883_0_bb', lineno: 3, function: __anon_46__home_jenkins_oe_shr_core_branches_shr_core_meta_browser_recipes_browser_chromium_chromium_35_0_1883_0_bb
     0001:def __anon_46__home_jenkins_oe_shr_core_branches_shr_core_meta_browser_recipes_browser_chromium_chromium_35_0_1883_0_bb(d):
     0002:    pkgconfig = d.getVar('PACKAGECONFIG', True)
 *** 0003:    if 'use-egl' in pkgconfig.split():
     0004:        d.appendVar("DEPENDS", " virtual/egl virtual/libgles2")
     0005:
Exception: AttributeError: 'NoneType' object has no attribute 'split'

> * "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):
>   Add component-build PACKAGECONFIG option
>   Add variable to contain extra command-line arguments
>   Add use-egl PACKAGECONFIG to let chromium use EGL automatically
>   Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts
> 
>  .../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   | 27 ++++++++++++++++--
>  4 files changed, 69 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
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [meta-browser][PATCH 3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically
  2014-04-27 11:21 ` [meta-browser][PATCH 3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically Carlos Rafael Giani
@ 2014-04-28 15:14   ` Otavio Salvador
  0 siblings, 0 replies; 9+ messages in thread
From: Otavio Salvador @ 2014-04-28 15:14 UTC (permalink / raw)
  To: OpenEmbedded Devel List

Hello Carlos,

On Sun, Apr 27, 2014 at 8:21 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 | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> index 080282b..d0495d8 100644
> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
...
> +python __anonymous() {
> +    pkgconfig = d.getVar('PACKAGECONFIG', True)
> +    if 'use-egl' in pkgconfig.split():
> +        d.appendVar("DEPENDS", " virtual/egl virtual/libgles2")
> +}

This is not need. You can add it in the PACKAGECONFIG third param so
it includes this dependencies for build.



-- 
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] 9+ messages in thread

* Re: [meta-browser][PATCH 2/4] Add variable to contain extra command-line arguments
  2014-04-27 11:21 ` [meta-browser][PATCH 2/4] Add variable to contain extra command-line arguments Carlos Rafael Giani
@ 2014-04-28 15:17   ` Otavio Salvador
  0 siblings, 0 replies; 9+ messages in thread
From: Otavio Salvador @ 2014-04-28 15:17 UTC (permalink / raw)
  To: OpenEmbedded Devel List

Hello Carlos,

On Sun, Apr 27, 2014 at 8:21 AM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> 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>
...
> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> index 203474d..080282b 100644
> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> @@ -33,6 +33,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 ?= ""

>  export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
>  do_configure() {
>         cd ${S}
> @@ -54,6 +57,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

Nice!

-- 
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] 9+ messages in thread

end of thread, other threads:[~2014-04-28 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-27 11:21 [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Carlos Rafael Giani
2014-04-27 11:21 ` [meta-browser][PATCH 1/4] Add component-build PACKAGECONFIG option Carlos Rafael Giani
2014-04-27 11:21 ` [meta-browser][PATCH 2/4] Add variable to contain extra command-line arguments Carlos Rafael Giani
2014-04-28 15:17   ` Otavio Salvador
2014-04-27 11:21 ` [meta-browser][PATCH 3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically Carlos Rafael Giani
2014-04-28 15:14   ` Otavio Salvador
2014-04-27 11:21 ` [meta-browser][PATCH 4/4] Add ignore-lost-context PACKAGECONFIG to ignore lost EGL contexts Carlos Rafael Giani
2014-04-28  3:01 ` [meta-browser][PATCH 0/4] Introduce EGL/GLES and component build patches for Chromium Martin Jansa
2014-04-28  4:05 ` Martin Jansa

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.