Commit Graph

17684 Commits

Author SHA1 Message Date
Roman Gilg e4dabe8d93 Remove build-only include from public header
The dix-config.h file is not installed, but dix.h is. The include makes the
compilation of external drivers fail (for example the libinput driver).

The Xserver compilation also works without the include, so just remove it.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2021-08-07 14:26:26 +02:00
Demi Marie Obenour 31fb35a7af XFixes: add version check for byteswapped clients
The version check for byteswapped clients was missing.
2021-08-06 11:12:40 -04:00
Olivier Fourdan 7eba412072 xfree86: Move xf86CVTMode() function
The xf86CVTMode() was implemented in a standalone source file because it
was being used for both the xfree86 API and the standalone cvt utility.

Now that the cvt utility is removed (as part of libxcvt) we can move the
small xf86CVTMode() function with the rest of the xf86Modes sources.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1142
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2021-08-06 11:29:29 +00:00
Olivier Fourdan f2781e9536 xfree86/cvt: Drop cvt utility
The cvt utility is now replaced by the standalone version found in
libxcvt, no need to build the one in xfree86 anymore.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1142
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2021-08-06 11:29:29 +00:00
Olivier Fourdan f788289bdc xfree86: Use libxcvt
Replace the local implementation of the VESA CVT standard timing
modelines generator with the one from libxct to avoid code duplication.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1142
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2021-08-06 11:29:29 +00:00
Olivier Fourdan 6ea2c001f9 xwayland: Use libxcvt
Xwayland is using a copy of the CVT generator found in Xorg.

Rather than duplicating the code within the xserver tree, use the
libxcvt implementation instead.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1142
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2021-08-06 11:29:29 +00:00
Olivier Fourdan a4ab57cb74 build: Add dependency on libxcvt
libxcvt is a library providing a standalone version of the X server
implementation of the VESA CVT standard timing modelines generator.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1142
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2021-08-06 11:29:29 +00:00
Olivier Fourdan 84897891e5 ci: Install libxcvt from git
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2021-08-06 11:29:29 +00:00
Demi Marie Obenour 5c2592cbb1 Add do-while loops to DIX macros
This ensures they will behave properly in conditionals and always
require a trailing semicolon.
2021-07-31 08:55:52 -04:00
Alex Richardson d83c84bd9d Mark the dixChangeWindowProperty() value argument as const
It is copied using memcpy() and not modified so we can add const. This
fixes a -Wincompatible-pointer-types-discards-qualifiers compiler warning
that was failing a -Werror XVnc build for me.

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-07-30 08:36:35 +00:00
Zoltán Böszörményi fb5322ce28 glamoregl: Initialize glamor on the main device
This allows e.g. an UDL device (driven by llvmpipe) to be automatically
set up with GPU acceleration via reverse PRIME.

The result is e.g.:

  # DISPLAY=:0.2 xrandr --listproviders
  Providers: number : 2
  Provider 0: id: 0xec cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
  Provider 1: id: 0x12c cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 1 name:Intel

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-30 00:27:39 +00:00
Zoltán Böszörményi f08bc32f5a xf86: Assign GPUs to screens according to configuration
If there is an explicit configuration, assign the RandR provider
of the GPUDevice to the screen it was specified for.

If there is no configuration (default case) the screen number is
still 0 so it doesn't change behaviour.

The result is e.g:

  # DISPLAY=:0.2 xrandr --listproviders
  Providers: number : 2
  Provider 0: id: 0xd2 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting
  Provider 1: id: 0xfd cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 0 name:Intel

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-30 00:27:39 +00:00
Zoltán Böszörményi cd567415cc xf86: Extract screen configuration matching into its own function
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-30 00:27:39 +00:00
Boris-Barboris 16571b8926 Don't hardcode fps for fake screen
Currently, when main hardware screen is powered-off,
X server initializes fake screen's timer with
1 second update interval.

Streaming software like Nomachine or Vnc, as well as
desktop input automation suffers from it, since it
will forever be stuck on 1 fps until the display is
turned back on.

This commit adds command line option -fakescreenfps <int>
that allows the user to change the default fake screen
timer.

Signed-off-by: Baranin Alexander <ismailsiege@gmail.com>
2021-07-29 08:09:00 +00:00
Łukasz Spintzyk 8836b9d243 modesetting: unflip not possible when glamor is not set
This is fixing crashes of xfce when running under qemu
2021-07-22 13:24:21 +02:00
Łukasz Spintzyk d6c02ffd9c present: fallback get_crtc to return crtc belonging to screen with present extension
Since crtc can belong to secondary output that may not have present
extension enabled we should fallback to first enabled crtc or fake crtc.

Fix for issue xorg/xserver#1195
2021-07-20 08:10:46 +02:00
Michel Dänzer f6f2f203bc present: Drop flip_idler member from present_vblank_rec
It's redundant with the pixmap member of struct xwl_present_event.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:20:56 +02:00
Michel Dänzer 212cfbcf68 xwayland/present: Use present_vblank_ptr instead of xwl_present_event*
Where the latter isn't really needed.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:20:35 +02:00
Michel Dänzer fe8c7855f3 xwayland/present: Fold xwl_present_release_event into _free_event
The only difference was unhooking from the vblank.event_queue list,
which is already done by xwl_present_flip_notify_vblank in
xwl_present_msc_bump.
2021-07-09 16:20:20 +02:00
Michel Dänzer 31d2ebca77 xwayland/present: Drop target_msc member from struct xwl_present_event
Use present_vblank_rec::exec_msc instead.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:20:04 +02:00
Michel Dänzer 495ec59664 xwayland/present: Drop pending member from struct xwl_present_event
We are handling two cases here: the active flip or the pending flip.

For the pending flip (event->pending == TRUE), we called
xwl_present_release_pixmap.

For the active flip (event->pending == FALSE), we called
xwl_present_release_event. However, xwl_present_flip_notify_vblank
already unhooked event->vblank.event_queue. So this was effectively the
same as calling xwl_present_release_pixmap.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:19:30 +02:00
Michel Dänzer f73340445f xwayland/present: Drop list member from struct xwl_present_event
Use present_vblank_rec::event_queue instead.

The changes in xwl_present_execute shouldn't really be needed, since
we should never hit queue_vblank in present_execute_wait. But let's be
safe rather than sorry, plus this simplifies the code.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:18:56 +02:00
Michel Dänzer aac31d2758 xwayland/present: Drop exec_queue member from struct xwl_present_window
Doesn't serve any purpose anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:18:47 +02:00
Michel Dänzer f8c086b214 xwayland/present: Fold xwl_present_event_notify into its caller
Can just call xwl_present_execute directly.

This allows dropping the window member from struct xwl_present_window as
well.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:18:33 +02:00
Michel Dänzer c30f3d08ac xwayland/present: Use exec_queue for deferring completion events
We clear the vblank->pixmap field, so next time xwl_present_execute
falls through to present_execute_post.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:18:07 +02:00
Michel Dänzer 4503c8d9ea xwayland/present: Fold xwl_present_idle_notify into its caller
Allows simplification by avoiding indirection.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:17:55 +02:00
Michel Dänzer b2a06e0700 xwayland/present: Drop sync_flip member of struct xwl_present_window
The same information can be determined from the flip queue.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:17:44 +02:00
Michel Dänzer fc53e3c536 xwaland/present: Drop flip_pending member of struct xwl_present_window
Use the first element of the flip_queue list for the same purpose.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:17:23 +02:00
Michel Dänzer c592c66625 xwayland/present: Fold xwl_present_flip_notify into its callers
No need for them to be separate anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:17:15 +02:00
Michel Dänzer 4230176080 xwayland/present: Embed present_vblank_rec in xwl_present_event
This allows for various simplifications.

Use the pointer to the struct memory as the event ID. In contrast to
the SCMD code for Xorg (where pending DRM events cannot be cancelled),
this is safe here, because we can destroy pending Wayland callbacks. So
we can't get a callback with a stale pointer to freed memory.

Remove xwl_present_window::release_list in favour of
present_vblank_rec::window_list.

Remove xwl_present_event::xwl_present_window in favour of
present_vblank_rec::window.

xwl_present_free_event is never called for a NULL pointer anymore, no
need to check.

v2:
* Restore DestroyWindow wrapping order to make sure
  present_destroy_window doesn't call xwl_present_abort_vblank.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:15:50 +02:00
