1
0
Fork 0
Commit graph

1612 commits

Author SHA1 Message Date
Philipp Zabel
7564c2f2e4 kms: Skip displays with 'non-desktop' property set
Detect displays marked as 'non-desktop' by the kernel and skip them when
creating the outputs. Mutter is not able to render images that are shown
properly on those devices anyway.

This avoids lighting up attached VR HMDs and showing the GDM login
screen between the eyes in a VR HMD instead of on the monitor.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1393
2020-08-05 06:09:36 +00:00
Jonas Ådahl
5ea0034943 renderer/native: Remove left-over comment
Since the frame clock split it's no longer valid, so remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1397
2020-08-04 15:20:54 +02:00
Daniel van Vugt
4c513e3e19 backends/native: Remove unused meta_gpu_kms_wait_for_flip and more
Remove unused function `meta_gpu_kms_wait_for_flip` and other code which
only existed to support `meta_gpu_kms_wait_for_flip`.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1388
2020-08-04 08:57:06 +00:00
Daniel van Vugt
f3ad63e206 Remove unused flag COGL_WINSYS_FEATURE_SWAP_THROTTLE
This also removes an old comment about `wait_for_pending_flips` which
no longer exists.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1390
2020-08-04 08:43:57 +00:00
Olivier Fourdan
17417a82a5 cleanup: remove controversial naming
Replace "whitelist" and "blacklist" with "allow_list" and "deny_list"
which better represent the purpose of those variables.

There is no functional change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1396
2020-08-04 10:04:16 +02:00
Jonas Ådahl
34579d71cc remote-access-handle: Add 'is-recording' property
Will be TRUE if it is a screen cast session where all streams have the
'is-recording' set to TRUE. For other screen casts or remote desktop
sessions, it'll be FALSE.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
2020-07-31 10:41:38 +02:00
Jonas Ådahl
153357cd36 screen-cast: Add 'is-recording' option to record methods
This can be used by the Shell to change the UI to be the same as the
current built in screen recording.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
2020-07-31 10:41:15 +02:00
Jonas Ådahl
14cd78a016 screen-cast: Add screen cast flag to streams
Intended to be used to pass state from screen cast clients down the
line. The first use case will be a boolean whether a screen cast is a
plain recording or not, e.g. letting the Shell decide whether to use a
red dot as the icon, or the generic "sharing" symbol.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
2020-07-30 09:51:16 +02:00
Olivier Fourdan
d0ee02fae7 cleanup: Remove duplicate semicolons in C code
No functional change, it just hurts my eyes when reading the code.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1385
2020-07-28 10:32:46 +02:00
Martin Whitaker
7b79fcee45 Fix segfaults on 32-bit systems.
The new "id" properties for the MetaCrtc* and MetaOuput* objects are 64-bit
values, so take care to pass 64-bit values when calling g_object_new.

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1343.
2020-07-24 11:24:08 +00:00
Erik Kurzinger
0aa4bab539 kms: Use custom page flip function when retrying failed flips
When using its EGLStream-based presentation path with the proprietary NVIDIA
driver, mutter will use a different function to process page flips -
custom_egl_stream_page_flip.  If that fails due to an EBUSY error, it will
attempt to retry the flip.  However, when retrying, it unconditionally uses the
libdrm-based path. In practice, this causes a segfault when attempting to
access plane_assignments->fb_id, since plane_assignments will be NULL in the
EGLStream case.  The issue can be reproduced reliably by VT-switching away from
GNOME and back again while an EGL application is running.

This patch has mutter also use the custom page flip function when retrying the
failed flip.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1375
2020-07-19 12:50:37 -07:00
Daniel van Vugt
7658e07beb Include the pkgconfig-specified gdesktop-enums.h
Instead of blindly hoping that `$INCLUDE` contains the parent directory
of `gsettings-desktop-schemas`.

Because `gsettings-desktop-schemas.pc` says:
```
Cflags: -I/SOME/DIRECTORY/gsettings-desktop-schemas
```
Which means to include the version that Meson has configured you need
to drop the directory prefix and only `#include <gdesktop-enums.h>`.

