diff mbox

[6/6] glmark2: new package

Message ID 1377373321-29732-7-git-send-email-spenser@gillilanding.com
State Superseded
Headers show

Commit Message

Spenser Gilliland Aug. 24, 2013, 7:42 p.m. UTC
Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
---
 package/Config.in                                  |   1 +
 package/glmark2/Config.in                          |  49 ++++++++++
 package/glmark2/glmark2-add-mali-support.patch     | 102 +++++++++++++++++++++
 package/glmark2/glmark2-fix-add-GLchar.patch       |  17 ++++
 .../glmark2-gl-to-glesv2-on-drm-flavor.patch       |  25 +++++
 package/glmark2/glmark2.mk                         |  70 ++++++++++++++
 6 files changed, 264 insertions(+)
 create mode 100644 package/glmark2/Config.in
 create mode 100644 package/glmark2/glmark2-add-mali-support.patch
 create mode 100644 package/glmark2/glmark2-fix-add-GLchar.patch
 create mode 100644 package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch
 create mode 100644 package/glmark2/glmark2.mk

Comments

Arnout Vandecappelle Aug. 26, 2013, 5:43 p.m. UTC | #1
On 08/24/13 21:42, Spenser Gilliland wrote:
> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> ---
>   package/Config.in                                  |   1 +
>   package/glmark2/Config.in                          |  49 ++++++++++
>   package/glmark2/glmark2-add-mali-support.patch     | 102 +++++++++++++++++++++
>   package/glmark2/glmark2-fix-add-GLchar.patch       |  17 ++++
>   .../glmark2-gl-to-glesv2-on-drm-flavor.patch       |  25 +++++
>   package/glmark2/glmark2.mk                         |  70 ++++++++++++++
>   6 files changed, 264 insertions(+)
>   create mode 100644 package/glmark2/Config.in
>   create mode 100644 package/glmark2/glmark2-add-mali-support.patch
>   create mode 100644 package/glmark2/glmark2-fix-add-GLchar.patch
>   create mode 100644 package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch

  Have these patches been sent upstream?

>   create mode 100644 package/glmark2/glmark2.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 2b8bef0..ebe8cb4 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -24,6 +24,7 @@ source "package/dstat/Config.in"
>   source "package/dmalloc/Config.in"
>   source "package/dropwatch/Config.in"
>   source "package/gdb/Config.in"
> +source "package/glmark2/Config.in"
>   source "package/iozone/Config.in"
>   source "package/kexec/Config.in"
>   source "package/latencytop/Config.in"
> diff --git a/package/glmark2/Config.in b/package/glmark2/Config.in
> new file mode 100644
> index 0000000..47ed221
> --- /dev/null
> +++ b/package/glmark2/Config.in
> @@ -0,0 +1,49 @@
> +config BR2_PACKAGE_GLMARK2
> +	bool "glmark2"
> +	depends on BR2_PACKAGE_MESA3D
> +	depends on BR2_PACKAGE_MESA3D_GBM

  I would think that a select is more appropriate here.

> +	depends on BR2_LARGEFILE
> +	depends on BR2_PACKAGE_HAS_OPENGL || \
> +		(BR2_PACKAGE_HAS_OPENGL_EGL && BR2_PACKAGE_HAS_OPENGL_ES)
> +	select BR2_PACKAGE_JPEG
> +	select BR2_PACKAGE_LIBPNG12
> +	select BR2_PACKAGE_XLIB_LIBPCIACCESS if BR2_i386 || BR2_x86_64 # libdrm
> +	select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS # libdrm

  These selects are redundant, they're done by libdrm...

> +	help
> +	  glmark2 is a benchmark for OpenGL (ES) 2.0. It uses only the subset of the
> +	  OpenGL 2.0 API that is compatible with OpenGL ES 2.0.
> +
> +if BR2_PACKAGE_GLMARK2
> +
> +config BR2_PACKAGE_GLMARK2_X11
> +	bool "X11"
> +	depends on BR2_PACKAGE_XSERVER_XORG_SERVER
> +	help
> +	 Use X11 window for display.

  Since this is a benchmark tool, I don't really think it is necessary to 
make the backends configurable. Just include any backend that is available.

  You would probably want a "depends on" in the top symbol to make sure 
at least one backend is available.

