1
0
Fork 0
Commit graph

497 commits

Author SHA1 Message Date
Rui Matos
76b6cc02d6 meta-monitor-config: Initialize MetaConfiguration's properly
We weren't initializing the ref count which means we could either be
leaking or end up using free'd memory.

https://bugzilla.gnome.org/show_bug.cgi?id=774135
2016-11-21 15:34:26 +01:00
Jonas Ådahl
eed4dab0fc wayland: Add support for EGLStream client buffers
This commit adds for a new type of buffer being attached to a Wayland
surface: buffers from an EGLStream. These buffers behave very
differently from regular Wayland buffers; instead of each buffer
reperesenting an actual frame, the same buffer is attached over and
over again, and EGL API is used to switch the content of the OpenGL
texture associated with the buffer attached. It more or less
side-tracks the Wayland buffer handling.

It is implemented by creating a MetaWaylandEglStream object, dealing
with the EGLStream state. The lifetime of the MetaWaylandEglStream is
tied to the texture object (CoglTexture), which is referenced-counted
and owned by both the actors and the MetaWaylandBuffer.

When the buffer is reattached and committed, the EGLStream is triggered
to switch the content of the associated texture to the new content.
This means that one cannot keep old texture content around without
copying, so any feature relying on that will effectively be broken.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
f5bdf75f70 egl: Add vfuncs needed for client EGLStream surfaces
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
659c987335 egl: Add helpers for importing Wayland buffers as EGLImage's
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
18b9cf8a85 egl: Allow passing NULL as error
When calling an EGL function is expected to sometimes fail, we might
not care about the error.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
934184e236 MetaRendererNative: Add EGLDevice based rendering support
This commit adds support for using a EGLDevice and EGLStreams for
rendering on top of KMS instead of gbm. It is disabled by default; to
enable it pass --enable-egl-device to configure.

By default gbm is first tried, and if it fails, the EGLDevice path is
tried. If both fails, mutter will terminate just as before.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
b735bdcf2f MetaEgl: Add EGL procs necessary for EGLDevice based rendering
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
b1597b4291 MetaOnscreenNative: Allocate for real after cogl_framebuffer_allocate
There is no way to pass any backend specific parameters to a
CoglFramebuffer until after it has been allocated by
cogl_framebuffer_allocate() (since this is where the winsys/platform
fields are initialized). This can make it hard to actually allocate
anything, if the platform depends on some backend specific data.

A proper solution would be to refactor the onscreens and framebuffers to
use a GObject based type system instead of the home baked Cogl one, but
that'll be left for another day. For now, allocate in two steps, one to
allocate the backend specific parts (MetaOnscreenNative), and one to
allocate the actual onscreen framebuffer (via
meta_onscreen_native_allocate()).

So far there is nothing that forces this separation, but in the future
there will, for example EGLDevice's need to know about the CRTC in
order to create the EGLSurface.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
faa96444b5 MetaRendererNative: Add helper for getting the next framebuffer id
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
78c121eb10 egl: Add eglInitialize helper
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
cb6adc45d1 MetaRendererNative: Warn instead of wait when swapping flip in progress
A swap-buffers should never be issued when we are waiting for a flipped
callback, so instead of trying to handle a situation that sholud never
happen, warn instead.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
59b4b5e9e8 MetaOnscreenNative: Make flip waiting state more generic
Use a boolean to keep track whether a flipped event is pending or not,
and use that instead of looking at the framebuffer id field.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
ad784501a6 backends/native: Don't set discarded framebuffer as current
When a swap failed with EACCES (possibly due to VT switching), don't
mark the framebuffer as 'in use', so that it'll be cleaned up properly
and not set as current.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
68d690225a MetaCursorRendererNative: Fall back to texture when there is no gbm
For when there is no gbm available, for example when using
EGLDevice/EGLStream's, just fall back to the OpenGL texture based
cursor rendering path.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
8f716772c2 cogl: Make platforms set the EGL_SURFACE_TYPE
Cogl has no way to know how to properly set the surface type, so lets
outsource that to the platform layer.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
da21f02eb9 MetaRendererNative: Always use eglGetPlatformDisplay
Drivers may be bad at guessing what is passed to eglGetDisplay, ending
up return non-functioning EGLDisplay's. Using eglGetPlatformDisplay
avoids this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
4ce7d3a772 MetaRendererNative: Log error reason when failing to create gbm device
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
77b7ecfd04 backends/native: Pass KMS file path to renderer
The KMS file path will later be used for EGLDevice based rendering.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
da1c1d9c22 MetaRendererNative: Use pbuffer surface as dummy surface
Lets use a pbuffer surface as a dummy surface instead of a gbm based
one, so that we don't need to rely on the availability of gbm to create
a dummy surface when there is no need for it.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
f7cd6af9c6 MetaRendererNative: Put gbm initialization in its own function
Separate gbm initialization from general renderer initialization. Do
this even though no other initialization is done for now; later there
will will be other types of rendering mode, initialized in their own
functions.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
678ebbb7f6 MetaRendererNative: Put gbm related things in an anonymous struct
In order to separate gbm related fields from generic ones, put them in
anonymous structs.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
87d6e45da5 MetaEgl: Add eglGetPlatformDisplayEXT helper
Prepare a helper function for the more reliable way to get a platform
display.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
80c61c4b3b MetaEgl: Add EGL extensions support
Add proc symbol loading and helper functions for calling them, dealing
with errors etc. So far no extension symbols are loaded, only the
infrastructure is there.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
4547c6e9f3 MetaLauncher: Remember the KMS file path
Not only keep the KMS fd around, also remember the file path used. This
will later be used when initializing a EGLDevice based renderer.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
cde622b8e1 MetaRendererNative: Get EGLDisplay on init
Use MetaEgl to get the EGLDisplay on initialization; use that when
constructing the Cogl renderer.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
8b810193dd MetaRendererNative: GLib:ify a few Cogl types
In another step getting rid of the duplications introduced by Cogl,
use the equivalent GLib types where Cogl types previously used. While
CoglBool is not a typedef to gboolean, they are both typedefs to int,
and we already use GLib's TRUE/FALSE to set them.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
22f019826c Add EGL abstraction class MetaEgl
Add a MetaEgl meant to deal with EGL. It is intended to be use by EGL
based renderers and handle extension symbols loading, handle errors etc.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
7fa3f41df2 MetaBackendNative: Initialize GError pointer
Initialize the GError pointer used when creating the renderer. If an
error occurs, the error is expected to be NULL, otherwise it'll
misinterpreted as already set.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Rui Matos
925b1aec64 meta-input-settings-x11: Don't try setting unavailable scroll methods
Since doing so causes BadValue X errors.