This fixes a build failure with local installs triggered by 775ec67a44
but it's also the right thing to do™.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1370
2020-07-13 17:30:20 +08:00
Giusy Margarita
775ec67a44 Add tap-button-map and tap-and-drag-lock support to X11 and Wayland
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1319
2020-07-10 13:31:46 +00:00
Jonas Ådahl
d67ba3ea65 screen-cast/src: Remove follow up timeout source on disable
We failed to remove the timeout source when disabling, meaning that if a
follow up was scheduled, and shortly after we disabled the source, the
timeout would be invoked after the source was freed causing
use-after-free bugs.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1337

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1365
2020-07-10 09:08:59 +02:00
Jonas Ådahl
50634d450e screen-cast/src: Use G_USEC_PER_SEC instead of 1000000
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
9bab8e8751 screen-cast/src: Record follow up frame after timeout
During animation or other things that cause multiple frames in a row
being painted, we might skip recording frames if the max framerate is
reached.

Doing so means we might end up skipping the last frame in a series,
ending with the last frame we sent was not the last one, making things
appear to get stuck sometimes.

Handle this by creating a timeout if we ever throttle, and at the time
the timeout callback is triggered, make sure we eventually send an up to
date frame.

This is handle differently depending on the source type. A monitor
source type reports 1x1 pixel damage on each view its monitor overlaps,
while a window source type simply records a frame from the surface
directly, except without recording a timestamp, so that timestamps
always refer to when damage actually happened.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
7adc24d3a6 screen-cast/src: Fix signedness of timestamp field
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
047da80c3b screen-cast/src: Make record functions return an error when failing
Now that we don't use the record function to early out depending on
implicit state (don't record pixels if only cursor moved for example),
let it simply report an error when it fails, as we should no longer ever
return without pixels if nothing failed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
882967d3ce screen-cast: Let the reason for recording determine what to record
E.g. we'll have pointer movement that, if no painting is already
scheduled, should only send new cursor metadata without any new pixel
buffer. When this happens, tell next step to not record the pixels if
this was the case, instead of having it rediscover this itself.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1323
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
cea0722e72 screen-cast/src: Add flag to maybe_record()
Will later be used to make recording avoid recording actual pixel
content if e.g. only the cursor moved.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
03823128c4 screen-cast/window-stream-src: Fix indentation
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:22 +02:00
Jonas Ådahl
7b35ed8c35 screen-cast-src: Make the two record vfuncs more similarly named
Both do more or less the same but with different methods - one puts
pixels into a buffer using the CPU, the other puts pixels into a buffer
using the GPU.

However, they are behaving slightly different, which they shouldn't.
Lets first address the misleading disconnect in naming, and later we'll
make them behave more similarly.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:22 +02:00
Jonas Ådahl
a9a9a0d1c5 clutter: Paint views with individual frame clocks
Replace the default master clock with multiple frame clocks, each
driving its own stage view. As each stage view represents one CRTC, this
means we draw each CRTC with its own designated frame clock,
disconnected from all the others.

For example this means we when using the native backend will never need
to wait for one monitor to vsync before painting another, so e.g. having
a 144 Hz monitor next to a 60 Hz monitor, things including both Wayland
and X11 applications and shell UI will be able to render at the
corresponding monitor refresh rate.

This also changes a warning about missed frames when sending
_NETWM_FRAME_TIMINGS messages to a debug log entry, as it's expected
that we'll start missing frames e.g. when a X11 window (via Xwayland) is
exclusively within a stage view that was not painted, while another one
was, still increasing the global frame clock.

Addititonally, this also requires the X11 window actor to schedule
timeouts for _NET_WM_FRAME_DRAWN/_NET_WM_FRAME_TIMINGS event emitting,
if the actor wasn't on any stage views, as now we'll only get the frame
callbacks on actors when they actually were painted, while in the past,
we'd invoke that vfunc when anything was painted.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/903
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
57a2f7b4a3 renderer: Use 'add_view()' when adding CRTC views
This also changes the view construction path used by the renderer view
to use the new 'add_view()' function, meaning we have a common entry
point for views into the renderer, which will be useful later on.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
1f895719b3 renderer-x11-cm: Initialize screen stage view in one step
Before we'd create the view in init(), then continue poking at it in
realize(). Move all of the screen stage view initialization to
realize(), as that's when we have all the dependent state available.
This is possible since there is nothing needing it until realizing.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
9daec23033 cursor-renderer: Use 'after-paint' stage signal instead paint callback
The clutter "thread" repaint callback are not tied to painting, but
indirectly to updating. What the cursor renderer cares about is when we
actually painted, as this is related to the OpenGL fallback paths.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
de99dd7eb6 clutter: Remove multi thread mutexes
The mutexes was used by ClutterTexture's async upload and to match GDK's
mutexes on X11. GDK's X11 connection does not share anything with
Clutter's, we don't have the Gdk Clutter backend left, and we have
already removed ClutterTexture, so lets remove these mutexes as well.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
c00a8e98a3 clutter/cogl: Take over global frame count responsibility
The native backend had a plain counter, and the X11 backend used the
CoglOnscreen of the screen; change it into a plain counter in
ClutterStageCogl. This also moves the global frame count setting to the
frame info constuctor.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
2a6e8bda8d cogl/onscreen: Let swap buffer caller create frame info
We currently have mutter set a global frame counter on the frame info in
the native backend, but in order to do this from clutter, change the
frame info construction from being implicitly done so when swapping
buffers to having the caller create the frame info and passing that to
the swap buffers call.

While this commit doesn't introduce any other changes than the API, the
intention is later to have the caller be able to pass it's own state
(e.g. the global frame count) along with the frame info.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
f086eafe57 Gather all time unit conversion helpers in one place
We had time unit conversion helpers (e.g. us2ms(), ns2us(), etc) in
multiple places. Clean that up by moving them all to a common file. That
file is clutter-private.h, as it's accessible by both from clutter/ and
src/.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
bb73038a27 clutter/stage-view: Give a stage view a refresh rate
Currently unused, but it's intention is to use as a initial refresh rate
for a with the stage view associated frame clock. It defaults to 60 Hz
if nothing sets it, but the native backend sets it to the associated
CRTCs current mode's refresh rate.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
b9a52ecfdf screen-cast: Only check queued-redraw on the relevant views
We'd check if there was any queued redraw on the stage, but this is
inappropriate for two reasons:

1) A monitor and area screen cast source only cares about damage on a
   subset of the stage.
2) The global pending-redraw is going away when paint scheduling will be
   more view centric.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
feb444402e renderer: Add API to get a view list for a monitor
Where renderer views correspond to CRTCs, this will result in a list of
those views; otherwise (i.e. X11 CM), it'll result in a list containing
the global view.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
9ed463b488 renderer-view: Keep track of what CRTC it is associated with
For the nested and native backend, it'll point to the CRTC it was
created for. On the X11 CM backend, it'll be NULL, as there is only a
single global stage view.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
59eebd6f6d clutter/stage-view: Pass a pointer to the stage during constuction
This is so that stage views can interact with the stage they are views
of.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Dreßler
802b24a640 clutter/backend: Introduce a fallback scale set to primary monitor scale
Add private API to ClutterBackend to set a fallback resource scale
available to Clutter. This API will be used for "guessing" the
resource-scale of ClutterActors in case the actor is not attached to a
stage or not properly positioned yet.

We set this value from inside mutters MetaRenderer while creating new
stage-views for each logical monitor. This makes it possible to set the
fallback scale to the scale of the primary monitor, which is the monitor
where most ClutterActors are going to be positioned.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1276
2020-06-30 13:15:53 +00:00
Olivier Fourdan
b8524504f4 remote-desktop: Check for screencast only when required
The portal API requires a screencast session only for absolution motion
with remote desktop, other methods including relative motion do not
require a screencast session.

There is no reason to be more strict than the API actually is, check for
a screencast session only when required, like for absolute motion events
and touch events.

Tested with https://gitlab.gnome.org/snippets/1122

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1307
2020-06-29 16:41:51 +00:00
Michel Dänzer
2e5b767c01 gpu/kms: Turn off CRTCs as well for DPMS
This avoids some issues which could happen on some setups[0] due to
meta-native-renderer.c:dummy_power_save_page_flip →
meta_onscreen_native_swap_drm_fb implicitly turning of the primary
plane (by destroying the KMS framebuffer assigned to it):

* drmModeObjectSetProperty could return an "Invalid argument" error
  between setting a non-empty cursor with drmModeSetCursor(2) and
  enabling the primary plane again:

  Failed to DPMS: Failed to set connector 69 property 2: Invalid argument

  (This was harmless other than the error message, as we always re-set
  a mode on the CRTC after setting the DPMS property to on, which
  enables the primary plane and implicitly sets the DRM property to on)

* drmModeSetCursor(2) could return an "Invalid argument" error between
  setting the DPMS property to on and enabling the primary plane again:

  Failed to set hardware cursor (drmModeSetCursor failed: Invalid argument), using OpenGL from now on

[0] E.g. with the amdgpu DC display code.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1240
2020-06-23 12:04:14 +02:00
Adam Jackson
d133f94f8f cogl: Introduce and use cogl_context_is_hardware_accelerated
We delegate the answer through CoglDriverVtable::is_hardware_accelerated
since this is properly a property of the renderer, and not something the
cogl core should know about. The answer given for the nop driver is
admittedly arbitrary, yes it's infinitely fast but no there's not any
"hardware" making it so.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1194
2020-06-18 13:55:14 -04:00
Jonas Ådahl
e5ea8f5483 stage/x11: Check that message is WM_PROTOCOLS before assuming so
When a touch sequence was rejected, we'd update the event timestamps of
incoming touch events to help with implementing grabs. This was done by
sending a ClientMessage with a counter, and comparing the counter to
decide whether we're seing a replayed event or not.

