1
0
Fork 0
Commit graph

733 commits

Author SHA1 Message Date
Carlos Garnacho
7698fc4aaf backends: Drop the filter for libinput events
This is now unused, and it's arguably any useful to stay.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1486
2020-10-23 18:48:18 +00:00
Carlos Garnacho
dd60fa2bc6 backends: Use slot from cancel events
As it does seem from a read to libinput code, TOUCH_CANCEL events
actually do contain slot information, and are emitted per-slot.
This means we can avoid iterating over the slots ourselves, they
are still expected to be sent altogether.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1486
2020-10-23 18:48:18 +00:00
Hans de Goede
21c714a0f2 seat-native: Add support for tablet-mode-switch being hot-unplugged
Add support for the (mostly theoretical) case of an input-device
offering tablet-mode-switch functionality being unplugged.

This makes the has_tablet_switch handling identical to the has_touchscreen
handling, leading to more consistent code.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1506
2020-10-18 21:35:09 +00:00
Hans de Goede
88cabf8039 seat-native: Check for tablet-switch devices from meta_seat_native_constructed
Detect if a tablet-mode-switch device is already present when mutter
starts by checking for this from meta_seat_native_constructed. This
mirrors how we also set has_touchscreen from meta_seat_native_constructed.

This fixes tablet-mode-switches only being recognized when they are added
at runtime.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1506
2020-10-18 21:35:09 +00:00
Hans de Goede
6c240dc83b seat-native: Fix has_touchscreen becoming FALSE when a non touchscreen device gets added
Unconditionally setting has_touchscreen to check_touch_mode
when a new device gets added leads to has_touchscreen becoming
false when during runtime e.g. an USB keyboard gets plugged in.

Fix this by setting has_touchscreen to TRUE when check_touch_mode
is TRUE and leaving it alone otherwise.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1506
2020-10-18 21:35:09 +00:00
Robert Mader
b2f2050b95 renderer-native: Fix GObjectify oversight
This was forgotten in eb14da3874, triggering crashes.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1510
2020-10-18 11:25:27 +02:00
Jonas Ådahl
eb14da3874 cogl: Turn CoglFramebuffer, CoglOffscreen and CoglOnscreen into GObjects
A first step towards abandoning the CoglObject type system: convert
CoglFramebuffer, CoglOffscreen and CoglOnscreen into GObjects.
CoglFramebuffer is turned into an abstract GObject, while the two others
are currently final. The "winsys" and "platform" are still sprinkled
'void *' in the the non-abstract type instances however.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1496
2020-10-16 16:17:38 +00:00
Jonas Ådahl
aa99e505ad cogl/framebuffer: Move public struct fields to private struct
This will limit accidental manipulation of the framebuffer struct
fields, while also paving the way to change to GObject type hierarchy.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1496
2020-10-16 16:17:38 +00:00
Daniel van Vugt
df76d3deec renderer-native: Get the GBM buffer format from EGL to match the framebuffer
This eliminates two locations where the format was hardcoded.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1491
2020-10-15 07:45:06 +00:00
Daniel van Vugt
df65f05e27 cogl: Remove unused swap-related COGL_FEATURE_ID_ flags
What we actually use is `COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT`, which
is also set in the same locations.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1297
2020-10-14 16:27:23 +00:00
Peter Hutterer
e078a007d6 backends: add support for scroll button locking
Where enabled, the first click of the scroll button sets the button logically
down, the second click sets the button logically up.

This is an accessibility feature, it doesn't require users to keep holding the
button down while scrolling which is hard or impossible for some users.

gsettings-desktop-schemas merge request:
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/39

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1432
2020-10-14 16:02:29 +00:00
Jonas Ådahl
2c95e08998 Remove misplaced line break in g_* logging functions
They resulted in empty lines in the log.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
2020-10-08 16:38:41 +02:00
Jonas Ådahl
313e3e771c Make meta_* logging utilities not require line break
Unlike g_* logging utilities, the meta_* counterparts behave like odd
printf() functions. Lets change that so they fit better into how logging
is done everywhere else.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
2020-10-08 16:38:41 +02:00
Carlos Garnacho
bbc4116f10 backends: Use graphene_point_t on meta_cursor_tracker_get_pointer()
It's nicer to propagate along.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
2020-10-06 21:33:10 +02:00
Carlos Garnacho
b9e5a2d6e2 backends/native: Wait to have an stage before emitting CLUTTER_DEVICE_ADDED
During seat initialization, we process early libinput events (adding all known
devices) before the seat gets a stage assigned. This causes warnings when trying
to handle the corresponding CLUTTER_DEVICE_ADDED events, as they are sent
stageless.

As it is definitely too soon to have those events sent meaningfully, filter
those events out and instead handle the CLUTTER_DEVICE_ADDED emission for all
known devices after the seat receives an stage. This makes the events guaranteed
to be emitted early in initialization, but not so soon that they can't be
handled yet.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1472
2020-10-06 13:29:59 +00:00
Karol Herbst
9b9b912765 backends: force enable modifiers on tagged devices
Some devices can't scanout to linear buffers directly as the hw is not
capable of eg rendering into a linear depth buffer.

Add code to force kms-modifiers on udev taged devices.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
2020-09-28 14:00:44 +02:00
Carlos Garnacho
41042b18d6 backends/native: Remove unused function
This meta_seat_native_get_device() function has been unused for some time.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1448
2020-09-23 16:32:18 +02:00
Peter Hutterer
aa638f4d48 backends/native: fix the scroll button lock right/middle mismatch
In X, buttons 1, 2, 3 are left, middle, right. In evdev, the order is
BTN_LEFT, BTN_RIGHT, BTN_MIDDLE. So setting a scroll button to 2 gave us a
middle button in the X session and a right button in a wayland session.

