[systemd-devel] [RFC 11/12] gfx: add unbuilt GL test
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Sat Nov 30 21:21:36 PST 2013
On Wed, Nov 27, 2013 at 07:48:46PM +0100, David Herrmann wrote:
> The test-gl helper shows how sd_gfx_card can be used to get a full OpenGL
> context on the device. It is not added to the build-tools as it requires
> mesa and might break on Khronos header-updates (yes, they break API *and*
> ABI compatibility often!).
> ---
> .gitignore | 1 +
> Makefile.am | 18 +++
> configure.ac | 3 +
> src/libsystemd-gfx/test-gl.c | 342 +++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 364 insertions(+)
> create mode 100644 src/libsystemd-gfx/test-gl.c
>
> diff --git a/.gitignore b/.gitignore
> index a61f68d..c856412 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -116,6 +116,7 @@
> /test-event
> /test-fileio
> /test-gfx
> +/test-gl
> /test-hashmap
> /test-hostname
> /test-id128
> diff --git a/Makefile.am b/Makefile.am
> index aa17876..1e8aeed 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -3886,6 +3886,19 @@ test_gfx_LDADD = \
> libsystemd-shared.la \
> libsystemd-gfx.la
>
> +test_gl_SOURCES = \
> + src/libsystemd-gfx/test-gl.c
> +
> +test_gl_CFLAGS = \
> + $(AM_CFLAGS) \
> + $(GFX_GL_CFLAGS)
> +
> +test_gl_LDADD = \
> + $(GFX_GL_LIBS) \
> + libsystemd-bus-internal.la \
> + libsystemd-shared.la \
> + libsystemd-gfx.la
> +
> test_kbd_SOURCES = \
> src/libsystemd-gfx/test-kbd.c
>
> @@ -3903,6 +3916,11 @@ tests += \
> test-gfx \
> test-kbd
>
> +if HAVE_GFX_GL
> +# Uncomment this to enable test-gl builds
> +#tests += test-gl
> +endif
Telling people to edit the makefile doesn't seem right. Maybe add a configure
swith a la bd441fa27a? Then the GFX_GL switch below could be changed to actually
error out if any of those modules are not found.
> src/libsystemd-gfx/unifont.bin: make-unifont.py src/libsystemd-gfx/unifont.hex
> $(AM_V_GEN)cat $(top_srcdir)/src/libsystemd-gfx/unifont.hex | $(PYTHON) $< >$@
src/libsystemd-gfx/unifont.bin: src/libsystemd-gfx/unifont.hex make-unifont.py
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(PYTHON) $+ >$@
... and make make-unitfont.py accept an arg.
mkdir -p is needed for out of tree builds.
> + r = sd_gfx_card_new(&card, "/dev/dri/card0", gl_fd, event);
Maybe 'argv[1] ?: "/dev/dri/card0"' for manual testing?
Zbyszek
More information about the systemd-devel
mailing list