1
0
Fork 0
Commit graph

573 commits

Author SHA1 Message Date
Jonas Ådahl
6de3e4a07e Turn MetaLogicalMonitor into a GObject
This will make it easier to move various manually managed data and data
now in MetaLogicalMonitor into GObject QData fields.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
1fb0e8e9bb monitor-manager: Store logical monitors in a GList
Instead of storing the logical monitors in an array and having users
either look up them in the array given an index or iterate using
indices, put it in a GList, and use GList iterators when iterating and
alternative API where array indices were previously used.

This allows for more liberty regarding the type of the logical monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
20b8743f21 monitor-manager: Refactor tiled monitor assembly code
Refactor the tiled monitor assembly code (that constructs a logical
monitor out of tiling information. Part of the reason is to move away
from array based storage, part is to make the code easier to follow,
and part is to separate logical monitor construction from list
manipulation.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
c98bab8327 monitor-manager: Make logical monitor from point API take floats
Change meta_monitor_manager_get_logical_monitor_at() to use floats,
replace users of meta_monitor_manager_get_monitor_at_point() to use the
API that returns a logical monitor and remove the now unused function.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
a422d6fe08 Move logical monitor neighbor API into monitor manager
Move the last piece of monitor grid getter API to the monitor manager
away from MetaScreen. The public facing API are still there, but are
thin wrappers around the MetaMonitorManager API.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
5a8509f895 Move current logical monitor retrieval to the backends
The method used for getting the current logical monitor (the monitor
where the pointer cursor is currently at) depends on the backend type,
so move that logic to the corresponding backends.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
af616c96d4 Move more logical monitor getters from the screen to the monitor manager
Turning a rectangle into a logical monitor also has nothing to do with
the screen (MetaScreen) so move it to MetaMonitorManager which has that
information.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
f5b2d79f3b backends: Use macros for declaring the backend types
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
d644993a74 MetaBackend: Move fields from MetaBackend into MetaBackendPrivate
Lets prepare for being able to declare the MetaBackend type using
the macro helper.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
2df4ebff47 Put logical monitor grid lookup API in MetaMonitorManager
Don't falsely assume the screen has anything to do with the monitor
grid, and thus move the related API to MetaMonitorManager.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:52 +08:00
Jonas Ådahl
317b734dcc Move cursor tracker ownership to the backend
Let the backend initialize the cursor tracker, and change all call
sites to get the cursor tracker from the backend instead of from the
screen. It wasn't associated with the screen anyway, so the API was
missleading.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
e35ac9be8d cursor-tracker: Don't cache a private pointer to the cursor renderer
This means we don't rely on contruction order any more.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
e659b07c39 MetaMonitorManager: Add API turning monitor index into logical monitor
This is the current equivalent of looking up the logical monitor in the
logical monitor array using the number, but eventually that will be
deprecated, and before that done differently, so add a temporary helper
for the places that has not been ported yet.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
c936056663 MetaMonitorManager: Track primary monitor by pointer instead of index
Instead of keeping an index in an array to keep track of the current
primary logical monitor, just keep a pointer instead.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
e22bbd4b14 MetaScreen: Remove redundant copy of logical monitors array
It was just pointer to the actual list; having to synchronize a list of
logical monitors with the actual monitors managed by the backend is
unnecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
842ff5d6aa Rename MetaMonitorInfo MetaLogicalMonitor
In preparation for further refactorizations, rename the MetaMonitorInfo
struct to MetaLogicalMonitor. Eventually, part of MetaLogicalMonitor
will be split into a MetaMonitor type.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Jonas Ådahl
4177d4f9f4 MetaMonitorManagerKms: Don't leak tile property blob
Also warn when we don't understand the property blob we got.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Bastien Nocera
9b64e09a24 egl: Fix GCC warning
src/backends/meta-egl.c: In function ‘set_egl_error’:
src/backends/meta-egl.c:144:16: error: format not a string literal and no format arguments [-Werror=format-security]
      error_str);
      ^~~~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=777389
2017-01-17 14:22:27 +01:00
Jonas Ådahl
2df35d636e MetaWaylandEglStream: Use EGL_WL_wayland_eglstream instead of fd hack
Use the proposed EGL_WL_wayland_eglstream EGL extension instead of the
file descriptor hack that was used as a temporary solution.

Note that this results in EGL clients will no longer work if they are
running on a Nvidia driver with a version older than 370.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2017-01-03 17:50:03 +08:00
Jonas Ådahl
0a826da330 egl: Add EGL_WL_wayland_eglstream helpers
These are to replace the file descriptor hack currently in use.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2017-01-03 17:50:03 +08:00
Jonas Ådahl
139bed73f8 MetaRendererNative: Remove unnecessary ifdef
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2017-01-03 17:50:03 +08:00
Jonas Ådahl
778f92e170 egl: Use correct proc to meta_egl_stream_consumer_aquire_attrib
It should be eglStreamConsumerAcquireAttribNV and not
eglStreamConsumerAcquireAttribEXT as the EXT variant is not defined in
any extension.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2017-01-03 17:50:03 +08:00
Rui Matos
cfafb0bfca MetaRendererNative: Flush all pending swap notifies on idle
We need to do swap notifications asynchronously from flip events since
these might be processed during swap buffers if we are waiting for the
previous frame's flip to continue with the current.

This means that we might have more than one swap notification queued
to be delivered when the idle handler runs. In that case we must
deliver all notifications for which we've already seen a flip event.

Failing to do so means that if a new frame, that only swaps buffers on
such a swap notification backlogged Onscreen, is started, when later
we get its flip event, we'd notify only an old frame which would hit
this MetaStageNative's frame_cb() early exit:

  if (global_frame_counter <= presented_frame_counter)
    return;

and we'd never finish the new frame and thus clutter's master clock
would be waiting forever stuck.

https://bugzilla.gnome.org/show_bug.cgi?id=774557
2016-12-07 16:48:22 +01:00
Jonas Ådahl
d9a9844005 MetaRendererNative: Don't requeue flush-swap-notify
When flush-swap-notify is already queued, we might end up trying to
requeue it, for example when handling flip callbacks inside
swap-buffers. Actually queuing it there is harmless, since old frames
will be discarded anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=774923
2016-11-23 18:38:46 +01:00
Jonas Ådahl
227187f1f1 MetaRendererNative: Wait for the last flip callback before flipping
We might still end up in swap-buffer without the previous flip callback
having been invoked. This can happen if there are two monitors, and we
manage to draw before having all monitor flip callbacks invoked.

https://bugzilla.gnome.org/show_bug.cgi?id=774923
2016-11-23 18:38:44 +01:00
Jonas Ådahl
77384ffa9a MetaRendererNative: Let the closure handle queuing flip notification
The queuing that was removed in this commit would be done in the clean
up function of the closure anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=774923
2016-11-23 18:38:43 +01:00
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
Olav Vitters
028157081c Fix string format build error
backends/meta-input-settings.c:1245:27: error: format '%lx' expects
argument of type 'long unsigned int', but argument 3 has type 'guint64
{aka long long unsigned int}' [-Werror=format=]
2016-09-22 21:00:29 +02:00
Carlos Garnacho
3137ddb1a1 backends: Handle tablet settings lookups with no backing libwacom info
Those will be unseen by g-s-d/g-c-c, so no settings will be written on
disk for those. Still, look up an ID correctly in this case instead of
crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=771628
2016-09-19 22:55:30 +02:00
Carlos Garnacho
b52f304f9d backends: Use g-s-d settings for tablet configuration
This is needed to make the wayland backend react to configuration
changes until gnome-control-center is updated to use the
gsettings-desktop-schemas settings.

https://bugzilla.gnome.org/show_bug.cgi?id=771315
2016-09-12 21:51:00 +02:00
Rui Matos
9a076076c0 monitor-manager-kms: Add common modes
Some output devices only advertise their preferred mode even though
they're able to display others too. This means we can include some
common modes in each output's supported list.

This is particularly important for mirroring, since we can only mirror
outputs which are using the same resolution.

https://bugzilla.gnome.org/show_bug.cgi?id=744544
2016-09-12 20:02:03 +02:00
Carlos Garnacho
0f0b25767d backends: Add comment to translators in "Switch monitor" string
Without context it's not clear to what it actually refers to. Add some
context.

https://bugzilla.gnome.org/show_bug.cgi?id=770929
2016-09-12 19:45:09 +02:00
Olivier Fourdan
4c106a9c9b wayland: save/restore numlock state
Save the state on NumLock so that is can be (optionally) restored on
next login.

bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=757943
2016-09-09 19:07:10 +02:00
Rui Matos
2c1d3e5b70 cursor-renderer: Add a cursor painted signal
This signal allows interested parties to be notified of a new cursor
frame being painted regardless of whether it's being painted by the
backend directly or if it's a software rendered cursor frame handled
by clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=749913
2016-08-31 20:10:14 +02:00
Jonas Ådahl
262e184fe7 Default to using stage views
Instead of hiding stage views enablement behind MUTTER_STAGE_VIEWS=1,
default to enable it, while making it possible to disable using
MUTTER_STAGE_VIEWS=0 instead.

https://bugzilla.gnome.org/show_bug.cgi?id=770366
2016-08-30 22:56:56 +08:00
Rui Matos
c8f24721c5 monitor-manager-kms: Use the output naming logic used by the X server
Switch to the output naming logic used by the X server's modesetting
driver which, in particular, uses drmModeConnector's connector_type_id
instead of connector_id.

The kernel generates new connector_id's every time there are changes
which means we can't identify the same monitor on the same connector
after an hardware hotplug. Switching to connector_type_id fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=770338
2016-08-29 15:53:00 +02:00
Rui Matos
7ba803934c monitor-manager-kms: Use the same connector type names as the X server
Switch to the connector type names used by the X server's modesetting
driver which, in particular, fixes DVI-A being labeled DVID.

https://bugzilla.gnome.org/show_bug.cgi?id=770338
2016-08-29 15:52:59 +02:00
Carlos Garnacho
9fb4783957 backends/native: Expose all transform modes in CRTCs
We can only honor this properly in the MUTTER_STAGE_VIEWS=1 case. When using
the legacy view, software implemented transforms are only exposed if there is
only one output, as we can only transform the entire stage there.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:06 +02:00
Carlos Garnacho
9e641f623f backends/native: Set offscreen on the transformed MetaRendererViews
The texture is only created if the view is transformed at the software level,
otherwise the texture is NULL, and rendering happens on the onscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:06 +02:00
Carlos Garnacho
8065ff5a37 backends/native: Refactor onscreen creation into separate function
And use the right size, regarless of view transform.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:05 +02:00
Carlos Garnacho
6ce918661c backends/native: Use framebuffer size on swap_buffers implementation
Instead of ClutterStageView layout, which may be affected by transformations.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:05 +02:00
Carlos Garnacho
a72bd1bd29 backends/native: Set transform on MetaRendererViews
Only do this if mutter uses the multiple stage views feature. This
is uneffective at the moment because no back texture is set yet.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:05 +02:00
Carlos Garnacho
89854f9244 backends: Add MetaStageView::transform property
This property updates the ClutterStageView pipeline, so the texture is applied
with the corresponding transform.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:38:05 +02:00
Carlos Garnacho
54dc10f890 clutter: Add infrastructure to render ClutterStageViews to offscreen
The offscreen is given through the ::back-buffer property, the ClutterStageView
will set up the the CoglPipeline used to render it back to the "onscreen"
framebuffer.

The pipeline can be altered through the setup_pipeline() vfunc, so ClutterStageView
implementations can alter the default behavior of blitting from offscreen to
onscreen with no transformations.

All getters of "the framebuffer" that were expecting to get an onscreen have
been updated to call the right clutter_stage_view_get_onscreen() function.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:36:45 +02:00
Carlos Garnacho
7baa1d8a8d backends/native: Refactor g_object_set() call
Makes sense to update ::layout inside meta_renderer_native_set_legacy_view_size().

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:11:37 +02:00
Carlos Garnacho
4b4eb3a039 backends/native: Remove unneeded call
The call to _cogl_framebuffer_winsys_update_size() results in no-op here,
as the framebuffer has already the right size when rebuilding the views.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:11:37 +02:00
Carlos Garnacho
92c03e8625 backends/native: Split hw supported CRTC rotation modes
Those will need a separate treatment from the modes that we eventually
support through "software", so split those into a separate enum so we
can can do the right thing when applying the configuration.

Also, add a helper function that returns the transform that the software
fallbacks should perform, which should be "normal" if the rotation is
already handled via hw.

The function applying the configuration has been modified to always set
a HW rotation mode (even if normal), when we come to support SW rotation
modes, we'll be relying on a normal transformation, so it will be
necessary to have mixed HW/SW managed transforms.

https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-24 02:09:32 +02:00
Carlos Garnacho
a53ca0d8cf backends: Mark MetaRendererView:info as G_PARAM_STATIC_STRINGS
https://bugzilla.gnome.org/show_bug.cgi?id=745079
2016-08-23 18:14:16 +02:00
Bastien Nocera
c977ba197e backends: Update two-finger scrolling before edge scrolling
As whether edge scrolling is enabled depends on whether two-finger
scrolling is disabled, make sure to update two-finger scrolling first.

Note that this only fixes the problem on startup. Changing the
settings in GSettings directly might cause an inconsistent state, but
the main UI for this setting, gnome-control-center, makes sure to
update two-finger scrolling before edge scrolling.

https://bugzilla.gnome.org/show_bug.cgi?id=769276
2016-08-20 16:00:35 +02:00
Jonas Ådahl
9f6f778589 MetaMonitorManagerKms: Set output scale when assigning crtc
The scale will have been set to 1 no matter what when initializing the
MetaOutput since it at the time didn't have an CRTC assigned to it.
Now, when we assign the CRTC to the output, we need to update the scale.

https://bugzilla.gnome.org/show_bug.cgi?id=769505
2016-08-12 14:58:39 +08:00
Jonas Ådahl
1f657d2c81 monitor-manager: Always set the monitor info scale
https://bugzilla.gnome.org/show_bug.cgi?id=769505
2016-08-12 14:58:39 +08:00