summaryrefslogtreecommitdiff
path: root/present
AgeCommit message (Collapse)AuthorFilesLines
2024-05-22present: On *BSD, epoll-shim is needed to emulate eventfd()Matthieu Herrb1-0/+7
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1559>
2024-05-02present: signal explicit sync release point in present_vblank_scrapErik Kurzinger1-1/+8
If a present request using explicit sync is scrapped, instead of sending a PresentIdleNotify event we should signal the release point. Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1511>
2024-04-15rename remaining RT_* defines to X11_RESTYPE_*Enrico Weigelt, metux IT consult1-1/+1
Since we already had to rename some of them, in order to fix name clashes on win32, it's now time to rename all the remaining ones. The old ones are still present as define's to the new ones, just for backwards compatibility. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
2024-04-15prevent name clash on Windows w/ RT_* definesEnrico Weigelt, metux IT consult1-2/+2
Windows' native headers using some our RT_* define's names for other things. Since the naming isn't very nice anyways, introducing some new ones (X11_RESTYPE_NONE, X11_RESTYPE_FONT, X11_RESTYPE_CURSOR) and define the old ones as an alias to them, in case some out-of-tree code still uses them. With thins change, we don't need to be so extremely careful about include ordering and have explicit #undef's in order to prevent name clashes on Win32 targets. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
2024-04-15dix: unexport some lookup functionsEnrico Weigelt, metux IT consult2-1/+6
These aren't used by any drivers, so no need to export them. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1380>
2024-04-15present: present_scmd: drop obsolete include of <time.h>Enrico Weigelt, metux IT consult1-3/+0
Not used anymore, was forgotten to be removed. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1260>
2024-04-09xwayland: add support for wp_linux_drm_syncobj_v1Erik Kurzinger1-1/+4
This protocol allows for explicit synchronization of GPU operations by Wayland clients and the compositor. Xwayland can make use of this to ensure any rendering it initiates has completed before the target image is accessed by the compositor, without having to rely on kernel-level implicit synchronization. Furthermore, for X11 clients that also support explicit synchronization using the mechanisms exposed in the DRI3 and Present extensions, this Wayland protocol allows us to simply forward the timeline, acquire, and release points directly to the compositor, ideally avoiding any premature stalls in the presentation pipeline. Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
2024-04-09Present: add PresentCapabilitySyncobj and PresentPixmapSyncedErik Kurzinger7-37/+310
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
2024-02-22randr: move private definitons from randrstr.h to randrstr_priv.hEnrico Weigelt, metux IT consult1-1/+1
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1291>
2023-12-16modesetting: unflip before any setcrtc() callsVille Syrjälä2-0/+23
Make sure we're not scanning out any fbs with fancy modifiers when we try to light up new displays. This is already the case in cases where the screen gets resized, but in cases where that doesn't happen it might be possible for the modeset(s) to fail due to watermark/etc. constraints imposed by the fancy modifiers. We can avoid that by making sure everything gets unflipped before the modeset. v2: make poll timeout infinite s/in_modeset/pending_modeset/ deal with tearfree fallout (goto no_flip) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2023-06-19present: add support for PresentOptionAsyncMayTearXaver Hugl2-2/+2
Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2023-02-28present: Document the TearFree flip reasons in PresentFlipReasonSultan Alsawaf1-0/+6
Adding new flip reasons after the TearFree ones would break the assumption that `reason >= PRESENT_FLIP_REASON_DRIVER_TEARFREE` implies either of the TearFree reasons. Document this in the PresentFlipReason enum in order to save someone a very bad headache in the future. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28present: Fix inaccurate PresentCompleteNotify timing for TearFreeSultan Alsawaf1-20/+38
The timing of PresentCompleteNotify events is inaccurate when a driver uses TearFree because there's no way to know exactly when a presentation will appear on the display without receiving a notification directly from the driver indicating that the TearFree flip containing a presentation's pixmap is actually visible on the display. To fix the inaccurate PresentCompleteNotify timing, make use of the new assumption that drivers which export TearFree permit a NULL pixmap to be passed to their flip callback in order to make a presentation track the exact TearFree flip responsible for rendering it onto the display. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Acked-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-28present: Prevent double vblank enqueue on error when TearFree is usedSultan Alsawaf1-17/+19
It's possible for present_execute_copy to enqueue a vblank even when TearFree is used, specifically when the present_queue_vblank in present_scmd_pixmap fails and the subsequent vblank enqueue in present_execute_copy somehow doesn't. This could happen if the DRM event queue is exhausted when present_queue_vblank is called, but is no longer exhausted by the time present_execute_copy is reached. This exceedingly unlikely chain of events can lead to a vblank getting enqueued a second time by the TearFree machinery in present_execute, which is not good. Although this scenario is very unlikely, prevent it by first checking that the vblank wasn't enqueued by present_execute_copy before attempting to enqueue it for TearFree. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Acked-by: Martin Roukala <martin.roukala@mupuf.org>
2023-02-15present: Send a PresentConfigureNotify event for destroyed windowsAdam Jackson3-4/+19
This enables fixing a deadlock case on the client side, where the client ends up blocked waiting for a Present event that will never come because the window was destroyed. The new PresentWindowDestroyed flag allows the client to avoid blocking indefinitely. Signed-off-by: Adam Jackson <ajax@redhat.com> See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6685 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-01-20rootless: Use screen_x and screen_y instead of pixmap pointer hacksJeremy Huddleston Sequoia1-1/+1
This updates rootless to treat pixmaps consistently with COMPOSITE, using the screen_x and screen_y values rather than doing hacky math. This will allow for proper bounds checking on a given PixmapRec. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2022-12-19present: add awareness for drivers with TearFreeSultan Alsawaf2-15/+71
When a driver uses TearFree to flip all frames synchronized to the vblank interval, Present has no idea and still assumes that each presentation occurs immediately upon copying its damages to the primary scanout. This faulty assumption breaks presentation timestamping, potentially leading to A/V de-synchronization and dropped frames. Present needs to have some awareness of a driver using TearFree so that it can know when each presentation actually becomes visible on the screen. Teach Present about drivers using TearFree by expanding PresentFlipReason to allow drivers to export some contextual info about TearFree when Present cannot page-flip directly anyway. PRESENT_FLIP_REASON_DRIVER_TEARFREE indicates that a driver has TearFree enabled but doesn't have a TearFree flip currently pending. PRESENT_FLIP_REASON_DRIVER_TEARFREE_FLIPPING indicates that a driver has a TearFree flip currently pending. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2022-01-19present: Check for NULL to prevent crashBłażej Szczygieł1-0/+6
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275 Signed-off-by: Błażej Szczygieł <spaz16@wp.pl> Tested-by: Aaron Plattner <aplattner@nvidia.com>
2021-10-27Remove autotools supportPovilas Kanapickas1-19/+0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-07-29Don't hardcode fps for fake screenBoris-Barboris2-10/+20
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-20present: fallback get_crtc to return crtc belonging to screen with present ↵Łukasz Spintzyk1-1/+9
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-09present: Drop flip_idler member from present_vblank_recMichel Dänzer2-2/+0
It's redundant with the pixmap member of struct xwl_present_event. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Refactor present_vblank_init helper ouf of _vblank_createMichel Dänzer2-23/+75
Allows embedding into another struct. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Remove present_wnmd_info_recMichel Dänzer2-16/+0
Doesn't serve any purpose anymore. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Move present_wnmd.c contents to hw/xwayland/xwayland-present.cMichel Dänzer6-783/+1
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-09present: Fold wnmd_init_mode_hooks into wnmd_screen_initMichel Dänzer2-27/+19
Preparation for moving WNMD code to hw/xwayland. No functional change intended. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Move present_wnmd_screen_init to present_wnmd.cMichel Dänzer3-23/+28
Now all WNMD code is in present_wnmd.c. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Dispatch clear_window_flip via present_screen_priv hookMichel Dänzer4-48/+52
Eliminates special cases in present_destroy_window. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Remove create_event_id hookMichel Dänzer4-24/+9
Each present_vblank_create caller generates and sets the ID afterwards. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-07-09present: Pass capabilities to present_vblank_create by valueMichel Dänzer4-6/+6
Preparation for moving WNMD code to hw/xwayland. No functional change intended. Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-04-16present: fix msc offset calculation in screen modeŁukasz Spintzyk1-2/+3
Instead of getting the current msc value from the window crtc, which not exist take the last saved msc value saved in the window_priv struct Signed-off-by: Łukasz Spintzyk <lukasz.spintzyk@synaptics.com>
2021-04-16present: Use crtc's screen present operation for syncingŁukasz Spintzyk2-2/+15
Signed-off-by: Łukasz Spintzyk <lukasz.spintzyk@synaptics.com>
2021-03-11meson: hide C API if Xorg is disabled (like autotools)Jan Beich1-1/+3
When building only Xwayland using Meson some files are always installed. This causes package conflict if Xwayland is built separately from Xorg. include/xorg/compositeext.h include/xorg/damage.h include/xorg/damagestr.h include/xorg/dbestruct.h include/xorg/dri3.h include/xorg/fb.h include/xorg/fboverlay.h include/xorg/fbpict.h include/xorg/fbrop.h include/xorg/geext.h include/xorg/geint.h include/xorg/glyphstr.h include/xorg/mi.h include/xorg/micmap.h include/xorg/micoord.h include/xorg/migc.h include/xorg/miline.h include/xorg/mioverlay.h include/xorg/mipict.h include/xorg/mipointer.h include/xorg/mipointrst.h include/xorg/mistruct.h include/xorg/misync.h include/xorg/misyncfd.h include/xorg/misyncshm.h include/xorg/misyncstr.h include/xorg/mizerarc.h include/xorg/panoramiX.h include/xorg/panoramiXsrv.h include/xorg/picture.h include/xorg/picturestr.h include/xorg/present.h include/xorg/presentext.h include/xorg/randrstr.h include/xorg/rrtransform.h include/xorg/shadow.h include/xorg/shmint.h include/xorg/syncsdk.h include/xorg/vndserver.h include/xorg/wfbrename.h include/xorg/xace.h include/xorg/xacestr.h include/xorg/xorg-server.h include/xorg/xvdix.h include/xorg/xvmcext.h share/aclocal/xorg-server.m4 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2020-12-01present/wnmd: Translate update region to screen spaceMichel Dänzer1-2/+6
The region as passed in is in the source pixmap's coordinate space, so intersecting it with the clipList (which is in screen space) resulted in disappointment. Fixes Firefox popups such as the hamburger menu when using the EGL backend. v2: * Drop vblank->x/y_off from RegionTranslate call, since they're always 0 here (present_wnmd_check_flip rejects flips for x/y_off != 0). Reported-by: Robert Mader <robert.mader@posteo.de> Tested-by: Robert Mader <robert.mader@posteo.de> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Tested-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> # v1
2020-09-15present: Include dix-config.h instead of xorg-config.hMichel Dänzer14-47/+2
This is DIX code.
2020-09-07present/wnmd: Remove no-op present_wnmd_flip_destroyMichel Dänzer2-8/+2
Reviewed-by: Roman Gilg <subdiff@gmail.com>
2020-09-07present/wnmd: Remove dead present_wnmd_can_window_flipMichel Dänzer1-29/+0
present_can_window_flip is only called from the Xorg modesetting driver, never in WNMD mode. Reviewed-by: Roman Gilg <subdiff@gmail.com>
2020-09-07present/wnmd: Remove dead check from present_wnmd_check_flipMichel Dänzer1-4/+0
present_wnmd_toplvl_pixmap_window returns a window with the same window pixmap, so the check could never fail. Reviewed-by: Roman Gilg <subdiff@gmail.com>
2020-09-04present/wnmd: Can't use page flipping for windows clipped by childrenMichel Dänzer1-0/+4
Noticed this was missing while working on the following fix. v2: * Dropped present_wnmd_can_window_flip hunk (that function is never called, will be cleaned up in a follow-up MR). Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> # v1 Reviewed-by: Roman Gilg <subdiff@gmail.com>
2020-08-25present/wnmd: Execute copies at target_msc-1 alreadyMichel Dänzer1-8/+18
It always takes one update cycle for the copy to become visible on the host windowing system, so waiting for the target MSC resulted in 1 cycle delay. We re-use the idle list for copies which were executed but need their completion event sent. Fixes black seams when resizing the "Builder" sub-window of GDK_BACKEND=x11 gtk4-demo on Xwayland (see https://gitlab.gnome.org/GNOME/mutter/-/issues/1290#note_873557). Unfortunately, this cannot completely fix the seams with apps which queue up multiple frames in advance, since there's always at least one queued frame corresponding to the old window size. But it should at least help a little in that case as well. v2: * Bug fix: Don't update exec_msc in present_wnmd_check_flip_window. (Roman Gilg) * Use exec_msc = target_msc - 1 instead of exec_msc--, and add a comment, for clarity. v3: * Drop exec_msc = target_msc again in present_wnmd_execute. * present_execute_copy should never set vblank->queued in present_wnmd_execute now, so replace that branch with an assertion. (Roman Gilg) Reviewed-by: Roman Gilg <subdiff@gmail.com> Tested-by: Roman Gilg <subdiff@gmail.com>
2020-08-25present/wnmd: Move up present_wnmd_queue_vblankMichel Dänzer1-11/+11
Allowing it to be called from more functions than before. No functional change. Reviewed-by: Roman Gilg <subdiff@gmail.com> Tested-by: Roman Gilg <subdiff@gmail.com>
2020-08-25present: Add present_vblank::exec_msc fieldMichel Dänzer5-31/+31
For tracking the MSC when the present can be executed separately from the target MSC. Allows removing the requeue field instead, plus more later. v2: * Rename wait_msc → exec_msc (Roman Gilg) * Use exec_msc = target_msc instead of exec_msc++, for clarity. * Bug fix: Set exec_msc = target_msc also if present_flip returned false in present_execute. v3: * Set exec_msc = target_msc also if present_wnmd_flip returned false in present_wnmd_execute, for consistency. v4: * Specifically check for exec_msc == crtc_msc + 1 in present_execute_wait/copy, to avoid re-introducing https://bugs.freedesktop.org/show_bug.cgi?id=94596 . Reviewed-by: Roman Gilg <subdiff@gmail.com> Tested-by: Roman Gilg <subdiff@gmail.com>
2020-08-25present: Move flip target_msc adjustment out of present_vblank_createMichel Dänzer4-8/+13
Preparation for different handling between SCMD & WNMD. No functional change intended. Reviewed-by: Roman Gilg <subdiff@gmail.com> Tested-by: Roman Gilg <subdiff@gmail.com>
2020-07-24present: Check valid region in window mode flipsRoman Gilg1-4/+6
For Pixmap flips to have well defined outcomes the window must be contained by the valid region if such region was specified. The valid region is inserted as an argument to the check in window mode. Setting this argument is missing in screen mode as well but we ignore it for now and only add it to window mode. It seems there are none or only very few clients actually making use of valid regions at the moment. For simplicity we therefore just check if a valid region was set by the client and in this case do never flip, independently of the window being contained by the region or not. Signed-off-by: Roman Gilg <subdiff@gmail.com>
2020-07-22present: Remove superfluous set abort flip function in window modeRoman Gilg2-15/+2
The function is never called from present_screen.c in contrast to the behavior in screen mode. In present_wnmd.c we can simply remove the function which does an unnecessary check of the property before setting it and directly set the property at the two locations the function was called previously. Signed-off-by: Roman Gilg <subdiff@gmail.com>
2020-07-22present: Idle vblanks any time in window modeRoman Gilg1-0/+7
With the newly introduced separate API method for idling a presented Pixmap in window mode we can simplify the logic by allowing calls to it at any point in time. This is done by setting the flip_idler flag if the Pixmap was idled before being presented. Signed-off-by: Roman Gilg <subdiff@gmail.com>
2020-07-22present: Notify via distinct API functions in window modeRoman Gilg2-13/+46
Notifying Present about events' states was done prior with the single function present_wnmd_event_notify just like in screen mode. But it is more intelligible if at least in window mode we make use of three different functions with names that directly indicate what their purpose is: * present_wnmd_event_notify only for queued events feedback. * present_wnmd_flip_notify for when a presentation occured (flip). * present_wnmd_idle_notify for when the Pixmap of the event can be reused. This is an API-breaking change in regards to window mode. DDX written against the previous version won't work anymore. It is assumed that there only exists the XWayland DDX at the moment using the window mode such that this is not an issue for the overall ecosystem. Signed-off-by: Roman Gilg <subdiff@gmail.com>
2020-07-05Fix spelling/wording issuesAlan Coopersmith2-2/+2
Most (but not all) of these were found by using codespell --builtin clear,rare,usage,informal,code,names but not everything reported by that was fixed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-25present/wnmd: Free flip_queue entries in present_wnmd_clear_window_flipMichel Dänzer1-3/+3
When present_wnmd_clear_window_flip is done, present_destroy_window frees struct present_window_priv, and the events in the flip queue become unreachable. So if we don't free them first, they're leaked. Also drop the call to present_wnmd_set_abort_flip, which just sets a flag in struct present_window_priv and thus can't have any observable effect after present_destroy_window. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1042 Reviewed-by: Dave Airlie <airlied@redhat.com>
2020-06-25present/wnmd: Keep pixmap pointer in present_wnmd_clear_window_flipMichel Dänzer1-2/+0
The comment was incorrect: Any reference held by the window (see present_wnmd_execute) is in addition to the one in struct present_vblank (see present_vblank_create). So if we don't drop the latter, the pixmap will be leaked. Reviewed-by: Dave Airlie <airlied@redhat.com>