Fix that by hard-coding the LMR buttons handling.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1433
2020-09-17 12:30:49 +00:00
Jonas Ådahl
6e3ecadb79 backends/native: Fall back to compositing if direct scanout failed
Even when a direct client buffer has a compatible format, stride and
modifier for direct scanout, drmModePageFlip() may still fail sometimes.

From testing, it has been observed that it may seemingly randomly fail
with ENOSPC, where all subsequent attempts later on the same CRTC
failing with EBUSY.

Handle this by falling back to flipping after having composited a full
frame again.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1410
2020-09-17 12:17:35 +00:00
Benjamin Berg
d586d06b39 kms/crtc: Always consider gamma state valid
The gamma curve remains valid even if the CRTC is turned off. As such,
there is no need to clear it and doing so breaks reading the gamma curve
while the screens are turned off using DPMS.

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

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1392
2020-09-15 11:31:57 +00:00
Jonas Ådahl
827f545c27 kms/crtc: Read initial gamma state
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1420
2020-09-15 11:31:57 +00:00
Jonas Ådahl
af9df1e5b6 screen-cast: Add 'dma-buf-screen-sharing' experimental feature
It's enabled by default when using the i915 driver, but disabled
everywhere else until it can be made reliably an improvement. Until
then, for anyone want to force-enable it, add the string
'dma-buf-screen-sharing' to the experimental features list in GSettings.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1442
2020-09-14 16:33:16 +00:00
Jonas Ådahl
6c0440697d screen-cast: Enable DMA buffers only for i915
Seems DMA buffer based interprocess buffer sharing is more broken than
not, so for now only enable it when using the i915 driver.

For example vmwgfx, qxl and radeon, it results in mmap() failing to mmap the
memory region. Other drivers, e.g. amdgpu will function, but may hit
very slow memory download paths, resulting in worse performance.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1442
2020-09-14 16:33:16 +00:00
Georges Basile Stavracas Neto
21a21e7f68 cogl/scanout: Allow blitting to framebuffer
This will be used when screencasting monitors so that if
there's scanout in place, it'll still be possible to blit
it to a PipeWire-owned framebuffer, and stream it.

Add a new 'blit_to_framebuffer' vfunc to CoglScanout, and
implement it in MetaDrmBufferGbm.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1421
2020-09-01 13:05:24 -03:00
Georges Basile Stavracas Neto
661fe7769d backends/native: Move pixel format helper to separate file
The pixel format helper will be reused by the next commits, and
it doesn't make sense to simply expose it as MetaRendererNative
API.

Move it to a separate file.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1421
2020-09-01 13:05:24 -03:00
Georges Basile Stavracas Neto
ea7be8b9eb renderer-native: Cleanup unused variable
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1421
2020-09-01 13:05:24 -03:00
Florian Müllner
6b04b2ff60 clutter/backends: Rename master and slave devices
Just because X11/XI uses a particular terminology doesn't mean we
have to use the same terms in our own API. The replacement terms
are in line with gtk@1c856a208, which seems a better precedent
for consistency.

Follow-up to commit 17417a82a5.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1425
2020-08-31 21:07:03 +02:00
Grey Christoforo
aaf70b28d1 screen-cast: Add vmwgfx to the DMA buffer deny list
VMWare has the same issues with mmap():ing DMA buffers cross process
boundaries so fall back to regular shared memory for 'vmwgfx' as well.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1318
2020-08-29 10:32:20 +00:00
Jonas Ådahl
986066ed40 screen-cast: Disable DMA buffer based screen casting for QXL
QXL doesn't support mmap():ing a DMA buffer allocated in mutter inside
the PipeWire stream consumer process. To make screen casting work again
on QXL, disable DMA buffer based screen casting for QXL.

Eventually, it should be the client that renegotiates the supported
buffer types, but until then we need this list.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1318
2020-08-29 10:32:20 +00:00
Jonas Ådahl
d73a858dc2 kms/device: Provide driver name and description
Retrieved from drmGetVersion(), to be used to identify what driver a DRM
device is driven by.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1318
2020-08-29 10:32:20 +00:00
Marco Trevisan (Treviño)
e44c42f254 seat-native: Process device added/removed events as ClutterEvents
Delay the addition and removal of devices using ClutterDeviceEvent's so that
they are processed following the libinput event order, and that we don't
have to flush the events on removal.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1371
2020-08-29 09:33:54 +00:00
Björn Daase
5ec9bde64f *: Fix spelling mistakes found by codespell
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1410
2020-08-29 09:10:31 +00:00
Carlos Garnacho
f69bb2097d backends/native: Use proper string format for uint64_t
This may stir some pain in 32bit arches.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1395
2020-08-28 13:40:15 +00:00
Jonas Ådahl
df5af58d05 renderer-native: Remove stray newline
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1407
2020-08-17 13:13:55 +00:00
Jonas Ådahl
961a1376cd clutter: Remove 'eglnative' backend layer
It's completely empty, so remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
c7429e8aad clutter/main: Use "is display server" state to decide a11y routing
We checked if we were using the usig the X11 backend to decide when to
deal with a11y event posting - in order to make the clutter code less
windowing system dependent, make this check a check whether we're a
display server or not, in contrast to a window/compositing manager
client. This is made into a vfunc ot ClutterBackendClass, implemented by
MetaClutterBackendNative and MetaClutterBackendX11.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
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
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
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
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
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