1
0
Fork 0
Commit graph

97 commits

Author SHA1 Message Date
Alban Browaeys
ca7c1d5e02 launcher: Fix drm device detection for non pci devices
On Odroid U2 (exynos4412) the drm device is not bound to pci.
Open the detection to platform device of the drm subsystem, exclusive of
control devices.

https://bugzilla.gnome.org/show_bug.cgi?id=754911
2015-11-12 14:09:02 -05:00
Owen W. Taylor
7fb3ecc12c MetaLauncher: Don't g_error() on failure
g_error() is the wrong thing to do when, for example, we can't find the
DRM device, since Mutter should just fail to start rather than reporting
a bug into automatic bug tracking systems. Rather than trying to decipher
which errors are "expected" and which not, just make all failure paths
in meta_launcher_new() return a GError out to the caller - which we make
exit(1).

https://bugzilla.gnome.org/show_bug.cgi?id=757311
2015-11-06 17:03:59 -05:00
Ray Strode
4c9af7267d Revert "Force cursor update after applying configuration"
This reverts commit 33150569cd.

This was a stow-a-away sitting in my local tree.
2015-11-06 16:24:34 -05:00
Ray Strode
33150569cd Force cursor update after applying configuration
The qxl kms driver has a bug where the cursor gets hidden
implicitly after a drmModeSetCrtc call.

This commit works around the bug by forcing a drmModeSetCursor2
call after the drmModeSetCrtc calls.

This is pretty hacky and won't ever go upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=746078
2015-11-06 14:26:46 -05:00
Florian Müllner
bc00f118f3 Avoid shadowing existing variables 2015-09-24 03:08:22 +02:00
Jonas Ådahl
b7aca07844 Revert "launcher: simplify getting session dbus proxy"
Signals are sent to a specific ID, so we can't use "self" here. After
this revert, VT switching works again.

This reverts commit 8e22bf5bc9.

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-17 12:17:45 +08:00
Florian Müllner
dc780d2c44 launcher: Don't pass variable as format string
We know the variable only contains one or another string literal,
but keep compilers happy as well.
2015-09-16 17:38:10 +02:00
Jonas Ådahl
0373b854c1 MetaCursorRenderer: Rely on update_cursor for redrawing
Calling queue_redraw() in _force_update() is not needed because
update_cursor() will do this when needed, i.e. when switching between
hardware cursor and texture cursor, or when drawing with texture cursor.

There is also no need to force _native_force_update() because
update_cursor() will cover this as well when needed. When not changing
cursor but only the gbm_bo, the "dirty" boolean on the gbm_bo will
trigger a redraw.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Jonas Ådahl
79c86ae890 Support scaling of cursor sprites given what output they are on
This commits refactors cursor handling code and plugs in logic so that
cursor sprites changes appearance as it moves across the screen.
Renderers are adapted to handle the necessary functionality.

The logic for changing the cursor sprite appearance is done outside of
MetaCursorSprite, and actually where depends on what type of cursor it
is. In mutter we now have two types of cursors that may have their
appearance changed:

 - Themed cursors (aka root cursors)
 - wl_surface cursors

Themed cursors are created by MetaScreen and when created, when
applicable(*), it will extend the cursor via connecting to a signal
which is emitted everytime the cursor is moved. The signal handler will
calculate the expected scale given the monitor it is on and reload the
theme in a correct size when needed.

wl_surface cursors are created when a wl_surface is assigned the
"cursor" role, i.e. when a client calls wl_pointer.set_cursor. A
cursor role object is created which is connected to the cursor object
by the position signal, and will set a correct texture scale given what
monitor the cursor is on and what scale the wl_surface's active buffer
is in. It will also push new buffers to the same to the cursor object
when new ones are committed to the surface.

This commit also makes texture loading lazy, since the renderer doesn't
calculate a rectangle when the cursor position changes.

The native backend is refactored to be triple-buffered; see the comment
in meta-cursor-renderer-native.c for further explanations.

* when we are running as a Wayland compositor

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Marek Chalupa
79f755bf0f launcher: find the right drm device
Instead of hard-coding /dev/dri/card0, find the device
that has boot_vga flag set or has been explicitly
assigned a seat id other than seat0

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:42:21 -04:00
Marek Chalupa
1845bfe1b6 launcher: refactor handling errors in meta_launcher_new
Fill in missing error checks and use g_error, since any
error in this phase would lead to crash later anyway.
This way we'll at least know what went wrong.

Although it was not the patch's original intention, it fixes
https://bugzilla.gnome.org/show_bug.cgi?id=754520

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:40:49 -04:00
Marek Chalupa
8e22bf5bc9 launcher: simplify getting session dbus proxy
Use path "/org/freedesktop/login1/session/self" instead of
getting session id and building the path manually

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:40:20 -04:00
Marek Chalupa
c13ddafdb8 native: remove obsolete comment
There's not weston-launch anymore

https://bugzilla.gnome.org/show_bug.cgi?id=753434
2015-09-07 08:39:38 -04:00
Jonas Ådahl
d3fdaa3232 MetaCursorSprite: Put renderer specific code in the renderer
There were lots of code handling the native renderer specific cases;
move these parts to the renderer. Note that this causes the X11 case to
always generate the texture which is a waste of memory, but his
regression will be fixed in a following commit.

The lazy loading of the texture was removed because it was eventually
always loaded anyway indirectly by the renderer to calculate the
current rect.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:55:12 +08:00
Jonas Ådahl
165050f8f9 backends: Get rid of meta-cursor-private.h
There is nothing special about the private API which only consists of
getters for renderer specific backing buffer. Lets them to the regular
.h file and treat them as part of the normal API.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:54:57 +08:00
Jonas Ådahl
4b667d1e09 Rename MetaCursorReference to MetaCursorSprite
It isn't really a reference to a MetaCursor enum, but a reference
counted cursor sprite, and enum value.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:52:30 +08:00
Jonas Ådahl
7ce06928e2 native: Actually close input device fds
Don't only release it, also close the fd so that we don't leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=752753
2015-08-05 10:28:15 +08:00
Carlos Garnacho
8329e97502 backends: Trigger animated cursor animations on the native backend
We will need to update the timeout on either cursor changes, or
right when ticking to the next cursor frame.

https://bugzilla.gnome.org/show_bug.cgi?id=752342
2015-07-20 22:06:44 +02:00
Thomas Hellstrom
320e2d452f mutter/wayland: Add some missing output names
Sync with the drm_mode.h include file.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750363
2015-06-03 13:28:19 -07:00
Thomas Hellstrom
4d5dd01b7d mutter/wayland: Improved preferred mode selection for the native backend
Instead of selecting the first drm mode as the preferred mode, select the
first drm mode marked as preferred. If there are no modes marked as
preferred, revert to the old behaviour and select the first mode.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750363
2015-06-03 13:28:19 -07:00
Thomas Hellstrom
103c88bd72 mutter/wayland: Have the native backend read drm layout properties
Read the drm layout properties suggested_X, suggested_Y and
hotplug_mode_update and transfer them to the meta layer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

https://bugzilla.gnome.org/show_bug.cgi?id=750363
2015-06-03 13:28:19 -07:00
Dave Airlie
6a77d9722a backend: add output tile info retrieval.
this just adds backend support for retrieving the tile
information from X11 (randr 1.5) and native backends.

It stores the tiling information into the output struct.
2015-06-01 09:38:13 -07:00
Jasper St. Pierre
4d80a4cc31 Use more g_autofoo throughout mutter 2015-05-29 17:18:35 -07:00
Rui Matos
b62db404ee backends/native: Reset idle time when resuming from suspend
https://bugzilla.gnome.org/show_bug.cgi?id=749994
2015-05-28 13:47:08 +02:00
Rui Matos
90a28e7b1c native/meta-launcher: Reset idle time when our session becomes active
https://bugzilla.gnome.org/show_bug.cgi?id=749994
2015-05-28 13:47:08 +02:00
Rui Matos
83ce71c3bf backend-native: Reset idle time on lid open events
This makes gnome-settings-daemon turn on the backlight and
gnome-shell's screen shield animate.

Note that on X sessions, gnome-settings-daemon uses the same upower
property to force an innocuous key event into the X server so that the
idle time gets reset since Xorg doesn't do this itself on lid events.

https://bugzilla.gnome.org/show_bug.cgi?id=749076
2015-05-22 16:53:42 +02:00
Rui Matos
f9d869a3dd backend-native: Remove unused variable
https://bugzilla.gnome.org/show_bug.cgi?id=749076
2015-05-22 16:43:44 +02:00
Rui Matos
7eca43cec9 monitor-manager-kms: Avoid a couple of potential crashes
The drm API can return NULL and we could end up using uninitialized
memory if the driver private struct isn't cleared.
2015-04-28 18:00:45 +02:00
Rui Matos
9060190555 monitor-manager-kms: Read crtc props after determining the crtc ID
Otherwise we can't read the properties.
2015-04-28 18:00:44 +02:00
Jasper St. Pierre
48bf807430 monitor-manager-kms: Add support for underscan 2015-04-27 17:58:38 -07:00
Carlos Garnacho
c6e6ed87c5 backends: Center pointer on primary monitor on startup
This seems nicer/tidier than the current X11 (center on the span of all
monitors) or native (so close to the activities corner it's hard not
to trigger it) platform behaviors.

This code also takes over the native-specific pointer warping that
happens when the pointer was over a removed output.

https://bugzilla.gnome.org/show_bug.cgi?id=746896
2015-03-30 14:00:31 +02:00
Carlos Garnacho
8188cddcf7 backends: Add meta_monitor_manager_get_monitor_at_point()
This function returns the monitor_info index corresponding to the given
coordinates, or -1 if none is found at that point. The native backend
has been changed in places where it could make use of this function.

https://bugzilla.gnome.org/show_bug.cgi?id=746896
2015-03-30 14:00:31 +02:00
Ondrej Holy
f9e91bf007 backends/native: Fix scroll method enums
The enums are swapped currently, because for edge scroll is enabled two finger
scroll and similary for two finger scroll is enabled edge scroll, what is
apparently wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=746870
2015-03-27 13:08:11 +01:00
Carlos Garnacho
ad13fa3bb3 backends/native: Implement set_click_method configuration option
https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Rui Matos
43058a3698 monitor-manager-kms: Tell cogl to ignore CRTCs when DPMS isn't ON
Otherwise cogl will try to page flip and fail.

https://bugzilla.gnome.org/show_bug.cgi?id=746098
2015-03-16 16:32:56 +01:00
Marek Chalupa
5636784604 native: make sure the pointer is in the visible area after init
The initial pointer position is set by clutter. At the moment it
is the point 16x16 on the screen. But this point is not always
in the visible area on monitors (the monotors can be arranged in
many different ways).

https://bugzilla.gnome.org/show_bug.cgi?id=745752
2015-03-09 14:26:34 +01:00
Rui Matos
9a3b178da1 backend-native: Ensure the pointer is visible on monitors-changed
Otherwise the pointer might be "lost" outside the visible area. Note
that the constraining code only ensures the pointer doesn't leave the
visible area but if the pointer is already outside because the rug was
pulled under it then it doesn't do anything.

https://bugzilla.gnome.org/show_bug.cgi?id=745121
2015-03-09 14:26:17 +01:00
Rui Matos
9c6e6ea381 monitor-manager-kms: Fix a crash getting a crtc-less output's scale
https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:56 +01:00
Rui Matos
db9645fcb3 monitor-manager-kms: Cope with non-existent connectors and encoders
DRM objects like connectors and encoders might change at any time, in
particular they might become invalid between drmModeGetResources() and
getting the actual objects in which case they'll be NULL. Be defensive
against that.

Note that, if this happens, we should get another udev event soon
which will cause us to update our state.

https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:55 +01:00
Rui Matos
6af48d75a4 monitor-manager-kms: Don't store a list of encoders
It's not needed outside of read_current() and current_encoder is
totally unused.

https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:53 +01:00
Marek Chalupa
6234f7d1db native: fix pointer constraining
fix copy-paste mistake in computing bottom constrain.
Also save few instructions by moving setting of
always-the-same value off loop.

https://bugzilla.gnome.org/show_bug.cgi?id=727337
2015-03-02 16:00:49 +01:00
Jasper St. Pierre
78d8525699 backends/native: Calculate the output scale in here
It makes more sense as a backend thing, not a frontend thing.
2015-02-26 00:13:28 -08:00
Jasper St. Pierre
23c00688b4 launcher: Fix a gcc warning
self could be returned uninitialized.
2015-02-26 00:13:16 -08:00
Ray Strode
cbad65f657 native: don't leak logind session proxy
It's currently getting leaked in error paths

https://bugzilla.gnome.org/show_bug.cgi?id=745141
2015-02-25 10:56:50 -05:00
Rui Matos
3f2d658f20 monitor-manager: Expose MetaMonitorManager to introspection
This just exposes the type and the singleton getter necessary to make
it available to introspection. We'll expose more functionality as it
becomes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Rui Matos
ad90b7dd2f monitor-manager: Initialize MetaOutput even when we can't get the EDID
Otherwise we'll crash later when building a MetaConfiguration.

https://bugzilla.gnome.org/show_bug.cgi?id=743412
2015-01-27 14:42:45 +01:00
Jonas Ådahl
db384a656c backends/native: Implement support for pointer barriers
When running as a dispay server pointer barriers are a server side
feature and requires no client interaction of any sort. This patch
implements pointer barriers that can be used when running as a display
server on the native backend. Running as a display server using the X11
backend is currently not supported.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-19 02:27:59 -08:00
Carlos Garnacho
049f67df0a native: Remove previous listener for keyboard settings
The settings-daemon peripherals schemas are going away, and this is
now handled through MetaInputSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
2d878d3f55 backends/native: Add libinput-based MetaInputSettings implementation
The libinput_device is fetched from the ClutterInputDevice, and configured
through the libinput_device_*config* API.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
625d3de2ee backends: Make KMS EDID information equal to X11's
EDID parsing has been refactored to a common meta_output_parse_edid()
function, which ensures the extracted information is the same on both KMS
and X11 backend, so it can be used consistently on eg. settings values.

https://bugzilla.gnome.org/show_bug.cgi?id=742882
2015-01-14 12:16:18 +01:00