https://bugzilla.gnome.org/show_bug.cgi?id=771744
2016-11-16 13:50:33 +01:00
Carlos Garnacho
ff9753688f backends/x11: Implement tablet settings based on the Wacom driver
This is a stopgap solution until libinput is the fallback driver
handling tablets and pads.

https://bugzilla.gnome.org/show_bug.cgi?id=773779
2016-11-04 21:25:31 +01:00
Carlos Garnacho
b35b531f00 backends: extend tablet device checks
The Clutter X11 backend can't drop CLUTTER_PEN_DEVICE and
CLUTTER_ERASER_DEVICE in favor of CLUTTER_TABLET_DEVICE without
losing information (as the driver will create one device for each).
So make MetaInputSettings cater for both sets of device types.

https://bugzilla.gnome.org/show_bug.cgi?id=773779
2016-11-04 21:25:31 +01:00
Carlos Garnacho
6257f1195b backends: Remove ToolSettings struct
Its only purpose was caching settings applying to an stylus/tool, this
is now handled through ClutterInputDeviceTool evdev specific API, or
X device properties, so is not needed anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=773779
2016-11-04 21:25:31 +01:00
Carlos Garnacho
b252771a8f clutter/evdev: Take over stylus configuration
Stylus configuration (stylus buttons, pressure) was handled
at the very high level, doing the button and pressure translations
right before sending these to wayland clients.

However, it makes more sense to store these settings into the
ClutterInputDeviceTool itself, and have clutter apply the config
at the lower level so 1) the settings actually apply desktop-wide,
not just in clients and 2) X11 and wayland may share similar
configuration paths. The settings are now just applied whenever
the tool enters proximity, in reaction to
ClutterDeviceManager::tool-changed.

This commit moves all handling of these two settings to
the clutter level, and removes the wayland-specific paths

https://bugzilla.gnome.org/show_bug.cgi?id=773779
2016-11-04 21:25:31 +01:00
Carlos Garnacho
cea7d629d9 backends: Add missing pad button-to-keycombo translation
https://bugzilla.gnome.org/show_bug.cgi?id=773779
2016-11-04 21:25:31 +01:00
Carlos Garnacho
db9d8fcc90 Revert "backends: Use g-s-d settings for tablet configuration"
This reverts commit b52f304f9d.

https://bugzilla.gnome.org/show_bug.cgi?id=773779
2016-11-04 21:25:31 +01:00
Rui Matos
2641b364e8 MetaInputSettings: fix two finger preference over edge scrolling logic
Enabling edge scrolling before disabling two finger would result in
edge scrolling not actually being enabled because two finger is still
enabled at the time and we bail out.

This patch moves this logic to common code for both the native and X
backends and fixes it by ensuring that both settings are never set at
the same time and still re-checking if edge scrolling should be
enabled after two finger scrolling gets disabled.

We also simplify the code by not checking for supported/available
settings since the underlying devices will just reject those values
and there isn't anything we can do about it here. It's the UI's job to
only show supported/available settings to users.

https://bugzilla.gnome.org/show_bug.cgi?id=771744
2016-11-02 14:07:13 +01:00
Rui Matos
fb5e591bc9 MetaInputSettingsNative: allow unsetting click and scroll methods
Checking for supported methods isn't needed since libinput will just
error out and do nothing itself if a requested method isn't supported
and, in fact, this logic was preventing the enum values 0 from being
set.

https://bugzilla.gnome.org/show_bug.cgi?id=771744
2016-11-02 14:07:11 +01:00
Ray Strode
d491063110 native: don't call steal_pointer prematurely
commit e2bfaf0751 does this:

g_hash_table_insert (cards,
                     g_udev_device_get_name (parent_device),
                     g_steal_pointer (&parent_device));

The problem is the g_steal_pointer call may happen before the
g_udev_device_get_name call leading to a crash.

This commit does the get_name call on an earlier line

https://bugzilla.gnome.org/show_bug.cgi?id=771442
2016-10-19 15:23:37 -04:00
Ray Strode
e2bfaf0751 native: fail on systems with connectors spread across multiple gpus
We don't support using more than one GPU for output yet, so we should fail
if we encounter that situation, so GDM will fall back to X.

https://bugzilla.gnome.org/show_bug.cgi?id=771442
2016-10-19 13:08:19 -04:00
Ray Strode
f1e1a5ff06 native: shore up matching of card device
Right now we accept any character device that matches the glob card*.

That's fine, but we can be a little more specific by checking that
the devtype is what we expect.

This commit does that.

https://bugzilla.gnome.org/show_bug.cgi?id=771442
2016-10-19 11:21:32 -04:00
Ray Strode
ef2000053a native: only match drm subsystem devices
Despite g_udev_client_new taking a list of subsystems, it doesn't
implicitly filter results to those subsystems.

This commit explicitly adds a subsystem match to make sure sound cards
don't end up in the resulting list of video cards.

https://bugzilla.gnome.org/show_bug.cgi?id=771442
2016-10-19 10:14:13 -04:00
Rui Matos
1d4a5a7520 MetaOnscreenNative: fix mirror mode with stage views
Using the view's MetaMonitorInfo to find all the crtcs which should be
configured to display a given onscreen doesn't work unfortunately. The
association runs only the other way around, i.e. we need to go through
each crtc and find the ones corresponding to our monitor info.

https://bugzilla.gnome.org/show_bug.cgi?id=773115
2016-10-18 14:11:10 +02:00
Rui Matos
8290e1f09a MetaRendererNative: don't call drmModeGetResources()
There's no need to call this and we were leaking the returned memory.

https://bugzilla.gnome.org/show_bug.cgi?id=773116
2016-10-18 14:10:58 +02:00
Rui Matos
89672fad04 MetaMonitorManageKms: plug a GArray leak
https://bugzilla.gnome.org/show_bug.cgi?id=773116
2016-10-18 14:10:55 +02:00
Rui Matos
280e297afe MetaIdleMonitorNative: initialize last event timestamp
If this isn't initialized and an idle watch gets instanced before
meta_idle_monitor_native_reset_idletime() gets called, that idle watch
would get triggered as soon as we hit the main loop.

This was causing gnome-session to go into idle mode at session start
thus making gnome-shell lock the screen.

In the past this bug was being masked by either logind emiting
session active signals or a stray input event making it through at
startup.

https://bugzilla.gnome.org/show_bug.cgi?id=772839
2016-10-17 13:47:20 +02:00
Rui Matos
5261638bfd meta-monitor-config: Look at an output's modes directly when assigning
Going through the global mode pool and then checking if the mode is
available for a given output is pointless work since we can look at
the output's available modes directly.

This implicitly changes how we choose the default mode since, instead
of relying on the sort order of the global modes array, we now rely on
the sort order of the output modes array. Still not ideal, but at
least it makes more sense since the global array is essentially
unsorted.

https://bugzilla.gnome.org/show_bug.cgi?id=772176
2016-10-10 22:37:13 +02:00
Rui Matos
04b75c45f8 MetaMonitorManagerKms: stop taking drmModeModeInfo.vrefresh directly
As in the previous commit, this value already has mode flags baked in
and we can always get the value we need by computing it ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=772176
2016-10-10 22:37:11 +02:00
Rui Matos
a50950cf8f MetaMonitorManagerKms: stop accounting for mode flags in refresh rates
This isn't technically needed and, in fact, makes us default to
interlaced modes in some cases which isn't desirable.

Note that X doesn't account for these flags either for its mode
refresh rates.

https://bugzilla.gnome.org/show_bug.cgi?id=772176
2016-10-10 22:36:47 +02:00
Florian Müllner
f1850e0d61 monitor-manager-kms: Fix compiler warning
As the m format specifier doesn't consume any arguments, the number
of varargs currently doesn't match the number of specifiers; the
failed transform may be relevant, so include it in the message
instead of removing the excess argument.
2016-10-08 22:38:26 +02:00
Carlos Garnacho
e3dab70754 backends: Use fallback rotation if native DRM plane rotation failed
Blacklist the HW mode so we fallback gracefully to our own paths.

https://bugzilla.gnome.org/show_bug.cgi?id=772512
2016-10-07 17:19:46 +02:00