Michel Dänzer 61cc5d96ed present: Refactor present_vblank_init helper ouf of _vblank_create
Allows embedding into another struct.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:15:39 +02:00
Michel Dänzer 35f173ddb6 xwayland/present: Drop abort member of struct xwl_present_event
We can call xwl_present_free_event unconditionally from
xwl_present_abort_vblank, since the sync_callback is already destroyed
in xwl_present_cleanup.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:15:10 +02:00
Michel Dänzer 0517460301 xwayland/present: Simplify calls to Xwayland-private functions
Change parameter types to what's really needed, or just fold the
function into its only caller.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:14:56 +02:00
Michel Dänzer 490248ea70 xwayland/present: Rename present_wnmd_* functions to xwl_present_*
The WNMD indirection is gone.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:14:47 +02:00
Michel Dänzer 0c0cbbc7cb present: Remove present_wnmd_info_rec
Doesn't serve any purpose anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:14:38 +02:00
Michel Dänzer 561c63d0f1 xwayland/present: Merge present_wnmd_flips_stop & xwl_present_flips_stop
Just use the latter instead of the former elsewhere. No need for them
to be separate anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:14:28 +02:00
Michel Dänzer a67f16fde1 xwayland/present: Fold present_wnmd_get_ust_msc into its callers
Just use xwl_present_get_ust_msc directly. No need for the indirection
anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:14:19 +02:00
Michel Dänzer 080c1ca3f5 xwayland/present: Fold present_wnmd_queue_vblank into its callers
Just use xwl_present_queue_vblank directly. No need for the indirection
anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:14:09 +02:00
Michel Dänzer c22887bc7a xwayland/present: Fold present_wnmd_get_crtc into present_wnmd_pixmap
And use xwl_present_get_crtc directly.

No need for them to be separate anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:59 +02:00
Michel Dänzer cb35ff596e xwayland/present: Fold present_wnmd_check_flip into its callers
Mainly into xwl_present_check_flip, and call that from
present_wnmd_check_flip_window.

No need for them to be separate anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:48 +02:00
Michel Dänzer 7b78cf6b3a xwayland/present: Simplify query_capabilities
No need for the WNMD indirection anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:39 +02:00
Michel Dänzer 244403ec87 xwayland/present: Fold present_wnmd_abort_vblank into its only caller
No need for them to be separate anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:32 +02:00
Michel Dänzer f7adbc2166 xwayland/present: Drop present_wnmd_flush in favour of xwl_present_flush
No need for the indirection anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:24 +02:00
Michel Dänzer 7fd114365d xwayland/present: Fold present_wnmd_flip into present_wnmd_execute
No need for the indirection anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:15 +02:00
Michel Dänzer 2e1dcd731f xwayland/present: Fold present_wnmd_screen_init into xwl_present_init
No need for them to be separate anymore.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:13:04 +02:00
Michel Dänzer b6419359b6 present: Move present_wnmd.c contents to hw/xwayland/xwayland-present.c
This will allow eliminating indirections and making the Xwayland Present
code more efficient and easier to follow.

While this technically changes the Xorg video driver ABI, I don't know
of any drivers using the dropped present_wnmd_* symbols, and I doubt a
Xorg driver could make use of them as is anyway.

(As a bonus, Xorg no longer links any Xwayland specific Present code)

v2:
* Wrap DestroyWindow before initializing Present, so that
  present_destroy_window runs before xwl_present_cleanup. Avoids crash
  due to present_destroy_window calling xwl_present_* functions when
  xwl_present_window was already freed. (Olivier Fourdan)

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:11:22 +02:00
Michel Dänzer c35a716b02 present: Fold wnmd_init_mode_hooks into wnmd_screen_init
Preparation for moving WNMD code to hw/xwayland. No functional change
intended.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:11:11 +02:00
Michel Dänzer 10bdd87fe4 present: Move present_wnmd_screen_init to present_wnmd.c
Now all WNMD code is in present_wnmd.c.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:11:02 +02:00
Michel Dänzer b6d54b0f5d present: Dispatch clear_window_flip via present_screen_priv hook
Eliminates special cases in present_destroy_window.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:10:54 +02:00
Michel Dänzer 93666ebe37 present: Remove create_event_id hook
Each present_vblank_create caller generates and sets the ID afterwards.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09 16:10:43 +02:00