117ca54c3Smrg/*
217ca54c3Smrg * Copyright © 2013 Keith Packard
317ca54c3Smrg *
417ca54c3Smrg * Permission to use, copy, modify, distribute, and sell this software and its
517ca54c3Smrg * documentation for any purpose is hereby granted without fee, provided that
617ca54c3Smrg * the above copyright notice appear in all copies and that both that copyright
717ca54c3Smrg * notice and this permission notice appear in supporting documentation, and
817ca54c3Smrg * that the name of the copyright holders not be used in advertising or
917ca54c3Smrg * publicity pertaining to distribution of the software without specific,
1017ca54c3Smrg * written prior permission.  The copyright holders make no representations
1117ca54c3Smrg * about the suitability of this software for any purpose.  It is provided "as
1217ca54c3Smrg * is" without express or implied warranty.
1317ca54c3Smrg *
1417ca54c3Smrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1517ca54c3Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1617ca54c3Smrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1717ca54c3Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1817ca54c3Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1917ca54c3Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
2017ca54c3Smrg * OF THIS SOFTWARE.
2117ca54c3Smrg */
2217ca54c3Smrg
2317ca54c3Smrg#ifndef _PRESENT_TOKENS_H_
2417ca54c3Smrg#define _PRESENT_TOKENS_H_
2517ca54c3Smrg
2617ca54c3Smrg#define PRESENT_NAME			"Present"
2717ca54c3Smrg#define PRESENT_MAJOR			1
28635a5eb8Smrg#define PRESENT_MINOR			4
2917ca54c3Smrg
3017ca54c3Smrg#define PresentNumberErrors		0
3117ca54c3Smrg#define PresentNumberEvents		0
3217ca54c3Smrg
3317ca54c3Smrg/* Requests */
3417ca54c3Smrg#define X_PresentQueryVersion		0
3517ca54c3Smrg#define X_PresentPixmap			1
3617ca54c3Smrg#define X_PresentNotifyMSC		2
3717ca54c3Smrg#define X_PresentSelectInput		3
3817ca54c3Smrg#define X_PresentQueryCapabilities      4
39635a5eb8Smrg#define X_PresentPixmapSynced		5
4017ca54c3Smrg
41635a5eb8Smrg#define PresentNumberRequests		6
4217ca54c3Smrg
4317ca54c3Smrg/* Present operation options */
4417ca54c3Smrg#define PresentOptionNone               0
4517ca54c3Smrg#define PresentOptionAsync              (1 << 0)
4617ca54c3Smrg#define PresentOptionCopy               (1 << 1)
4717ca54c3Smrg#define PresentOptionUST                (1 << 2)
4817ca54c3Smrg#define PresentOptionSuboptimal         (1 << 3)
4968872e7fSmrg#define PresentOptionAsyncMayTear       (1 << 4)
5017ca54c3Smrg
5117ca54c3Smrg#define PresentAllOptions       (PresentOptionAsync | \
5217ca54c3Smrg                                 PresentOptionCopy | \
5317ca54c3Smrg                                 PresentOptionUST | \
5468872e7fSmrg                                 PresentOptionSuboptimal | \
5568872e7fSmrg                                 PresentOptionAsyncMayTear)
5668872e7fSmrg
5768872e7fSmrg#define PresentAllAsyncOptions (PresentOptionAsync | PresentOptionAsyncMayTear)
5817ca54c3Smrg
5917ca54c3Smrg/* Present capabilities */
6017ca54c3Smrg
6117ca54c3Smrg#define PresentCapabilityNone           0
6217ca54c3Smrg#define PresentCapabilityAsync          1
6317ca54c3Smrg#define PresentCapabilityFence          2
6417ca54c3Smrg#define PresentCapabilityUST            4
6568872e7fSmrg#define PresentCapabilityAsyncMayTear   8
66635a5eb8Smrg#define PresentCapabilitySyncobj        16
6717ca54c3Smrg
6817ca54c3Smrg#define PresentAllCapabilities  (PresentCapabilityAsync | \
6917ca54c3Smrg                                 PresentCapabilityFence | \
7068872e7fSmrg                                 PresentCapabilityUST | \
71635a5eb8Smrg                                 PresentCapabilityAsyncMayTear | \
72635a5eb8Smrg                                 PresentCapabilitySyncobj)
7368872e7fSmrg
7468872e7fSmrg#define PresentAllAsyncCapabilities (PresentCapabilityAsync | PresentCapabilityAsyncMayTear)
7517ca54c3Smrg
7617ca54c3Smrg/* Events */
7717ca54c3Smrg#define PresentConfigureNotify	0
7817ca54c3Smrg#define PresentCompleteNotify	1
7917ca54c3Smrg#define PresentIdleNotify       2
8017ca54c3Smrg#if PRESENT_FUTURE_VERSION
8117ca54c3Smrg#define PresentRedirectNotify	3
8217ca54c3Smrg#endif
8317ca54c3Smrg
8417ca54c3Smrg/* Event Masks */
8517ca54c3Smrg#define PresentConfigureNotifyMask      1
8617ca54c3Smrg#define PresentCompleteNotifyMask       2
8717ca54c3Smrg#define PresentIdleNotifyMask           4
8817ca54c3Smrg#if PRESENT_FUTURE_VERSION
8917ca54c3Smrg#define PresentRedirectNotifyMask       8
9017ca54c3Smrg#endif
9117ca54c3Smrg
9217ca54c3Smrg#if PRESENT_FUTURE_VERSION
9317ca54c3Smrg#define PRESENT_REDIRECT_NOTIFY_MASK    PresentRedirectNotifyMask
9417ca54c3Smrg#else
9517ca54c3Smrg#define PRESENT_REDIRECT_NOTIFY_MASK    0
9617ca54c3Smrg#endif
9717ca54c3Smrg
9817ca54c3Smrg#define PresentAllEvents   (PresentConfigureNotifyMask |        \
9917ca54c3Smrg                            PresentCompleteNotifyMask |         \
10017ca54c3Smrg                            PresentIdleNotifyMask |             \
10117ca54c3Smrg                            PRESENT_REDIRECT_NOTIFY_MASK)
10217ca54c3Smrg
10317ca54c3Smrg/* Complete Kinds */
10417ca54c3Smrg
10517ca54c3Smrg#define PresentCompleteKindPixmap       0
10617ca54c3Smrg#define PresentCompleteKindNotifyMSC    1
10717ca54c3Smrg
10817ca54c3Smrg/* Complete Modes */
10917ca54c3Smrg
11017ca54c3Smrg#define PresentCompleteModeCopy           0
11117ca54c3Smrg#define PresentCompleteModeFlip           1
11217ca54c3Smrg#define PresentCompleteModeSkip           2
11317ca54c3Smrg#define PresentCompleteModeSuboptimalCopy 3
11417ca54c3Smrg
11517ca54c3Smrg#endif
116