xref: /OK3568_Linux_fs/external/xserver/present/present_priv.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright © 2013 Keith Packard
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Permission to use, copy, modify, distribute, and sell this software and its
5*4882a593Smuzhiyun  * documentation for any purpose is hereby granted without fee, provided that
6*4882a593Smuzhiyun  * the above copyright notice appear in all copies and that both that copyright
7*4882a593Smuzhiyun  * notice and this permission notice appear in supporting documentation, and
8*4882a593Smuzhiyun  * that the name of the copyright holders not be used in advertising or
9*4882a593Smuzhiyun  * publicity pertaining to distribution of the software without specific,
10*4882a593Smuzhiyun  * written prior permission.  The copyright holders make no representations
11*4882a593Smuzhiyun  * about the suitability of this software for any purpose.  It is provided "as
12*4882a593Smuzhiyun  * is" without express or implied warranty.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15*4882a593Smuzhiyun  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16*4882a593Smuzhiyun  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17*4882a593Smuzhiyun  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18*4882a593Smuzhiyun  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19*4882a593Smuzhiyun  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20*4882a593Smuzhiyun  * OF THIS SOFTWARE.
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #ifndef _PRESENT_PRIV_H_
24*4882a593Smuzhiyun #define _PRESENT_PRIV_H_
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #include <X11/X.h>
27*4882a593Smuzhiyun #include "scrnintstr.h"
28*4882a593Smuzhiyun #include "misc.h"
29*4882a593Smuzhiyun #include "list.h"
30*4882a593Smuzhiyun #include "windowstr.h"
31*4882a593Smuzhiyun #include "dixstruct.h"
32*4882a593Smuzhiyun #include "present.h"
33*4882a593Smuzhiyun #include <syncsdk.h>
34*4882a593Smuzhiyun #include <syncsrv.h>
35*4882a593Smuzhiyun #include <xfixes.h>
36*4882a593Smuzhiyun #include <randrstr.h>
37*4882a593Smuzhiyun #include <inttypes.h>
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #if 0
40*4882a593Smuzhiyun #define DebugPresent(x) ErrorF x
41*4882a593Smuzhiyun #else
42*4882a593Smuzhiyun #define DebugPresent(x)
43*4882a593Smuzhiyun #endif
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun extern int present_request;
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun extern DevPrivateKeyRec present_screen_private_key;
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun typedef struct present_fence *present_fence_ptr;
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun typedef struct present_notify present_notify_rec, *present_notify_ptr;
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun struct present_notify {
54*4882a593Smuzhiyun     struct xorg_list    window_list;
55*4882a593Smuzhiyun     WindowPtr           window;
56*4882a593Smuzhiyun     CARD32              serial;
57*4882a593Smuzhiyun };
58*4882a593Smuzhiyun 
59*4882a593Smuzhiyun struct present_vblank {
60*4882a593Smuzhiyun     struct xorg_list    window_list;
61*4882a593Smuzhiyun     struct xorg_list    event_queue;
62*4882a593Smuzhiyun     ScreenPtr           screen;
63*4882a593Smuzhiyun     WindowPtr           window;
64*4882a593Smuzhiyun     PixmapPtr           pixmap;
65*4882a593Smuzhiyun     RegionPtr           valid;
66*4882a593Smuzhiyun     RegionPtr           update;
67*4882a593Smuzhiyun     RRCrtcPtr           crtc;
68*4882a593Smuzhiyun     uint32_t            serial;
69*4882a593Smuzhiyun     int16_t             x_off;
70*4882a593Smuzhiyun     int16_t             y_off;
71*4882a593Smuzhiyun     CARD16              kind;
72*4882a593Smuzhiyun     uint64_t            event_id;
73*4882a593Smuzhiyun     uint64_t            target_msc;     /* target MSC when present should complete */
74*4882a593Smuzhiyun     uint64_t            exec_msc;       /* MSC at which present can be executed */
75*4882a593Smuzhiyun     uint64_t            msc_offset;
76*4882a593Smuzhiyun     present_fence_ptr   idle_fence;
77*4882a593Smuzhiyun     present_fence_ptr   wait_fence;
78*4882a593Smuzhiyun     present_notify_ptr  notifies;
79*4882a593Smuzhiyun     int                 num_notifies;
80*4882a593Smuzhiyun     Bool                queued;         /* on present_exec_queue */
81*4882a593Smuzhiyun     Bool                flip;           /* planning on using flip */
82*4882a593Smuzhiyun     Bool                flip_ready;     /* wants to flip, but waiting for previous flip or unflip */
83*4882a593Smuzhiyun     Bool                flip_idler;     /* driver explicitly permitted idling */
84*4882a593Smuzhiyun     Bool                sync_flip;      /* do flip synchronous to vblank */
85*4882a593Smuzhiyun     Bool                abort_flip;     /* aborting this flip */
86*4882a593Smuzhiyun     PresentFlipReason   reason;         /* reason for which flip is not possible */
87*4882a593Smuzhiyun     Bool                has_suboptimal; /* whether client can support SuboptimalCopy mode */
88*4882a593Smuzhiyun };
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun typedef struct present_screen_priv present_screen_priv_rec, *present_screen_priv_ptr;
91*4882a593Smuzhiyun typedef struct present_window_priv present_window_priv_rec, *present_window_priv_ptr;
92*4882a593Smuzhiyun 
93*4882a593Smuzhiyun /*
94*4882a593Smuzhiyun  * Mode hooks
95*4882a593Smuzhiyun  */
96*4882a593Smuzhiyun typedef uint32_t (*present_priv_query_capabilities_ptr)(present_screen_priv_ptr screen_priv);
97*4882a593Smuzhiyun typedef RRCrtcPtr (*present_priv_get_crtc_ptr)(present_screen_priv_ptr screen_priv,
98*4882a593Smuzhiyun                                                WindowPtr window);
99*4882a593Smuzhiyun 
100*4882a593Smuzhiyun typedef Bool (*present_priv_check_flip_ptr)(RRCrtcPtr crtc,
101*4882a593Smuzhiyun                                             WindowPtr window,
102*4882a593Smuzhiyun                                             PixmapPtr pixmap,
103*4882a593Smuzhiyun                                             Bool sync_flip,
104*4882a593Smuzhiyun                                             RegionPtr valid,
105*4882a593Smuzhiyun                                             int16_t x_off,
106*4882a593Smuzhiyun                                             int16_t y_off,
107*4882a593Smuzhiyun                                             PresentFlipReason *reason);
108*4882a593Smuzhiyun typedef void (*present_priv_check_flip_window_ptr)(WindowPtr window);
109*4882a593Smuzhiyun typedef Bool (*present_priv_can_window_flip_ptr)(WindowPtr window);
110*4882a593Smuzhiyun 
111*4882a593Smuzhiyun typedef int (*present_priv_pixmap_ptr)(WindowPtr window,
112*4882a593Smuzhiyun                                        PixmapPtr pixmap,
113*4882a593Smuzhiyun                                        CARD32 serial,
114*4882a593Smuzhiyun                                        RegionPtr valid,
115*4882a593Smuzhiyun                                        RegionPtr update,
116*4882a593Smuzhiyun                                        int16_t x_off,
117*4882a593Smuzhiyun                                        int16_t y_off,
118*4882a593Smuzhiyun                                        RRCrtcPtr target_crtc,
119*4882a593Smuzhiyun                                        SyncFence *wait_fence,
120*4882a593Smuzhiyun                                        SyncFence *idle_fence,
121*4882a593Smuzhiyun                                        uint32_t options,
122*4882a593Smuzhiyun                                        uint64_t window_msc,
123*4882a593Smuzhiyun                                        uint64_t divisor,
124*4882a593Smuzhiyun                                        uint64_t remainder,
125*4882a593Smuzhiyun                                        present_notify_ptr notifies,
126*4882a593Smuzhiyun                                        int num_notifies);
127*4882a593Smuzhiyun 
128*4882a593Smuzhiyun typedef void (*present_priv_create_event_id_ptr)(present_window_priv_ptr window_priv,
129*4882a593Smuzhiyun                                                  present_vblank_ptr vblank);
130*4882a593Smuzhiyun 
131*4882a593Smuzhiyun typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen,
132*4882a593Smuzhiyun                                              WindowPtr window,
133*4882a593Smuzhiyun                                              RRCrtcPtr crtc,
134*4882a593Smuzhiyun                                              uint64_t event_id,
135*4882a593Smuzhiyun                                              uint64_t msc);
136*4882a593Smuzhiyun typedef void (*present_priv_flush_ptr)(WindowPtr window);
137*4882a593Smuzhiyun typedef void (*present_priv_re_execute_ptr)(present_vblank_ptr vblank);
138*4882a593Smuzhiyun 
139*4882a593Smuzhiyun typedef void (*present_priv_abort_vblank_ptr)(ScreenPtr screen,
140*4882a593Smuzhiyun                                               WindowPtr window,
141*4882a593Smuzhiyun                                               RRCrtcPtr crtc,
142*4882a593Smuzhiyun                                               uint64_t event_id,
143*4882a593Smuzhiyun                                               uint64_t msc);
144*4882a593Smuzhiyun typedef void (*present_priv_flip_destroy_ptr)(ScreenPtr screen);
145*4882a593Smuzhiyun 
146*4882a593Smuzhiyun struct present_screen_priv {
147*4882a593Smuzhiyun     CloseScreenProcPtr          CloseScreen;
148*4882a593Smuzhiyun     ConfigNotifyProcPtr         ConfigNotify;
149*4882a593Smuzhiyun     DestroyWindowProcPtr        DestroyWindow;
150*4882a593Smuzhiyun     ClipNotifyProcPtr           ClipNotify;
151*4882a593Smuzhiyun 
152*4882a593Smuzhiyun     present_vblank_ptr          flip_pending;
153*4882a593Smuzhiyun     uint64_t                    unflip_event_id;
154*4882a593Smuzhiyun 
155*4882a593Smuzhiyun     uint32_t                    fake_interval;
156*4882a593Smuzhiyun 
157*4882a593Smuzhiyun     /* Currently active flipped pixmap and fence */
158*4882a593Smuzhiyun     RRCrtcPtr                   flip_crtc;
159*4882a593Smuzhiyun     WindowPtr                   flip_window;
160*4882a593Smuzhiyun     uint32_t                    flip_serial;
161*4882a593Smuzhiyun     PixmapPtr                   flip_pixmap;
162*4882a593Smuzhiyun     present_fence_ptr           flip_idle_fence;
163*4882a593Smuzhiyun     Bool                        flip_sync;
164*4882a593Smuzhiyun 
165*4882a593Smuzhiyun     present_screen_info_ptr     info;
166*4882a593Smuzhiyun     present_wnmd_info_ptr       wnmd_info;
167*4882a593Smuzhiyun 
168*4882a593Smuzhiyun     /* Mode hooks */
169*4882a593Smuzhiyun     present_priv_query_capabilities_ptr query_capabilities;
170*4882a593Smuzhiyun     present_priv_get_crtc_ptr           get_crtc;
171*4882a593Smuzhiyun 
172*4882a593Smuzhiyun     present_priv_check_flip_ptr         check_flip;
173*4882a593Smuzhiyun     present_priv_check_flip_window_ptr  check_flip_window;
174*4882a593Smuzhiyun     present_priv_can_window_flip_ptr    can_window_flip;
175*4882a593Smuzhiyun 
176*4882a593Smuzhiyun     present_priv_pixmap_ptr             present_pixmap;
177*4882a593Smuzhiyun     present_priv_create_event_id_ptr    create_event_id;
178*4882a593Smuzhiyun 
179*4882a593Smuzhiyun     present_priv_queue_vblank_ptr       queue_vblank;
180*4882a593Smuzhiyun     present_priv_flush_ptr              flush;
181*4882a593Smuzhiyun     present_priv_re_execute_ptr         re_execute;
182*4882a593Smuzhiyun 
183*4882a593Smuzhiyun     present_priv_abort_vblank_ptr       abort_vblank;
184*4882a593Smuzhiyun     present_priv_flip_destroy_ptr       flip_destroy;
185*4882a593Smuzhiyun };
186*4882a593Smuzhiyun 
187*4882a593Smuzhiyun #define wrap(priv,real,mem,func) {\
188*4882a593Smuzhiyun     priv->mem = real->mem; \
189*4882a593Smuzhiyun     real->mem = func; \
190*4882a593Smuzhiyun }
191*4882a593Smuzhiyun 
192*4882a593Smuzhiyun #define unwrap(priv,real,mem) {\
193*4882a593Smuzhiyun     real->mem = priv->mem; \
194*4882a593Smuzhiyun }
195*4882a593Smuzhiyun 
196*4882a593Smuzhiyun static inline present_screen_priv_ptr
present_screen_priv(ScreenPtr screen)197*4882a593Smuzhiyun present_screen_priv(ScreenPtr screen)
198*4882a593Smuzhiyun {
199*4882a593Smuzhiyun     return (present_screen_priv_ptr)dixLookupPrivate(&(screen)->devPrivates, &present_screen_private_key);
200*4882a593Smuzhiyun }
201*4882a593Smuzhiyun 
202*4882a593Smuzhiyun /*
203*4882a593Smuzhiyun  * Each window has a list of clients and event masks
204*4882a593Smuzhiyun  */
205*4882a593Smuzhiyun typedef struct present_event *present_event_ptr;
206*4882a593Smuzhiyun 
207*4882a593Smuzhiyun typedef struct present_event {
208*4882a593Smuzhiyun     present_event_ptr next;
209*4882a593Smuzhiyun     ClientPtr client;
210*4882a593Smuzhiyun     WindowPtr window;
211*4882a593Smuzhiyun     XID id;
212*4882a593Smuzhiyun     int mask;
213*4882a593Smuzhiyun } present_event_rec;
214*4882a593Smuzhiyun 
215*4882a593Smuzhiyun struct present_window_priv {
216*4882a593Smuzhiyun     WindowPtr              window;
217*4882a593Smuzhiyun     present_event_ptr      events;
218*4882a593Smuzhiyun     RRCrtcPtr              crtc;        /* Last reported CRTC from get_ust_msc */
219*4882a593Smuzhiyun     uint64_t               msc_offset;
220*4882a593Smuzhiyun     uint64_t               msc;         /* Last reported MSC from the current crtc */
221*4882a593Smuzhiyun     struct xorg_list       vblank;
222*4882a593Smuzhiyun     struct xorg_list       notifies;
223*4882a593Smuzhiyun 
224*4882a593Smuzhiyun     /* Used for window flips */
225*4882a593Smuzhiyun     uint64_t               event_id;
226*4882a593Smuzhiyun     struct xorg_list       exec_queue;
227*4882a593Smuzhiyun     struct xorg_list       flip_queue;
228*4882a593Smuzhiyun     struct xorg_list       idle_queue;
229*4882a593Smuzhiyun 
230*4882a593Smuzhiyun     present_vblank_ptr     flip_pending;
231*4882a593Smuzhiyun     present_vblank_ptr     flip_active;
232*4882a593Smuzhiyun };
233*4882a593Smuzhiyun 
234*4882a593Smuzhiyun #define PresentCrtcNeverSet     ((RRCrtcPtr) 1)
235*4882a593Smuzhiyun 
236*4882a593Smuzhiyun extern DevPrivateKeyRec present_window_private_key;
237*4882a593Smuzhiyun 
238*4882a593Smuzhiyun static inline present_window_priv_ptr
present_window_priv(WindowPtr window)239*4882a593Smuzhiyun present_window_priv(WindowPtr window)
240*4882a593Smuzhiyun {
241*4882a593Smuzhiyun     return (present_window_priv_ptr)dixGetPrivate(&(window)->devPrivates, &present_window_private_key);
242*4882a593Smuzhiyun }
243*4882a593Smuzhiyun 
244*4882a593Smuzhiyun present_window_priv_ptr
245*4882a593Smuzhiyun present_get_window_priv(WindowPtr window, Bool create);
246*4882a593Smuzhiyun 
247*4882a593Smuzhiyun /*
248*4882a593Smuzhiyun  * Returns:
249*4882a593Smuzhiyun  * TRUE if the first MSC value is after the second one
250*4882a593Smuzhiyun  * FALSE if the first MSC value is equal to or before the second one
251*4882a593Smuzhiyun  */
252*4882a593Smuzhiyun static inline Bool
msc_is_after(uint64_t test,uint64_t reference)253*4882a593Smuzhiyun msc_is_after(uint64_t test, uint64_t reference)
254*4882a593Smuzhiyun {
255*4882a593Smuzhiyun     return (int64_t)(test - reference) > 0;
256*4882a593Smuzhiyun }
257*4882a593Smuzhiyun 
258*4882a593Smuzhiyun /*
259*4882a593Smuzhiyun  * present.c
260*4882a593Smuzhiyun  */
261*4882a593Smuzhiyun uint32_t
262*4882a593Smuzhiyun present_query_capabilities(RRCrtcPtr crtc);
263*4882a593Smuzhiyun 
264*4882a593Smuzhiyun RRCrtcPtr
265*4882a593Smuzhiyun present_get_crtc(WindowPtr window);
266*4882a593Smuzhiyun 
267*4882a593Smuzhiyun void
268*4882a593Smuzhiyun present_copy_region(DrawablePtr drawable,
269*4882a593Smuzhiyun                     PixmapPtr pixmap,
270*4882a593Smuzhiyun                     RegionPtr update,
271*4882a593Smuzhiyun                     int16_t x_off,
272*4882a593Smuzhiyun                     int16_t y_off);
273*4882a593Smuzhiyun 
274*4882a593Smuzhiyun void
275*4882a593Smuzhiyun present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct present_fence *present_fence);
276*4882a593Smuzhiyun 
277*4882a593Smuzhiyun void
278*4882a593Smuzhiyun present_set_tree_pixmap(WindowPtr window,
279*4882a593Smuzhiyun                         PixmapPtr expected,
280*4882a593Smuzhiyun                         PixmapPtr pixmap);
281*4882a593Smuzhiyun 
282*4882a593Smuzhiyun void
283*4882a593Smuzhiyun present_adjust_timings(uint32_t options,
284*4882a593Smuzhiyun                        uint64_t *crtc_msc,
285*4882a593Smuzhiyun                        uint64_t *target_msc,
286*4882a593Smuzhiyun                        uint64_t divisor,
287*4882a593Smuzhiyun                        uint64_t remainder);
288*4882a593Smuzhiyun 
289*4882a593Smuzhiyun int
290*4882a593Smuzhiyun present_pixmap(WindowPtr window,
291*4882a593Smuzhiyun                PixmapPtr pixmap,
292*4882a593Smuzhiyun                CARD32 serial,
293*4882a593Smuzhiyun                RegionPtr valid,
294*4882a593Smuzhiyun                RegionPtr update,
295*4882a593Smuzhiyun                int16_t x_off,
296*4882a593Smuzhiyun                int16_t y_off,
297*4882a593Smuzhiyun                RRCrtcPtr target_crtc,
298*4882a593Smuzhiyun                SyncFence *wait_fence,
299*4882a593Smuzhiyun                SyncFence *idle_fence,
300*4882a593Smuzhiyun                uint32_t options,
301*4882a593Smuzhiyun                uint64_t target_msc,
302*4882a593Smuzhiyun                uint64_t divisor,
303*4882a593Smuzhiyun                uint64_t remainder,
304*4882a593Smuzhiyun                present_notify_ptr notifies,
305*4882a593Smuzhiyun                int num_notifies);
306*4882a593Smuzhiyun 
307*4882a593Smuzhiyun int
308*4882a593Smuzhiyun present_notify_msc(WindowPtr window,
309*4882a593Smuzhiyun                    CARD32 serial,
310*4882a593Smuzhiyun                    uint64_t target_msc,
311*4882a593Smuzhiyun                    uint64_t divisor,
312*4882a593Smuzhiyun                    uint64_t remainder);
313*4882a593Smuzhiyun 
314*4882a593Smuzhiyun /*
315*4882a593Smuzhiyun  * present_event.c
316*4882a593Smuzhiyun  */
317*4882a593Smuzhiyun 
318*4882a593Smuzhiyun void
319*4882a593Smuzhiyun present_free_events(WindowPtr window);
320*4882a593Smuzhiyun 
321*4882a593Smuzhiyun void
322*4882a593Smuzhiyun present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling);
323*4882a593Smuzhiyun 
324*4882a593Smuzhiyun void
325*4882a593Smuzhiyun present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc);
326*4882a593Smuzhiyun 
327*4882a593Smuzhiyun void
328*4882a593Smuzhiyun present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, present_fence_ptr idle_fence);
329*4882a593Smuzhiyun 
330*4882a593Smuzhiyun int
331*4882a593Smuzhiyun present_select_input(ClientPtr client,
332*4882a593Smuzhiyun                      CARD32 eid,
333*4882a593Smuzhiyun                      WindowPtr window,
334*4882a593Smuzhiyun                      CARD32 event_mask);
335*4882a593Smuzhiyun 
336*4882a593Smuzhiyun Bool
337*4882a593Smuzhiyun present_event_init(void);
338*4882a593Smuzhiyun 
339*4882a593Smuzhiyun /*
340*4882a593Smuzhiyun  * present_execute.c
341*4882a593Smuzhiyun  */
342*4882a593Smuzhiyun Bool
343*4882a593Smuzhiyun present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc);
344*4882a593Smuzhiyun 
345*4882a593Smuzhiyun void
346*4882a593Smuzhiyun present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc);
347*4882a593Smuzhiyun 
348*4882a593Smuzhiyun void
349*4882a593Smuzhiyun present_execute_post(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
350*4882a593Smuzhiyun 
351*4882a593Smuzhiyun /*
352*4882a593Smuzhiyun  * present_fake.c
353*4882a593Smuzhiyun  */
354*4882a593Smuzhiyun int
355*4882a593Smuzhiyun present_fake_get_ust_msc(ScreenPtr screen, uint64_t *ust, uint64_t *msc);
356*4882a593Smuzhiyun 
357*4882a593Smuzhiyun int
358*4882a593Smuzhiyun present_fake_queue_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc);
359*4882a593Smuzhiyun 
360*4882a593Smuzhiyun void
361*4882a593Smuzhiyun present_fake_abort_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc);
362*4882a593Smuzhiyun 
363*4882a593Smuzhiyun void
364*4882a593Smuzhiyun present_fake_screen_init(ScreenPtr screen);
365*4882a593Smuzhiyun 
366*4882a593Smuzhiyun void
367*4882a593Smuzhiyun present_fake_queue_init(void);
368*4882a593Smuzhiyun 
369*4882a593Smuzhiyun /*
370*4882a593Smuzhiyun  * present_fence.c
371*4882a593Smuzhiyun  */
372*4882a593Smuzhiyun struct present_fence *
373*4882a593Smuzhiyun present_fence_create(SyncFence *sync_fence);
374*4882a593Smuzhiyun 
375*4882a593Smuzhiyun void
376*4882a593Smuzhiyun present_fence_destroy(struct present_fence *present_fence);
377*4882a593Smuzhiyun 
378*4882a593Smuzhiyun void
379*4882a593Smuzhiyun present_fence_set_triggered(struct present_fence *present_fence);
380*4882a593Smuzhiyun 
381*4882a593Smuzhiyun Bool
382*4882a593Smuzhiyun present_fence_check_triggered(struct present_fence *present_fence);
383*4882a593Smuzhiyun 
384*4882a593Smuzhiyun void
385*4882a593Smuzhiyun present_fence_set_callback(struct present_fence *present_fence,
386*4882a593Smuzhiyun                            void (*callback)(void *param),
387*4882a593Smuzhiyun                            void *param);
388*4882a593Smuzhiyun 
389*4882a593Smuzhiyun XID
390*4882a593Smuzhiyun present_fence_id(struct present_fence *present_fence);
391*4882a593Smuzhiyun 
392*4882a593Smuzhiyun /*
393*4882a593Smuzhiyun  * present_notify.c
394*4882a593Smuzhiyun  */
395*4882a593Smuzhiyun void
396*4882a593Smuzhiyun present_clear_window_notifies(WindowPtr window);
397*4882a593Smuzhiyun 
398*4882a593Smuzhiyun void
399*4882a593Smuzhiyun present_free_window_notify(present_notify_ptr notify);
400*4882a593Smuzhiyun 
401*4882a593Smuzhiyun int
402*4882a593Smuzhiyun present_add_window_notify(present_notify_ptr notify);
403*4882a593Smuzhiyun 
404*4882a593Smuzhiyun int
405*4882a593Smuzhiyun present_create_notifies(ClientPtr client, int num_notifies, xPresentNotify *x_notifies, present_notify_ptr *p_notifies);
406*4882a593Smuzhiyun 
407*4882a593Smuzhiyun void
408*4882a593Smuzhiyun present_destroy_notifies(present_notify_ptr notifies, int num_notifies);
409*4882a593Smuzhiyun 
410*4882a593Smuzhiyun /*
411*4882a593Smuzhiyun  * present_redirect.c
412*4882a593Smuzhiyun  */
413*4882a593Smuzhiyun 
414*4882a593Smuzhiyun WindowPtr
415*4882a593Smuzhiyun present_redirect(ClientPtr client, WindowPtr target);
416*4882a593Smuzhiyun 
417*4882a593Smuzhiyun /*
418*4882a593Smuzhiyun  * present_request.c
419*4882a593Smuzhiyun  */
420*4882a593Smuzhiyun int
421*4882a593Smuzhiyun proc_present_dispatch(ClientPtr client);
422*4882a593Smuzhiyun 
423*4882a593Smuzhiyun int
424*4882a593Smuzhiyun sproc_present_dispatch(ClientPtr client);
425*4882a593Smuzhiyun 
426*4882a593Smuzhiyun /*
427*4882a593Smuzhiyun  * present_scmd.c
428*4882a593Smuzhiyun  */
429*4882a593Smuzhiyun void
430*4882a593Smuzhiyun present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc);
431*4882a593Smuzhiyun 
432*4882a593Smuzhiyun void
433*4882a593Smuzhiyun present_flip_destroy(ScreenPtr screen);
434*4882a593Smuzhiyun 
435*4882a593Smuzhiyun void
436*4882a593Smuzhiyun present_restore_screen_pixmap(ScreenPtr screen);
437*4882a593Smuzhiyun 
438*4882a593Smuzhiyun void
439*4882a593Smuzhiyun present_set_abort_flip(ScreenPtr screen);
440*4882a593Smuzhiyun 
441*4882a593Smuzhiyun Bool
442*4882a593Smuzhiyun present_init(void);
443*4882a593Smuzhiyun 
444*4882a593Smuzhiyun void
445*4882a593Smuzhiyun present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv);
446*4882a593Smuzhiyun 
447*4882a593Smuzhiyun /*
448*4882a593Smuzhiyun  * present_screen.c
449*4882a593Smuzhiyun  */
450*4882a593Smuzhiyun 
451*4882a593Smuzhiyun /*
452*4882a593Smuzhiyun  * present_vblank.c
453*4882a593Smuzhiyun  */
454*4882a593Smuzhiyun void
455*4882a593Smuzhiyun present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_t ust, uint64_t crtc_msc);
456*4882a593Smuzhiyun 
457*4882a593Smuzhiyun present_vblank_ptr
458*4882a593Smuzhiyun present_vblank_create(WindowPtr window,
459*4882a593Smuzhiyun                       PixmapPtr pixmap,
460*4882a593Smuzhiyun                       CARD32 serial,
461*4882a593Smuzhiyun                       RegionPtr valid,
462*4882a593Smuzhiyun                       RegionPtr update,
463*4882a593Smuzhiyun                       int16_t x_off,
464*4882a593Smuzhiyun                       int16_t y_off,
465*4882a593Smuzhiyun                       RRCrtcPtr target_crtc,
466*4882a593Smuzhiyun                       SyncFence *wait_fence,
467*4882a593Smuzhiyun                       SyncFence *idle_fence,
468*4882a593Smuzhiyun                       uint32_t options,
469*4882a593Smuzhiyun                       const uint32_t *capabilities,
470*4882a593Smuzhiyun                       present_notify_ptr notifies,
471*4882a593Smuzhiyun                       int num_notifies,
472*4882a593Smuzhiyun                       uint64_t target_msc,
473*4882a593Smuzhiyun                       uint64_t crtc_msc);
474*4882a593Smuzhiyun 
475*4882a593Smuzhiyun void
476*4882a593Smuzhiyun present_vblank_scrap(present_vblank_ptr vblank);
477*4882a593Smuzhiyun 
478*4882a593Smuzhiyun void
479*4882a593Smuzhiyun present_vblank_destroy(present_vblank_ptr vblank);
480*4882a593Smuzhiyun 
481*4882a593Smuzhiyun /*
482*4882a593Smuzhiyun  * present_wnmd.c
483*4882a593Smuzhiyun  */
484*4882a593Smuzhiyun void
485*4882a593Smuzhiyun present_wnmd_set_abort_flip(WindowPtr window);
486*4882a593Smuzhiyun 
487*4882a593Smuzhiyun void
488*4882a593Smuzhiyun present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv);
489*4882a593Smuzhiyun 
490*4882a593Smuzhiyun #endif /*  _PRESENT_PRIV_H_ */
491