Skip to content
Snippets Groups Projects
Commit d2ae79e9 authored by Simon McVittie's avatar Simon McVittie
Browse files

Merge branch 'wip/smcv/check-gl' into 'master'

Finish initial check-gl: add to packaging, and be compatible with SteamRT 1 'scout'

See merge request steam/steam-runtime-tools!5

Reviewed-by: @jpwhiting
parents cbdb3baa 344ed6f1
No related branches found
No related tags found
1 merge request!5Finish initial check-gl: add to packaging, and be compatible with SteamRT 1 'scout'
...@@ -6,6 +6,12 @@ Standards-Version: 4.3.0 ...@@ -6,6 +6,12 @@ Standards-Version: 4.3.0
Build-Depends: Build-Depends:
debhelper, debhelper,
gtk-doc-tools <!nodoc>, gtk-doc-tools <!nodoc>,
libegl1-mesa-dev,
libgl1-mesa-dev,
libgles2-mesa-dev,
libglib2.0-dev,
libx11-dev,
libxcomposite-dev,
meson, meson,
Build-Depends-Indep: Build-Depends-Indep:
libglib2.0-dev, libglib2.0-dev,
......
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Steam Runtime tools Upstream-Name: Steam Runtime tools
License: Expat and GPL-2+
Comment: SPDX-License-Identifier: MIT and GPL-2.0-or-later
Files: Files:
* *
...@@ -8,6 +10,18 @@ Copyright: ...@@ -8,6 +10,18 @@ Copyright:
© 2019 Collabora Ltd. © 2019 Collabora Ltd.
License: Expat License: Expat
Files:
helpers/check-gl.c
helpers/check-gles.c
helpers/gnome-session-check-accelerated-common.h
Copyright:
© 2006-2009 Red Hat, Inc.
© 2010 Novell, Inc.
© 2013 SUSE LINUX Products GmbH
© 2016 Endless Mobile, Inc
© 2019 Collabora Ltd.
License: GPL-2+
License: Expat License: Expat
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
...@@ -29,3 +43,20 @@ License: Expat ...@@ -29,3 +43,20 @@ License: Expat
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Comment: Comment:
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
License: GPL-2+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Comment:
SPDX-License-Identifier: GPL-2.0-or-later
.
On Debian systems, a copy of the GPL can be found in
/usr/share/common-licenses/GPL-2. In the Steam Runtime, a copy of the
GPL can be found in steam-runtime/common-licenses/GPL-2.
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glx.h> #include <GL/glx.h>
#include "steam-runtime-tools/glib-compat.h"
#include "gnome-session-check-accelerated-common.h" #include "gnome-session-check-accelerated-common.h"
#define SIZE_UNSET 0 #define SIZE_UNSET 0
...@@ -105,6 +107,7 @@ _print_error (const char *str) ...@@ -105,6 +107,7 @@ _print_error (const char *str)
fprintf (stderr, "gnome-session-is-accelerated: %s\n", str); fprintf (stderr, "gnome-session-is-accelerated: %s\n", str);
} }
#if 0
static gboolean static gboolean
_is_comment (const char *line) _is_comment (const char *line)
{ {
...@@ -115,6 +118,7 @@ _is_comment (const char *line) ...@@ -115,6 +118,7 @@ _is_comment (const char *line)
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
#endif
static gboolean static gboolean
_is_gl_renderer_blacklisted (const char *renderer) _is_gl_renderer_blacklisted (const char *renderer)
...@@ -268,6 +272,7 @@ out: ...@@ -268,6 +272,7 @@ out:
return renderer; return renderer;
} }
#if 0
static gboolean static gboolean
_has_extension (const char *extension_list, _has_extension (const char *extension_list,
const char *extension) const char *extension)
...@@ -327,6 +332,7 @@ _display_has_extension (Display *display, const char *extension) ...@@ -327,6 +332,7 @@ _display_has_extension (Display *display, const char *extension)
out: out:
return ret; return ret;
} }
#endif
static gboolean print_renderer = FALSE; static gboolean print_renderer = FALSE;
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#include <EGL/egl.h> #include <EGL/egl.h>
#include "steam-runtime-tools/glib-compat.h"
#include "gnome-session-check-accelerated-common.h" #include "gnome-session-check-accelerated-common.h"
static char * static char *
......
...@@ -37,6 +37,7 @@ x11_dep = dependency('x11') ...@@ -37,6 +37,7 @@ x11_dep = dependency('x11')
executable( executable(
multiarch + '-check-gl', multiarch + '-check-gl',
'check-gl.c', 'check-gl.c',
include_directories : project_include_dirs,
install : true, install : true,
install_dir : join_paths( install_dir : join_paths(
get_option('libexecdir'), get_option('libexecdir'),
...@@ -52,6 +53,7 @@ executable( ...@@ -52,6 +53,7 @@ executable(
executable( executable(
multiarch + '-check-gles', multiarch + '-check-gles',
'check-gles.c', 'check-gles.c',
include_directories : project_include_dirs,
install : true, install : true,
install_dir : join_paths( install_dir : join_paths(
get_option('libexecdir'), get_option('libexecdir'),
......
/*
* Copyright © 2019 Collabora Ltd.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma once
#include <glib.h>
#if !GLIB_CHECK_VERSION(2, 44, 0)
#define g_steal_pointer(x) _srt_steal_pointer (x)
/* A simplified version of g_steal_pointer without type-safety. */
static inline gpointer
_srt_steal_pointer (gpointer pointer_to_pointer)
{
gpointer *pp = pointer_to_pointer;
gpointer ret;
ret = *pp;
*pp = NULL;
return ret;
}
#endif
#if !GLIB_CHECK_VERSION(2, 34, 0)
#define g_clear_pointer(x, destroy) _srt_clear_pointer (x, destroy)
/* A simplified version of g_clear_pointer without type-safety. */
static inline void
_srt_clear_pointer (gpointer pointer_to_pointer,
GDestroyNotify destroy)
{
gpointer *pp = pointer_to_pointer;
gpointer p = g_steal_pointer (pp);
if (p != NULL)
destroy (p);
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment