2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 * Copyright © 2007,2008 Red Hat, Inc.
5 * Contact: Sangjin Lee <lsj119@samsung.com>, SooChan Lim <sc1.lim@samsung.com>
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Soft-
9 * ware"), to deal in the Software without restriction, including without
10 * limitation the rights to use, copy, modify, merge, publish, distribute,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, provided that the above copyright
13 * notice(s) and this permission notice appear in all copies of the Soft-
14 * ware and that both the above copyright notice(s) and this permission
15 * notice appear in supporting documentation.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
19 * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
20 * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
21 * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
22 * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
23 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
24 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
25 * MANCE OF THIS SOFTWARE.
27 * Except as contained in this notice, the name of a copyright holder shall
28 * not be used in advertising or otherwise to promote the sale, use or
29 * other dealings in this Software without prior written authorization of
30 * the copyright holder.
33 * Kristian Høgsberg (krh@redhat.com)
39 #include <X11/extensions/Xfixes.h>
40 #include <X11/extensions/dri2tokens.h>
43 #define DRI2BufferSwapCompleteNotify 0
44 #define DRI2InvalidateBuffersNotify 1
48 unsigned int attachment;
56 DRI2QueryExtension(Display * display, int *eventBase, int *errorBase);
59 DRI2QueryVersion(Display * display, int *major, int *minor);
62 DRI2Connect(Display * display, XID window,
63 char **driverName, char **deviceName);
66 DRI2Authenticate(Display * display, XID window, unsigned int magic);
69 DRI2CreateDrawable(Display * display, XID drawable);
72 DRI2DestroyDrawable(Display * display, XID handle);
75 DRI2GetBuffers(Display * dpy, XID drawable,
76 int *width, int *height,
77 unsigned int *attachments, int count,
82 * This function is only supported with DRI2 version 1.1 or later.
85 DRI2GetBuffersWithFormat(Display * dpy, XID drawable,
86 int *width, int *height,
87 unsigned int *attachments,
88 int count, int *outCount);
91 DRI2CopyRegion(Display * dpy, XID drawable,
93 CARD32 dest, CARD32 src);
96 DRI2SwapBuffers(Display *dpy, XID drawable, CARD64 target_msc, CARD64 divisor,
97 CARD64 remainder, CARD64 *count);
100 DRI2GetMSC(Display *dpy, XID drawable, CARD64 *ust, CARD64 *msc, CARD64 *sbc);
103 DRI2WaitMSC(Display *dpy, XID drawable, CARD64 target_msc, CARD64 divisor,
104 CARD64 remainder, CARD64 *ust, CARD64 *msc, CARD64 *sbc);
107 DRI2WaitSBC(Display *dpy, XID drawable, CARD64 target_sbc, CARD64 *ust,
108 CARD64 *msc, CARD64 *sbc);
111 DRI2SwapInterval(Display *dpy, XID drawable, int interval);
115 unsigned long serial; /* # of last request processed by server */
116 Bool send_event; /* true if this came from a SendEvent request */
117 Display *display; /* Display the event was read from */
118 Drawable drawable; /* drawable on which event was requested in event mask */
123 } DRI2BufferSwapComplete;
127 unsigned long serial; /* # of last request processed by server */
128 Bool send_event; /* true if this came from a SendEvent request */
129 Display *display; /* Display the event was read from */
130 Drawable drawable; /* drawable on which event was requested in event mask */
132 } DRI2BufferInvalidate;
135 DRI2SwapBuffersWithRegion(Display *dpy, XID drawable, XserverRegion region,