This had the unforseen consequence that we would potentially end up
destroying all actors including the stage, since, when mutter receives a
ClientMessage event, it would assume that it's a WM_PROTOCOLS event, and
handle it as such. The problem with this approach is that it would
ignore fact that there might be other ClientMessage types sent to it,
for example the touch synchronization one. What could happen is that the
touch count value would match up with the value of the WM_DELETE_WINDOW
atom, clutter would treat this as WM_PROTOCOLS:WM_DELETE_WINDOW, which
it'd translate to clutter_actor_destroy(stage).

Destroying the stage in such a way is not expected, and caused wierd
crashes in different places depending on what was going on.

This commit make sure we only treat WM_PROTOCOLS client messages as
WM_PROTOCOLS client messages effectively avoiding the issue.

This fixes crashes such as:

 #0  meta_window_get_buffer_rect (window=0x0, rect=rect@entry=0x7ffd7fc62e40) at core/window.c:4396
 #1  0x00007f1e2634837f in get_top_visible_window_actor (compositor=0x297d700, compositor=0x297d700) at compositor/compositor.c:1059
 #2  meta_compositor_sync_stack (compositor=0x297d700, stack=<optimized out>, stack@entry=0x26e3140) at compositor/compositor.c:1176
 #3  0x00007f1e263757ac in meta_stack_tracker_sync_stack (tracker=0x297dbc0) at core/stack-tracker.c:871
 #4  0x00007f1e26375899 in stack_tracker_sync_stack_later (data=<optimized out>) at core/stack-tracker.c:881
 #5  0x00007f1e26376914 in run_repaint_laters (laters_list=0x7f1e2663b7d8 <laters+24>) at core/util.c:809
 #6  run_all_repaint_laters (data=<optimized out>) at core/util.c:826
 #7  0x00007f1e26b18325 in _clutter_run_repaint_functions (flags=flags@entry=CLUTTER_REPAINT_FLAGS_PRE_PAINT) at clutter-main.c:3448
 #8  0x00007f1e26b18fc5 in master_clock_update_stages (master_clock=0x32d6a80, stages=0x4e5a740) at clutter-master-clock-default.c:437
 #9  clutter_clock_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at clutter-master-clock-default.c:567
 #10 0x00007f1e27e48049 in g_main_dispatch (context=0x225b8d0) at gmain.c:3175
 #11 g_main_context_dispatch (context=context@entry=0x225b8d0) at gmain.c:3828
 #12 0x00007f1e27e483a8 in g_main_context_iterate (context=0x225b8d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3901
 #13 0x00007f1e27e4867a in g_main_loop_run (loop=0x24e29f0) at gmain.c:4097
 #14 0x00007f1e2636a3dc in meta_run () at core/main.c:666
 #15 0x000000000040219c in main (argc=1, argv=0x7ffd7fc63238) at ../src/main.c:534

