diff --git a/INSTALL b/INSTALL index c0689b99..4f876430 100644 --- a/INSTALL +++ b/INSTALL @@ -20,12 +20,12 @@ WAF build system ---------------- glmark2 previously used the WAF build system, and the builds for some flavors -(dispmanx, win32, mir) have not been ported to the meson build system. For such +(dispmanx, win32) have not been ported to the meson build system. For such cases follow the instructions below. To configure glmark2 use: -$ ./waf configure --with-flavors=dispmanx-glesv2,win32-gl,win32-glesv2,mir-gl,mir-glesv2... [--data-path=DATA_PATH --prefix=PREFIX] +$ ./waf configure --with-flavors=dispmanx-glesv2,win32-gl,win32-glesv2... [--data-path=DATA_PATH --prefix=PREFIX] To build use: diff --git a/src/gl-state-egl.cpp b/src/gl-state-egl.cpp index 3a16dc04..0d738599 100644 --- a/src/gl-state-egl.cpp +++ b/src/gl-state-egl.cpp @@ -479,8 +479,6 @@ GLStateEGL::getVisualConfig(GLVisualConfig& vc) #define GLMARK2_NATIVE_EGL_DISPLAY_ENUM EGL_PLATFORM_WAYLAND_KHR #elif GLMARK2_USE_DRM #define GLMARK2_NATIVE_EGL_DISPLAY_ENUM EGL_PLATFORM_GBM_KHR -#elif GLMARK2_USE_MIR -#define GLMARK2_NATIVE_EGL_DISPLAY_ENUM EGL_PLATFORM_MIR_KHR #else // Platforms not in the above platform enums fall back to eglGetDisplay. #define GLMARK2_NATIVE_EGL_DISPLAY_ENUM 0 diff --git a/src/main.cpp b/src/main.cpp index 9c52a542..d1077fe7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,8 +41,6 @@ #include "native-state-drm.h" #elif GLMARK2_USE_GBM #include "native-state-gbm.h" -#elif GLMARK2_USE_MIR -#include "native-state-mir.h" #elif GLMARK2_USE_WAYLAND #include "native-state-wayland.h" #elif GLMARK2_USE_DISPMANX @@ -166,8 +164,6 @@ main(int argc, char *argv[]) NativeStateDRM native_state; #elif GLMARK2_USE_GBM NativeStateGBM native_state; -#elif GLMARK2_USE_MIR - NativeStateMir native_state; #elif GLMARK2_USE_WAYLAND NativeStateWayland native_state; #elif GLMARK2_USE_DISPMANX diff --git a/src/native-state-mir.cpp b/src/native-state-mir.cpp deleted file mode 100644 index 173cc3a5..00000000 --- a/src/native-state-mir.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright © 2013 Canonical Ltd - * - * This file is part of the glmark2 OpenGL (ES) 2.0 benchmark. - * - * glmark2 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 3 of the License, or (at your option) any later - * version. - * - * glmark2 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. - * - * You should have received a copy of the GNU General Public License along with - * glmark2. If not, see . - * - * Authors: - * Alexandros Frantzis - */ -#include "native-state-mir.h" -#include "log.h" - -/****************** - * Public methods * - ******************/ - -namespace -{ - -const MirDisplayOutput* -find_active_output(const MirDisplayConfiguration* conf) -{ - const MirDisplayOutput *output = NULL; - - for (uint32_t d = 0; d < conf->num_outputs; d++) - { - const MirDisplayOutput* out = &conf->outputs[d]; - - if (out->used && out->connected && - out->num_modes && out->current_mode < out->num_modes) - { - output = out; - break; - } - } - - return output; -} - -MirPixelFormat -find_best_surface_format(MirConnection* connection) -{ - static const unsigned int formats_size = 10; - MirPixelFormat formats[formats_size]; - unsigned int num_valid_formats = 0; - MirPixelFormat best_format = mir_pixel_format_invalid; - - mir_connection_get_available_surface_formats(connection, - formats, - formats_size, - &num_valid_formats); - - /* - * Surface formats come sorted in largest active bits order. - * Prefer opaque formats over formats with alpha, and largest - * formats over smaller ones. - */ - for (unsigned int i = 0; i < num_valid_formats; i++) - { - if (formats[i] == mir_pixel_format_xbgr_8888 || - formats[i] == mir_pixel_format_xrgb_8888 || - formats[i] == mir_pixel_format_bgr_888) - { - best_format = formats[i]; - break; - } - else if (best_format == mir_pixel_format_invalid) - { - best_format = formats[i]; - } - } - - return best_format; -} - -class DisplayConfiguration -{ -public: - DisplayConfiguration(MirConnection* connection) - : display_config(mir_connection_create_display_config(connection)) - { - } - - ~DisplayConfiguration() - { - if (display_config) - mir_display_config_destroy(display_config); - } - - bool is_valid() - { - return display_config != 0; - } - - operator MirDisplayConfiguration*() const - { - return display_config; - } - -private: - MirDisplayConfiguration* display_config; -}; -} - -volatile sig_atomic_t NativeStateMir::should_quit_(false); - -NativeStateMir::~NativeStateMir() -{ - if (mir_surface_) - mir_surface_release_sync(mir_surface_); - if (mir_connection_) - mir_connection_release(mir_connection_); -} - -bool -NativeStateMir::init_display() -{ - struct sigaction sa; - sa.sa_handler = &NativeStateMir::quit_handler; - sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); - - sigaction(SIGINT, &sa, NULL); - sigaction(SIGTERM, &sa, NULL); - - mir_connection_ = mir_connect_sync(NULL, "glmark2"); - - if (!mir_connection_is_valid(mir_connection_)) { - Log::error("Couldn't connect to the Mir display server\n"); - return false; - } - - return true; -} - -void* -NativeStateMir::display() -{ - if (mir_connection_is_valid(mir_connection_)) - return static_cast(mir_connection_get_egl_native_display(mir_connection_)); - - return 0; -} - -bool -NativeStateMir::create_window(WindowProperties const& properties) -{ - static const char *win_name("glmark2 " GLMARK_VERSION); - - if (!mir_connection_is_valid(mir_connection_)) { - Log::error("Cannot create a Mir surface without a valid connection " - "to the Mir display server!\n"); - return false; - } - - /* Recreate an existing window only if it has actually been resized */ - if (mir_surface_) { - if (properties_.fullscreen != properties.fullscreen || - (properties.fullscreen == false && - (properties_.width != properties.width || - properties_.height != properties.height))) - { - mir_surface_release_sync(mir_surface_); - mir_surface_ = 0; - } - else - { - return true; - } - } - - uint32_t output_id = mir_display_output_id_invalid; - - properties_ = properties; - - if (properties_.fullscreen) { - DisplayConfiguration display_config(mir_connection_); - if (!display_config.is_valid()) { - Log::error("Couldn't get display configuration from the Mir display server!\n"); - return false; - } - - const MirDisplayOutput* active_output = find_active_output(display_config); - if (active_output == NULL) { - Log::error("Couldn't find an active output in the Mir display server!\n"); - return false; - } - - const MirDisplayMode* current_mode = - &active_output->modes[active_output->current_mode]; - - properties_.width = current_mode->horizontal_resolution; - properties_.height = current_mode->vertical_resolution; - output_id = active_output->output_id; - - Log::debug("Making Mir surface fullscreen on output %u (%ux%u)\n", - output_id, properties_.width, properties_.height); - } - - MirPixelFormat surface_format = find_best_surface_format(mir_connection_); - if (surface_format == mir_pixel_format_invalid) { - Log::error("Couldn't find a pixel format to use for the Mir surface!\n"); - return false; - } - - Log::debug("Using pixel format %u for the Mir surface\n", surface_format); - - MirSurfaceSpec* spec = - mir_connection_create_spec_for_normal_surface(mir_connection_, - properties_.width, - properties_.height, - surface_format); - mir_surface_spec_set_name(spec, win_name); - mir_surface_spec_set_buffer_usage(spec, mir_buffer_usage_hardware); - if (output_id != mir_display_output_id_invalid) - mir_surface_spec_set_fullscreen_on_output(spec, output_id); - - mir_surface_ = mir_surface_create_sync(spec); - mir_surface_spec_release(spec); - - if (!mir_surface_ || !mir_surface_is_valid(mir_surface_)) { - Log::error("Failed to create Mir surface!\n"); - return false; - } - - return true; -} - -void* -NativeStateMir::window(WindowProperties& properties) -{ - properties = properties_; - - if (mir_surface_) - { - MirBufferStream* bstream = mir_surface_get_buffer_stream(mir_surface_); - return static_cast(mir_buffer_stream_get_egl_native_window(bstream)); - } - - return 0; -} - -void -NativeStateMir::visible(bool /*visible*/) -{ -} - -bool -NativeStateMir::should_quit() -{ - return should_quit_; -} - -/******************* - * Private methods * - *******************/ - -void -NativeStateMir::quit_handler(int /*signum*/) -{ - should_quit_ = true; -} diff --git a/src/native-state-mir.h b/src/native-state-mir.h deleted file mode 100644 index a6150e96..00000000 --- a/src/native-state-mir.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright © 2013 Canonical Ltd - * - * This file is part of the glmark2 OpenGL (ES) 2.0 benchmark. - * - * glmark2 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 3 of the License, or (at your option) any later - * version. - * - * glmark2 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. - * - * You should have received a copy of the GNU General Public License along with - * glmark2. If not, see . - * - * Authors: - * Alexandros Frantzis - */ -#ifndef GLMARK2_NATIVE_STATE_MIR_H_ -#define GLMARK2_NATIVE_STATE_MIR_H_ - -#include "native-state.h" -#include -#include - -class NativeStateMir : public NativeState -{ -public: - NativeStateMir() : mir_connection_(0), mir_surface_(0), properties_() {} - ~NativeStateMir(); - - bool init_display(); - void* display(); - bool create_window(WindowProperties const& properties); - void* window(WindowProperties& properties); - void visible(bool v); - bool should_quit(); - void flip() { } - -private: - static void quit_handler(int signum); - static volatile std::sig_atomic_t should_quit_; - - MirConnection* mir_connection_; - MirSurface* mir_surface_; - WindowProperties properties_; -}; - -#endif /* GLMARK2_NATIVE_STATE_MIR_H_ */ diff --git a/src/wscript_build b/src/wscript_build index e5df7c87..373c1d32 100644 --- a/src/wscript_build +++ b/src/wscript_build @@ -82,8 +82,6 @@ flavor_sources = { 'dispmanx-glesv2' : common_flavor_sources + ['native-state-dispmanx.cpp', 'gl-state-egl.cpp'], 'drm-gl' : common_flavor_sources + ['native-state-drm.cpp', 'gl-state-egl.cpp'], 'drm-glesv2' : common_flavor_sources + ['native-state-drm.cpp', 'gl-state-egl.cpp'], - 'mir-gl' : common_flavor_sources + ['native-state-mir.cpp', 'gl-state-egl.cpp'], - 'mir-glesv2' : common_flavor_sources + ['native-state-mir.cpp', 'gl-state-egl.cpp'], 'wayland-gl' : common_flavor_sources + ['native-state-wayland.cpp', 'gl-state-egl.cpp'], 'wayland-glesv2' : common_flavor_sources + ['native-state-wayland.cpp', 'gl-state-egl.cpp'], 'win32-gl': common_flavor_sources + ['native-state-win32.cpp', 'gl-state-wgl.cpp'], @@ -95,8 +93,6 @@ flavor_uselibs = { 'dispmanx-glesv2' : ['glad-egl-dispmanx', 'glad-glesv2', 'matrix-glesv2', 'common-glesv2', 'dispmanx'], 'drm-gl' : ['drm', 'gbm', 'udev', 'glad-egl-drm', 'glad-gl', 'matrix-gl', 'common-gl'], 'drm-glesv2' : ['drm', 'gbm', 'udev', 'glad-egl-drm', 'glad-glesv2', 'matrix-glesv2', 'common-glesv2'], - 'mir-gl' : ['mirclient', 'glad-egl-mir', 'glad-gl', 'matrix-gl', 'common-gl'], - 'mir-glesv2' : ['mirclient', 'glad-egl-mir', 'glad-glesv2', 'matrix-glesv2', 'common-glesv2'], 'wayland-gl' : ['wayland-client', 'wayland-egl', 'wayland-cursor', 'glad-egl-wayland', 'glad-gl', 'matrix-gl', 'common-gl'], 'wayland-glesv2' : ['wayland-client', 'wayland-egl', 'wayland-cursor', 'glad-egl-wayland', 'glad-glesv2', 'matrix-glesv2', 'common-glesv2'], 'win32-gl': ['glad-gl', 'glad-wgl', 'matrix-gl', 'common-gl'], @@ -109,8 +105,6 @@ flavor_defines = { 'dispmanx-glesv2' : ['GLMARK2_USE_DISPMANX', 'GLMARK2_USE_GLESv2', 'GLMARK2_USE_EGL'], 'drm-gl' : ['GLMARK2_USE_DRM', 'GLMARK2_USE_GL', 'GLMARK2_USE_EGL'], 'drm-glesv2' : ['GLMARK2_USE_DRM', 'GLMARK2_USE_GLESv2', 'GLMARK2_USE_EGL'], - 'mir-gl' : ['GLMARK2_USE_MIR', 'GLMARK2_USE_GL', 'GLMARK2_USE_EGL'], - 'mir-glesv2' : ['GLMARK2_USE_MIR', 'GLMARK2_USE_GLESv2', 'GLMARK2_USE_EGL'], 'wayland-gl' : ['GLMARK2_USE_WAYLAND', 'GLMARK2_USE_GL', 'GLMARK2_USE_EGL'], 'wayland-glesv2' : ['GLMARK2_USE_WAYLAND', 'GLMARK2_USE_GLESv2', 'GLMARK2_USE_EGL'], 'win32-gl': ['GLMARK2_USE_WIN32', 'GLMARK2_USE_WGL', 'GLMARK2_USE_GL'], @@ -122,8 +116,6 @@ flavor_libs = { 'dispmanx-glesv2' : [], 'drm-gl' : [], 'drm-glesv2' : [], - 'mir-gl' : [], - 'mir-glesv2' : [], 'wayland-gl' : [], 'wayland-glesv2' : [], 'win32-gl': ['opengl32', 'gdi32'], @@ -135,8 +127,6 @@ flavor_depends_on = { 'dispmanx-glesv2' : [], 'drm-gl' : [], 'drm-glesv2' : [], - 'mir-gl' : [], - 'mir-glesv2' : [], 'wayland-gl' : ['xdg-shell-client-protocol.h', 'xdg-shell-protocol.c'], 'wayland-glesv2' : ['xdg-shell-client-protocol.h', 'xdg-shell-protocol.c'], 'win32-gl': [], @@ -148,8 +138,6 @@ flavor_sources_gen = { 'dispmanx-glesv2' : [], 'drm-gl' : [], 'drm-glesv2' : [], - 'mir-gl' : [], - 'mir-glesv2' : [], 'wayland-gl' : [bld.path.find_or_declare('xdg-shell-protocol.c')], 'wayland-glesv2' : [bld.path.find_or_declare('xdg-shell-protocol.c')], 'win32-gl': [], @@ -160,7 +148,6 @@ flavor_sources_gen = { egl_platform_defines = { 'dispmanx' : ['MESA_EGL_NO_X11_HEADERS'], 'drm' : ['__GBM__'], - 'mir' : ['MESA_EGL_NO_X11_HEADERS'], 'wayland' : ['WL_EGL_PLATFORM'], 'win32' : [], 'x11' : [], diff --git a/wscript b/wscript index cecc3d97..5af78981 100644 --- a/wscript +++ b/wscript @@ -11,8 +11,6 @@ FLAVORS = { 'dispmanx-glesv2' : 'glmark2-es2-dispmanx', 'drm-gl' : 'glmark2-drm', 'drm-glesv2' : 'glmark2-es2-drm', - 'mir-gl' : 'glmark2-mir', - 'mir-glesv2' : 'glmark2-es2-mir', 'wayland-gl' : 'glmark2-wayland', 'wayland-glesv2' : 'glmark2-es2-wayland', 'win32-gl': 'glmark2-win32', @@ -212,7 +210,6 @@ def configure_linux(ctx): ('libdrm','drm', None, list_contains(ctx.options.flavors, 'drm')), ('gbm','gbm', None, list_contains(ctx.options.flavors, 'drm')), ('libudev', 'udev', None, list_contains(ctx.options.flavors, 'drm')), - ('mirclient','mirclient', '0.13', list_contains(ctx.options.flavors, 'mir')), ('wayland-client','wayland-client', None, list_contains(ctx.options.flavors, 'wayland')), ('wayland-cursor','wayland-cursor', None, list_contains(ctx.options.flavors, 'wayland')), ('wayland-egl','wayland-egl', None, list_contains(ctx.options.flavors, 'wayland'))]