> +
> +config BR2_PACKAGE_GLMARK2_EGL
> +	bool "EGL"
> +	default y
> +	depends on BR2_PACKAGE_HAS_OPENGL_EGL
> +	help
> +	  Use EGL window for display.
> +
> +config BR2_PACKAGE_GLMARK2_OPENGL
> +	bool "Install Desktop OpenGL 2.0 Version"
> +	default y
> +	depends on BR2_PACKAGE_HAS_OPENGL
> +	help
> +	  Enable desktop OpenGL version.
> +
> +config BR2_PACKAGE_GLMARK2_OPENGL_ES
> +	bool "Install OpenGL ES 2.0 Version"
> +	default y
> +	depends on BR2_PACKAGE_HAS_OPENGL_ES
> +	help
> +	  Enable OpenGL ES 2.0 Version.
> +
> +endif
> +
> +comment "glmark2 requires an OpenGL implementation and many X libraries"

  Actually just mesa3d AFAICS, so "many X libraries" is an exaggeration.

> +	depends on !BR2_PACKAGE_HAS_OPENGL_EGL || !BR2_PACKAGE_HAS_OPENGL_ES \
> +		|| !BR2_PACKAGE_XORG7
[snip]
> diff --git a/package/glmark2/glmark2.mk b/package/glmark2/glmark2.mk
> new file mode 100644
> index 0000000..47b464b
> --- /dev/null
> +++ b/package/glmark2/glmark2.mk
> @@ -0,0 +1,70 @@
> +################################################################################
> +#
> +# glmark2
> +#
> +################################################################################
> +
> +GLMARK2_VERSION = 279
> +GLMARK2_SITE = http://bazaar.launchpad.net/~laanwj/glmark2/fbdev
> +GLMARK2_SITE_METHOD = bzr
> +GLMARK2_SOURCE = glmark2-$(GLMARK2_VERSION).tar.gz
> +GLMARK2_LICENSE = GPLv3+ SGIv1
> +GLMARK2_LICENSE_FILES = COPYING COPYING.SGI
> +
> +GLMARK2_DEPENDENCIES = jpeg libpng12 mesa3d host-python host-pkgconf
> +
> +GLMARK2_CONF_OPTS = --prefix=/usr/
> +
> +ifeq ($(BR2_PACKAGE_GLMARK2_X11)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
> +GLMARK2_DEPENDENCIES += libegl libgles
> +GLMARK2_FLAVORS += x11-glesv2
> +endif
> +
> +ifeq ($(BR2_PACKAGE_GLMARK2_X11)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
> +GLMARK2_DEPENDENCIES += libgl
> +GLMARK2_FLAVORS += x11-gl
> +endif
> +
> +ifeq ($(BR2_PACKAGE_GLMARK2_EGL)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
> +GLMARK2_DEPENDENCIES += libdrm libegl libgles
> +GLMARK2_FLAVORS += drm-glesv2 fbdev-glesv2
> +endif
> +
> +ifeq ($(BR2_PACKAGE_GLMARK2_EGL)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
> +GLMARK2_DEPENDENCIES += libdrm libgl
> +GLMARK2_FLAVORS += drm-gl
> +endif
> +
> +ifeq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
> +GLMARK2_DEPENDENCIES += wayland libegl libgles
> +GLMARK2_FLAVORS += wayland-glesv2
> +endif
> +
> +ifeq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
> +GLMARK2_DEPENDENCIES += wayland libgl
> +GLMARK2_FLAVORS += wayland-gl
> +endif
> +
> +ifeq ($(BR2_PACKAGE_SUNXI_MALI),y)
> +GLMARK2_CONF_OPTS += --for-mali
> +endif
> +
> +null :=
> +space := $(null) #
> +comma := ,

  space and comma are already defined in the top-level Makefile, and used 
in a few other packages as well.

> +
> +GLMARK2_CONF_OPTS += --with-flavors=$(subst $(space),$(comma),$(GLMARK2_FLAVORS))
> +
> +define GLMARK2_CONFIGURE_CMDS
> +cd $(@D) && $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) ./waf configure $(GLMARK2_CONF_OPTS)

  Indent with a tab (same for other _CMDS).


  Regards,
  Arnout

> +endef
> +
> +define GLMARK2_BUILD_CMDS
> +cd $(@D) && $(TARGET_MAKE_ENV) ./waf
> +endef
> +
> +define GLMARK2_INSTALL_TARGET_CMDS
> +cd $(@D) && $(TARGET_MAKE_ENV) ./waf install --destdir=$(TARGET_DIR)
> +endef
> +
> +$(eval $(generic-package))
>
Spenser Gilliland Aug. 27, 2013, 7:01 p.m. UTC | #2
Arnout,

Thanks for the review.  I appreciate your suggestions.

On Mon, Aug 26, 2013 at 12:43 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 08/24/13 21:42, Spenser Gilliland wrote:
>>
>> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
>> ---
>>   package/Config.in                                  |   1 +
>>   package/glmark2/Config.in                          |  49 ++++++++++
>>   package/glmark2/glmark2-add-mali-support.patch     | 102
>> +++++++++++++++++++++
>>   package/glmark2/glmark2-fix-add-GLchar.patch       |  17 ++++
>>   .../glmark2-gl-to-glesv2-on-drm-flavor.patch       |  25 +++++
>>   package/glmark2/glmark2.mk                         |  70 ++++++++++++++
>>   6 files changed, 264 insertions(+)
>>   create mode 100644 package/glmark2/Config.in
>>   create mode 100644 package/glmark2/glmark2-add-mali-support.patch
>>   create mode 100644 package/glmark2/glmark2-fix-add-GLchar.patch
>>   create mode 100644
>> package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch
>
>
>  Have these patches been sent upstream?

Not yet.  I was planning to wait until these patches were committed
before submitting them upstream.

>
>>   create mode 100644 package/glmark2/glmark2.mk
>>
>> diff --git a/package/Config.in b/package/Config.in
>> index 2b8bef0..ebe8cb4 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -24,6 +24,7 @@ source "package/dstat/Config.in"
>>   source "package/dmalloc/Config.in"
>>   source "package/dropwatch/Config.in"
>>   source "package/gdb/Config.in"
>> +source "package/glmark2/Config.in"
>>   source "package/iozone/Config.in"
>>   source "package/kexec/Config.in"
>>   source "package/latencytop/Config.in"
>> diff --git a/package/glmark2/Config.in b/package/glmark2/Config.in
>> new file mode 100644
>> index 0000000..47ed221
>> --- /dev/null
>> +++ b/package/glmark2/Config.in
>> @@ -0,0 +1,49 @@
>> +config BR2_PACKAGE_GLMARK2
>> +       bool "glmark2"
>> +       depends on BR2_PACKAGE_MESA3D
>> +       depends on BR2_PACKAGE_MESA3D_GBM
>
>
>  I would think that a select is more appropriate here.

Will fix.

>
>
>> +       depends on BR2_LARGEFILE
>> +       depends on BR2_PACKAGE_HAS_OPENGL || \
>> +               (BR2_PACKAGE_HAS_OPENGL_EGL && BR2_PACKAGE_HAS_OPENGL_ES)
>> +       select BR2_PACKAGE_JPEG
>> +       select BR2_PACKAGE_LIBPNG12
>> +       select BR2_PACKAGE_XLIB_LIBPCIACCESS if BR2_i386 || BR2_x86_64 #
>> libdrm
>> +       select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS # libdrm
>
>
>  These selects are redundant, they're done by libdrm...

Will fix.

>
>> +       help
>> +         glmark2 is a benchmark for OpenGL (ES) 2.0. It uses only the
>> subset of the
>> +         OpenGL 2.0 API that is compatible with OpenGL ES 2.0.
>> +
>> +if BR2_PACKAGE_GLMARK2
>> +
>> +config BR2_PACKAGE_GLMARK2_X11
>> +       bool "X11"
>> +       depends on BR2_PACKAGE_XSERVER_XORG_SERVER
>> +       help
>> +        Use X11 window for display.
>
>
>  Since this is a benchmark tool, I don't really think it is necessary to
> make the backends configurable. Just include any backend that is available.
>
>  You would probably want a "depends on" in the top symbol to make sure at
> least one backend is available.

Will fix.

>
>> +
>> +config BR2_PACKAGE_GLMARK2_EGL
>> +       bool "EGL"
>> +       default y
>> +       depends on BR2_PACKAGE_HAS_OPENGL_EGL
>> +       help
>> +         Use EGL window for display.
>> +
>> +config BR2_PACKAGE_GLMARK2_OPENGL
>> +       bool "Install Desktop OpenGL 2.0 Version"
>> +       default y
>> +       depends on BR2_PACKAGE_HAS_OPENGL
>> +       help
>> +         Enable desktop OpenGL version.
>> +
>> +config BR2_PACKAGE_GLMARK2_OPENGL_ES
>> +       bool "Install OpenGL ES 2.0 Version"
>> +       default y
>> +       depends on BR2_PACKAGE_HAS_OPENGL_ES
>> +       help
>> +         Enable OpenGL ES 2.0 Version.
>> +
>> +endif
>> +
>> +comment "glmark2 requires an OpenGL implementation and many X libraries"
>
>
>  Actually just mesa3d AFAICS, so "many X libraries" is an exaggeration.

This was left in from before my fixes in libdrm/mesa3d.  Will fix.

>
>> +       depends on !BR2_PACKAGE_HAS_OPENGL_EGL ||
>> !BR2_PACKAGE_HAS_OPENGL_ES \
>> +               || !BR2_PACKAGE_XORG7
>
> [snip]
>
>> diff --git a/package/glmark2/glmark2.mk b/package/glmark2/glmark2.mk
>> new file mode 100644
>> index 0000000..47b464b
>> --- /dev/null
>> +++ b/package/glmark2/glmark2.mk
>> @@ -0,0 +1,70 @@
>>
>> +################################################################################
>> +#
>> +# glmark2
>> +#
>>
>> +################################################################################
>> +
>> +GLMARK2_VERSION = 279
>> +GLMARK2_SITE = http://bazaar.launchpad.net/~laanwj/glmark2/fbdev
>> +GLMARK2_SITE_METHOD = bzr
>> +GLMARK2_SOURCE = glmark2-$(GLMARK2_VERSION).tar.gz
>> +GLMARK2_LICENSE = GPLv3+ SGIv1
>> +GLMARK2_LICENSE_FILES = COPYING COPYING.SGI
>> +
>> +GLMARK2_DEPENDENCIES = jpeg libpng12 mesa3d host-python host-pkgconf
>> +
>> +GLMARK2_CONF_OPTS = --prefix=/usr/
>> +
>> +ifeq ($(BR2_PACKAGE_GLMARK2_X11)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
>> +GLMARK2_DEPENDENCIES += libegl libgles
>> +GLMARK2_FLAVORS += x11-glesv2
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_GLMARK2_X11)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
>> +GLMARK2_DEPENDENCIES += libgl
>> +GLMARK2_FLAVORS += x11-gl
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_GLMARK2_EGL)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
>> +GLMARK2_DEPENDENCIES += libdrm libegl libgles
>> +GLMARK2_FLAVORS += drm-glesv2 fbdev-glesv2
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_GLMARK2_EGL)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
>> +GLMARK2_DEPENDENCIES += libdrm libgl
>> +GLMARK2_FLAVORS += drm-gl
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
>> +GLMARK2_DEPENDENCIES += wayland libegl libgles
>> +GLMARK2_FLAVORS += wayland-glesv2
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
>> +GLMARK2_DEPENDENCIES += wayland libgl
>> +GLMARK2_FLAVORS += wayland-gl
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_SUNXI_MALI),y)
>> +GLMARK2_CONF_OPTS += --for-mali
>> +endif
>> +
>> +null :=
>> +space := $(null) #
>> +comma := ,
>
>
>  space and comma are already defined in the top-level Makefile, and used in
> a few other packages as well.

Will fix.

>
>> +
>> +GLMARK2_CONF_OPTS += --with-flavors=$(subst
>> $(space),$(comma),$(GLMARK2_FLAVORS))
>> +
>> +define GLMARK2_CONFIGURE_CMDS
>> +cd $(@D) && $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) ./waf configure
>> $(GLMARK2_CONF_OPTS)
>
>
>  Indent with a tab (same for other _CMDS).

Will fix.

Thanks,
Spenser
Thomas Petazzoni Aug. 27, 2013, 8:48 p.m. UTC | #3
Dear Spenser Gilliland,

On Sat, 24 Aug 2013 14:42:01 -0500, Spenser Gilliland wrote:

> diff --git a/package/glmark2/Config.in b/package/glmark2/Config.in
> new file mode 100644
> index 0000000..47ed221
> --- /dev/null
> +++ b/package/glmark2/Config.in
> @@ -0,0 +1,49 @@
> +config BR2_PACKAGE_GLMARK2
> +	bool "glmark2"
> +	depends on BR2_PACKAGE_MESA3D
> +	depends on BR2_PACKAGE_MESA3D_GBM
> +	depends on BR2_LARGEFILE
> +	depends on BR2_PACKAGE_HAS_OPENGL || \
> +		(BR2_PACKAGE_HAS_OPENGL_EGL && BR2_PACKAGE_HAS_OPENGL_ES)

It's probably me not having enough OpenGL/Mesa knowledge, but my
understanding was that Mesa was the OpenGL/EGL/OpenVG implementations
for "desktop" graphics cards, and that therefore Mesa was equivalent to
the OpenGL implementations provided by ARM SoC vendors, so that OpenGL
applications such as glmark2 would only have to depends on HAS_OPENGL
|| (HAS_OPENGL_EGL && HAS_OPENGL_ES), and not depend on Mesa in
addition to this.

With the dependencies you've listed, on a TI OMAP3 platform, we would
need both Mesa *and* the ti-gfx package. Is this expected? I suppose
that this means Mesa provides more stuff that just GL/GLES/EGL/VG. If
that's the case, do you have a few more details?

> +	select BR2_PACKAGE_JPEG
> +	select BR2_PACKAGE_LIBPNG12
> +	select BR2_PACKAGE_XLIB_LIBPCIACCESS if BR2_i386 || BR2_x86_64 # libdrm
> +	select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS # libdrm

glmark2 is directly using libpciaccess and libpthread-stubs?

Thanks!

Thomas
Arnout Vandecappelle Aug. 29, 2013, 5:35 a.m. UTC | #4
On 08/27/13 21:01, Spenser Gilliland wrote:
> Arnout,
>
> Thanks for the review.  I appreciate your suggestions.
>
> On Mon, Aug 26, 2013 at 12:43 PM, Arnout Vandecappelle<arnout@mind.be>  wrote:
>> >On 08/24/13 21:42, Spenser Gilliland wrote:
>>> >>
>>> >>Signed-off-by: Spenser Gilliland<spenser@gillilanding.com>
>>> >>---
>>> >>   package/Config.in                                  |   1 +
>>> >>   package/glmark2/Config.in                          |  49 ++++++++++
>>> >>   package/glmark2/glmark2-add-mali-support.patch     | 102
>>> >>+++++++++++++++++++++
>>> >>   package/glmark2/glmark2-fix-add-GLchar.patch       |  17 ++++
>>> >>   .../glmark2-gl-to-glesv2-on-drm-flavor.patch       |  25 +++++
>>> >>   package/glmark2/glmark2.mk                         |  70 ++++++++++++++
>>> >>   6 files changed, 264 insertions(+)
>>> >>   create mode 100644 package/glmark2/Config.in
>>> >>   create mode 100644 package/glmark2/glmark2-add-mali-support.patch
>>> >>   create mode 100644 package/glmark2/glmark2-fix-add-GLchar.patch
>>> >>   create mode 100644
>>> >>package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch
>> >
>> >
>> >  Have these patches been sent upstream?
> Not yet.  I was planning to wait until these patches were committed
> before submitting them upstream.

  It's a better idea to send them right away. The buildroot people are 
not ideally placed to review those patches, so you may get more useful 
feedback from upstream. Also, if upstream is fast enough to review the 
patches, you can still make modifications to the patch included in buildroot.

  Regards,
  Arnout
Spenser Gilliland Aug. 29, 2013, 6:24 p.m. UTC | #5
On Thu, Aug 29, 2013 at 12:35 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 08/27/13 21:01, Spenser Gilliland wrote:
>>
>> Arnout,
>>
>> Thanks for the review.  I appreciate your suggestions.
>>
>> On Mon, Aug 26, 2013 at 12:43 PM, Arnout Vandecappelle<arnout@mind.be>
>> wrote:
>>>
>>> >On 08/24/13 21:42, Spenser Gilliland wrote:
>>>>
>>>> >>
>>>> >>Signed-off-by: Spenser Gilliland<spenser@gillilanding.com>
>>>> >>---
>>>> >>   package/Config.in                                  |   1 +
>>>> >>   package/glmark2/Config.in                          |  49 ++++++++++
>>>> >>   package/glmark2/glmark2-add-mali-support.patch     | 102
>>>> >>+++++++++++++++++++++
>>>> >>   package/glmark2/glmark2-fix-add-GLchar.patch       |  17 ++++
>>>> >>   .../glmark2-gl-to-glesv2-on-drm-flavor.patch       |  25 +++++
>>>> >>   package/glmark2/glmark2.mk                         |  70
>>>> >> ++++++++++++++
>>>> >>   6 files changed, 264 insertions(+)
>>>> >>   create mode 100644 package/glmark2/Config.in
>>>> >>   create mode 100644 package/glmark2/glmark2-add-mali-support.patch
>>>> >>   create mode 100644 package/glmark2/glmark2-fix-add-GLchar.patch
>>>> >>   create mode 100644
>>>> >>package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch
>>>
>>> >
>>> >
>>> >  Have these patches been sent upstream?
>>
>> Not yet.  I was planning to wait until these patches were committed
>> before submitting them upstream.
>
>
>  It's a better idea to send them right away. The buildroot people are not
> ideally placed to review those patches, so you may get more useful feedback
> from upstream. Also, if upstream is fast enough to review the patches, you
> can still make modifications to the patch included in buildroot.

They have been sent.  Awaiting review using launchpad see
https://code.launchpad.net/~spenser-gilliland/glmark2/mali-fbdev .

>  Regards,
>  Arnout
>
>
>
> --
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

Regards,
Spenser
Spenser Gilliland Sept. 6, 2013, 4:35 p.m. UTC | #6
Thomas,

> It's probably me not having enough OpenGL/Mesa knowledge, but my
> understanding was that Mesa was the OpenGL/EGL/OpenVG implementations
> for "desktop" graphics cards, and that therefore Mesa was equivalent to
> the OpenGL implementations provided by ARM SoC vendors, so that OpenGL
> applications such as glmark2 would only have to depends on HAS_OPENGL
> || (HAS_OPENGL_EGL && HAS_OPENGL_ES), and not depend on Mesa in
> addition to this.

GLMark2 depends on Mesa because Mesa provides libgbm which is a
required dependency of glmark2.

>
> With the dependencies you've listed, on a TI OMAP3 platform, we would
> need both Mesa *and* the ti-gfx package. Is this expected? I suppose
> that this means Mesa provides more stuff that just GL/GLES/EGL/VG. If
> that's the case, do you have a few more details?

Everything you have mentioned is completely correct.

>> +     select BR2_PACKAGE_JPEG
>> +     select BR2_PACKAGE_LIBPNG12
>> +     select BR2_PACKAGE_XLIB_LIBPCIACCESS if BR2_i386 || BR2_x86_64 # libdrm
>> +     select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS # libdrm
>
> glmark2 is directly using libpciaccess and libpthread-stubs?

Fixed in recent version.

> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 2b8bef0..ebe8cb4 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -24,6 +24,7 @@  source "package/dstat/Config.in"
 source "package/dmalloc/Config.in"
 source "package/dropwatch/Config.in"
 source "package/gdb/Config.in"
+source "package/glmark2/Config.in"
 source "package/iozone/Config.in"
 source "package/kexec/Config.in"
 source "package/latencytop/Config.in"
diff --git a/package/glmark2/Config.in b/package/glmark2/Config.in
new file mode 100644
index 0000000..47ed221
--- /dev/null
+++ b/package/glmark2/Config.in
@@ -0,0 +1,49 @@ 
+config BR2_PACKAGE_GLMARK2
+	bool "glmark2"
+	depends on BR2_PACKAGE_MESA3D
+	depends on BR2_PACKAGE_MESA3D_GBM
+	depends on BR2_LARGEFILE
+	depends on BR2_PACKAGE_HAS_OPENGL || \
+		(BR2_PACKAGE_HAS_OPENGL_EGL && BR2_PACKAGE_HAS_OPENGL_ES)
+	select BR2_PACKAGE_JPEG
+	select BR2_PACKAGE_LIBPNG12
+	select BR2_PACKAGE_XLIB_LIBPCIACCESS if BR2_i386 || BR2_x86_64 # libdrm
+	select BR2_PACKAGE_XLIB_LIBPTHREAD_STUBS # libdrm
+	help
+	  glmark2 is a benchmark for OpenGL (ES) 2.0. It uses only the subset of the
+	  OpenGL 2.0 API that is compatible with OpenGL ES 2.0.
+
+if BR2_PACKAGE_GLMARK2
+
+config BR2_PACKAGE_GLMARK2_X11
+	bool "X11"
+	depends on BR2_PACKAGE_XSERVER_XORG_SERVER
+	help
+	 Use X11 window for display.
+
+config BR2_PACKAGE_GLMARK2_EGL
+	bool "EGL"
+	default y
+	depends on BR2_PACKAGE_HAS_OPENGL_EGL
+	help
+	  Use EGL window for display.
+
+config BR2_PACKAGE_GLMARK2_OPENGL
+	bool "Install Desktop OpenGL 2.0 Version"
+	default y
+	depends on BR2_PACKAGE_HAS_OPENGL
+	help
+	  Enable desktop OpenGL version.
+
+config BR2_PACKAGE_GLMARK2_OPENGL_ES
+	bool "Install OpenGL ES 2.0 Version"
+	default y
+	depends on BR2_PACKAGE_HAS_OPENGL_ES
+	help
+	  Enable OpenGL ES 2.0 Version.
+
+endif
+
+comment "glmark2 requires an OpenGL implementation and many X libraries"
+	depends on !BR2_PACKAGE_HAS_OPENGL_EGL || !BR2_PACKAGE_HAS_OPENGL_ES \
+		|| !BR2_PACKAGE_XORG7
diff --git a/package/glmark2/glmark2-add-mali-support.patch b/package/glmark2/glmark2-add-mali-support.patch
new file mode 100644
index 0000000..c37c88c
--- /dev/null
+++ b/package/glmark2/glmark2-add-mali-support.patch
@@ -0,0 +1,102 @@ 
+Mali uses a slightly different windowing structure than most
+implementations add support through this patch.
+
+Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
+---
+Index: glmark2-279/src/gl-state-egl.cpp
+===================================================================
+--- glmark2-279.orig/src/gl-state-egl.cpp	2013-08-21 14:49:38.953803965 -0500
++++ glmark2-279/src/gl-state-egl.cpp	2013-08-21 14:59:42.389814979 -0500
+@@ -414,9 +414,12 @@
+ {
+     if (egl_display_)
+         return true;
+-
++#ifdef HAS_MALI
++    egl_display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY);
++#else
+     egl_display_ = eglGetDisplay(native_display_);
+-    if (!egl_display_) {
++#endif
++    if (egl_display_ == EGL_NO_DISPLAY) {
+         Log::error("eglGetDisplay() failed with error: 0x%x\n", eglGetError());
+         return false;
+     }
+Index: glmark2-279/src/native-state-fbdev.cpp
+===================================================================
+--- glmark2-279.orig/src/native-state-fbdev.cpp	2013-08-19 17:36:32.000000000 -0500
++++ glmark2-279/src/native-state-fbdev.cpp	2013-08-21 14:59:58.629815276 -0500
+@@ -31,7 +31,9 @@
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+ #include <linux/fb.h>
+-
++#if HAS_MALI
++#include <EGL/egl.h>
++#endif
+ #ifdef ANDROID
+ #define FBDEV_DEV "/dev/graphics/fb"
+ #else
+@@ -79,7 +81,13 @@
+ NativeStateFBDEV::window(WindowProperties& properties)
+ {
+     properties = winprops;
++#ifdef HAS_MALI
++    native_window.height = winprops.height;
++    native_window.width = winprops.width;
++    return reinterpret_cast<void*>(&native_window);
++#else
+     return NULL;
++#endif
+ }
+ 
+ void
+Index: glmark2-279/src/native-state-fbdev.h
+===================================================================
+--- glmark2-279.orig/src/native-state-fbdev.h	2013-08-19 17:36:32.000000000 -0500
++++ glmark2-279/src/native-state-fbdev.h	2013-08-21 15:00:14.345815563 -0500
+@@ -30,6 +30,10 @@
+ #include <csignal>
+ #include <cstring>
+ 
++#ifdef HAS_MALI
++#include <EGL/egl.h>
++#endif
++
+ class NativeStateFBDEV : public NativeState
+ {
+ public:
+@@ -50,7 +54,9 @@
+     static volatile std::sig_atomic_t should_quit_;
+     int fd;
+     WindowProperties winprops;
+-
++#ifdef HAS_MALI
++    struct mali_native_window native_window;
++#endif
+     bool init();
+     void cleanup();
+ };
+Index: glmark2-279/wscript
+===================================================================
+--- glmark2-279.orig/wscript	2013-08-19 17:36:32.000000000 -0500
++++ glmark2-279/wscript	2013-08-21 15:00:24.245815743 -0500
+@@ -46,7 +46,8 @@
+                    dest = 'flavors',
+                    help = "a list of flavors to build (%s, all)" % FLAVORS_STR)
+     opt.parser.set_default('flavors', [])
+-
++    opt.add_option('--for-mali', action='store_true', dest = 'mali',
++                   default = False, help='enable ARM Mali GPU support')
+     opt.add_option('--no-debug', action='store_false', dest = 'debug',
+                    default = True, help='disable compiler debug information')
+     opt.add_option('--no-opt', action='store_false', dest = 'opt',
+@@ -132,6 +133,8 @@
+         ctx.env.prepend_value('CXXFLAGS', '-O2')
+     if Options.options.debug:
+         ctx.env.prepend_value('CXXFLAGS', '-g')
++    if Options.options.mali:
++        ctx.env.append_unique('DEFINES','HAS_MALI=1')
+ 
+     ctx.env.HAVE_EXTRAS = False
+     if Options.options.extras_path is not None:
diff --git a/package/glmark2/glmark2-fix-add-GLchar.patch b/package/glmark2/glmark2-fix-add-GLchar.patch
new file mode 100644
index 0000000..15653de
--- /dev/null
+++ b/package/glmark2/glmark2-fix-add-GLchar.patch
@@ -0,0 +1,17 @@ 
+Bug fix in program.cc.  There is no such type as GLchar.
+
+Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
+---
+Index: glmark2-2012.12/src/libmatrix/program.cc
+===================================================================
+--- glmark2-2012.12.orig/src/libmatrix/program.cc	2012-12-18 13:45:45.000000000 -0600
++++ glmark2-2012.12/src/libmatrix/program.cc	2013-08-13 20:08:27.005724911 -0500
+@@ -17,6 +17,8 @@
+ #include "gl-if.h"
+ #include "program.h"
+ 
++typedef char GLchar;
++
+ using std::string;
+ using LibMatrix::mat4;
+ using LibMatrix::mat3;
diff --git a/package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch b/package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch
new file mode 100644
index 0000000..5f838cc
--- /dev/null
+++ b/package/glmark2/glmark2-gl-to-glesv2-on-drm-flavor.patch
@@ -0,0 +1,25 @@ 
+Bug in build script requires full opengl when only opengl es is actually
+required.
+
+Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
+---
+Index: glmark2-279/src/wscript_build
+===================================================================
+--- glmark2-279.orig/src/wscript_build	2013-08-19 17:36:32.000000000 -0500
++++ glmark2-279/src/wscript_build	2013-08-20 10:31:39.364629078 -0500
+@@ -23,11 +23,12 @@
+   'x11-gl' : ['x11', 'gl', 'matrix-gl'],
+   'x11-glesv2' : ['x11', 'egl', 'glesv2', 'matrix-glesv2'],
+   'drm-gl' : ['drm', 'gbm', 'egl', 'gl', 'matrix-gl'],
+-  'drm-glesv2' : ['drm', 'gbm', 'egl', 'glesv2', 'matrix-gl'],
++  'drm-glesv2' : ['drm', 'gbm', 'egl', 'glesv2', 'matrix-glesv2'],
+   'mir-gl' : ['mirclient', 'egl', 'gl', 'matrix-gl'],
+-  'mir-glesv2' : ['mirclient', 'egl', 'glesv2', 'matrix-gl'],
++  'mir-glesv2' : ['mirclient', 'egl', 'glesv2', 'matrix-glesv2'],
+   'wayland-gl' : ['wayland-client', 'wayland-egl', 'egl', 'gl', 'matrix-gl'],
+-  'wayland-glesv2' : ['wayland-client', 'wayland-egl', 'egl', 'glesv2', 'matrix-gl'],
++  'wayland-glesv2' : ['wayland-client', 'wayland-egl', 'egl', 'glesv2',
++  'matrix-glesv2'],
+   'fbdev-glesv2' : ['egl', 'glesv2', 'matrix-glesv2']
+ }
+ flavor_defines = {
diff --git a/package/glmark2/glmark2.mk b/package/glmark2/glmark2.mk
new file mode 100644
index 0000000..47b464b
--- /dev/null
+++ b/package/glmark2/glmark2.mk
@@ -0,0 +1,70 @@ 
+################################################################################
+#
+# glmark2
+#
+################################################################################
+
+GLMARK2_VERSION = 279
+GLMARK2_SITE = http://bazaar.launchpad.net/~laanwj/glmark2/fbdev
+GLMARK2_SITE_METHOD = bzr
+GLMARK2_SOURCE = glmark2-$(GLMARK2_VERSION).tar.gz
+GLMARK2_LICENSE = GPLv3+ SGIv1
+GLMARK2_LICENSE_FILES = COPYING COPYING.SGI
+
+GLMARK2_DEPENDENCIES = jpeg libpng12 mesa3d host-python host-pkgconf
+
+GLMARK2_CONF_OPTS = --prefix=/usr/
+
+ifeq ($(BR2_PACKAGE_GLMARK2_X11)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
+GLMARK2_DEPENDENCIES += libegl libgles
+GLMARK2_FLAVORS += x11-glesv2
+endif
+
+ifeq ($(BR2_PACKAGE_GLMARK2_X11)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
+GLMARK2_DEPENDENCIES += libgl
+GLMARK2_FLAVORS += x11-gl
+endif
+
+ifeq ($(BR2_PACKAGE_GLMARK2_EGL)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
+GLMARK2_DEPENDENCIES += libdrm libegl libgles
+GLMARK2_FLAVORS += drm-glesv2 fbdev-glesv2
+endif
+
+ifeq ($(BR2_PACKAGE_GLMARK2_EGL)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
+GLMARK2_DEPENDENCIES += libdrm libgl
+GLMARK2_FLAVORS += drm-gl
+endif
+
+ifeq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_GLMARK2_OPENGL_ES),yy)
+GLMARK2_DEPENDENCIES += wayland libegl libgles
+GLMARK2_FLAVORS += wayland-glesv2
+endif
+
+ifeq ($(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_GLMARK2_OPENGL),yy)
+GLMARK2_DEPENDENCIES += wayland libgl
+GLMARK2_FLAVORS += wayland-gl
+endif
+
+ifeq ($(BR2_PACKAGE_SUNXI_MALI),y)
+GLMARK2_CONF_OPTS += --for-mali
+endif
+
+null :=
+space := $(null) #
+comma := ,
+
+GLMARK2_CONF_OPTS += --with-flavors=$(subst $(space),$(comma),$(GLMARK2_FLAVORS))
+
+define GLMARK2_CONFIGURE_CMDS
+cd $(@D) && $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) ./waf configure $(GLMARK2_CONF_OPTS)
+endef
+
+define GLMARK2_BUILD_CMDS
+cd $(@D) && $(TARGET_MAKE_ENV) ./waf
+endef
+
+define GLMARK2_INSTALL_TARGET_CMDS
+cd $(@D) && $(TARGET_MAKE_ENV) ./waf install --destdir=$(TARGET_DIR)
+endef
+
+$(eval $(generic-package))