and

 #0  0x00007f93943c1f25 in raise () at /usr/lib/libc.so.6
 #1  0x00007f93943ab897 in abort () at /usr/lib/libc.so.6
 #2  0x00007f9393e1e062 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>, func=0x7f93933e6860 <__func__.116322> "meta_x11_get_stage_window",
 #3  0x00007f9393e4ab1d in g_assertion_message_expr ()
 #4  0x00007f939338ecd7 in meta_x11_get_stage_window (stage=<optimized out>) at ../mutter/src/backends/x11/meta-stage-x11.c:923
 #5  0x00007f939339e599 in meta_backend_x11_cm_translate_device_event (x11=<optimized out>, device_event=0x55bc8bcfd6b0) at ../mutter/src/backends/x11/cm/meta-backend-x11-cm.c:381
 #6  0x00007f939339f2e2 in meta_backend_x11_translate_device_event (device_event=0x55bc8bcfd6b0, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:179
 #7  0x00007f939339f2e2 in translate_device_event (device_event=0x55bc8bcfd6b0, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:208
 #8  0x00007f939339f2e2 in maybe_spoof_event_as_stage_event (input_event=0x55bc8bcfd6b0, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:284
 #9  0x00007f939339f2e2 in handle_input_event (event=0x7fff62d60490, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:309
 #10 0x00007f939339f2e2 in handle_host_xevent (event=0x7fff62d60490, backend=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:413
 #11 0x00007f939339f2e2 in x_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at ../mutter/src/backends/x11/meta-backend-x11.c:467
 #12 0x00007f9393e6c39e in g_main_dispatch (context=0x55bc89dd03e0) at ../glib/glib/gmain.c:3179
 #13 0x00007f9393e6c39e in g_main_context_dispatch (context=context@entry=0x55bc89dd03e0) at ../glib/glib/gmain.c:3844
 #14 0x00007f9393e6e1b1 in g_main_context_iterate (context=0x55bc89dd03e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:3917
 #15 0x00007f9393e6f0c3 in g_main_loop_run (loop=0x55bc8a042640) at ../glib/glib/gmain.c:4111
 #16 0x00007f9393369a0c in meta_run () at ../mutter/src/core/main.c:676
 #17 0x000055bc880f2426 in main (argc=<optimized out>, argv=<optimized out>) at ../gnome-shell/src/main.c:552

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/338
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/951

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1317
2020-06-16 13:59:15 +00:00
Jonas Dreßler
45c14f74b4 clutter/seat: Add private method to peek list of input devices
Add a method to ClutterSeat that allows peeking the list of input
devices and allow looping through devices a bit faster. The API left is
private so we can make use of peeking the GList internally, but don't
have to expose any details to the outside, which means we'd have to
eventually stick with a GList forever to avoid breaking API.

Since we now have the peek_devices() API internally, we can implement
ClutterSeats public list_devices() API using g_list_copy() on the list
returned by peek_devices().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1275
2020-06-16 10:09:26 +00:00
Jonas Ådahl
19b467aa01 crtc-kms: Include MetaCrtc in MetaCrtcKms struct
Otherwise it can't be a GObject inheriting MetaCrtc. This fixes warning
logged as

"invalid uninstantiatable type '(null)' in cast to 'MetaCrtcKms'"

Fixes: 1ce9e379d9

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1308
2020-06-11 11:52:53 +02:00
Jonas Ådahl
e089e53b24 crtc-kms: Make KMS CRTC mode a type inheriting MetaCrtcMode
It carries the drmModeModeInfo copy in it's instance struct, instead of
the `driver_private` it was using before.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287

This version of the commit includes fixes from:

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1305
2020-06-11 09:20:16 +00:00
Daniel van Vugt
bad1a7fd0c backends-x11: Remove g_new0 overwriting g_object_new
The object starts out right, and then gets overwritten with zeroes:

```
  crtc_xrandr = g_object_new (META_TYPE_CRTC_XRANDR,
                              "id", crtc_id,
                              "gpu", gpu,
                              "all-transforms", all_transforms,
                              NULL);

  crtc_xrandr = g_new0 (MetaCrtcXrandr, 1);
```

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1296

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1306
2020-06-11 07:53:02 +00:00
Sebastian Keller
94fb82137f backends/native: Fix input device touch hash table leak
It was emptied but never unref'ed in finalize.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1304
2020-06-11 07:23:18 +00:00
Georges Basile Stavracas Neto
49408e8f9f Revert "crtc-kms: Make KMS CRTC mode a type inheriting MetaCrtcMode"
This reverts commit 09078762a, which breaks Mutter.
2020-06-10 23:11:21 -03:00
Jonas Ådahl
09078762ac crtc-kms: Make KMS CRTC mode a type inheriting MetaCrtcMode
It carries the drmModeModeInfo copy in it's instance struct, instead of
the `driver_private` it was using before.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
2020-06-10 18:54:51 +00:00
Jonas Ådahl
352c2ec7b8 output-kms: Remove old FIXME
Trying to figure out what this comment was actually about, it turns out
that MSC means Media Stream Counter, and as mentioned in an article[0]
is related to DRI3 and the X11 Present extension. Anyway, the comment
has been there raising questions for some years now, I think we can
remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
2020-06-10 18:54:51 +00:00
Jonas Ådahl
4b37c2e446 crtc-mode: Move away fields from public MetaCrtcMode struct
The ID and name are just moved into the instance private, while the rest
is moved to a `MetaCrtcModeInfo` struct which is used during
construction and retrieved via a getter. Opens up the possibility to
add actual sub types.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
2020-06-10 18:54:51 +00:00
Jonas Ådahl
980ece9a4b crtc: Move out MetaCrtcMode into its own file
It's somewhat annoying to have two very closely named types in the same
file. It's also about to grow some, so better move it to its own file.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
2020-06-10 18:54:51 +00:00