Commit b6419359 authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer
Browse files

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: default avatarOlivier Fourdan <ofourdan@redhat.com>
parent c35a716b
This diff is collapsed.
......@@ -29,6 +29,7 @@
#include <xwayland-config.h>
#include <dix.h>
#include <present_priv.h>
#include "xwayland-types.h"
......@@ -47,6 +48,12 @@ struct xwl_present_window {
struct xorg_list wait_list;
struct xorg_list release_list;
struct xorg_list exec_queue;
struct xorg_list flip_queue;
struct xorg_list idle_queue;
present_vblank_ptr flip_pending;
present_vblank_ptr flip_active;
};
struct xwl_present_event {
......
......@@ -687,6 +687,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
if (!xwl_screen_init_cursor(xwl_screen))
return FALSE;
xwl_screen->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = xwl_destroy_window;
#ifdef XWL_HAS_GLAMOR
if (xwl_screen->glamor) {
xwl_glamor_select_backend(xwl_screen, use_eglstreams);
......@@ -714,9 +717,6 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->UnrealizeWindow = pScreen->UnrealizeWindow;
pScreen->UnrealizeWindow = xwl_unrealize_window;
xwl_screen->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = xwl_destroy_window;
xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen;
......
......@@ -14,7 +14,6 @@ libpresent_la_SOURCES = \
present_request.c \
present_scmd.c \
present_screen.c \
present_vblank.c \
present_wnmd.c
present_vblank.c
sdk_HEADERS = present.h presentext.h
......@@ -9,7 +9,6 @@ srcs_present = [
'present_scmd.c',
'present_screen.c',
'present_vblank.c',
'present_wnmd.c',
]
hdrs_present = [
......
......@@ -161,30 +161,8 @@ typedef struct present_wnmd_info {
extern _X_EXPORT void
present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc);
/*
* Called when 'event_id' occurs for 'window'.
* 'ust' and 'msc' indicate when the event actually happened
*/
extern _X_EXPORT void
present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uint64_t msc);
/*
* Called when presentation 'event_id' occurs for 'window'.
* 'ust' and 'msc' indicate when the presentation actually happened.
*/
extern _X_EXPORT void
present_wnmd_flip_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uint64_t msc);
/*
* Called when the flipped Pixmap associated with 'event_id' is not used anymore by the DDX.
*/
extern _X_EXPORT void
present_wnmd_idle_notify(WindowPtr window, uint64_t event_id);
extern _X_EXPORT Bool
present_screen_init(ScreenPtr screen, present_screen_info_ptr info);
extern _X_EXPORT Bool
present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info);
typedef void (*present_complete_notify_proc)(WindowPtr window,
CARD8 kind,
......
......@@ -219,14 +219,6 @@ struct present_window_priv {
uint64_t msc; /* Last reported MSC from the current crtc */
struct xorg_list vblank;
struct xorg_list notifies;
/* Used for window flips */
struct xorg_list exec_queue;
struct xorg_list flip_queue;
struct xorg_list idle_queue;
present_vblank_ptr flip_pending;
present_vblank_ptr flip_active;
};
#define PresentCrtcNeverSet ((RRCrtcPtr) 1)
......
......@@ -42,10 +42,6 @@ present_get_window_priv(WindowPtr window, Bool create)
xorg_list_init(&window_priv->vblank);
xorg_list_init(&window_priv->notifies);
xorg_list_init(&window_priv->exec_queue);
xorg_list_init(&window_priv->flip_queue);
xorg_list_init(&window_priv->idle_queue);
window_priv->window = window;
window_priv->crtc = PresentCrtcNeverSet;
dixSetPrivate(&window->devPrivates, &present_window_private_key, window_priv);
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment