Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / glx / x11 / dri2.h
1 /*
2 * Copyright © 2007,2008 Red Hat, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Soft-
6 * ware"), to deal in the Software without restriction, including without
7 * limitation the rights to use, copy, modify, merge, publish, distribute,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, provided that the above copyright
10 * notice(s) and this permission notice appear in all copies of the Soft-
11 * ware and that both the above copyright notice(s) and this permission
12 * notice appear in supporting documentation.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
17 * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
18 * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
19 * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
22 * MANCE OF THIS SOFTWARE.
23 *
24 * Except as contained in this notice, the name of a copyright holder shall
25 * not be used in advertising or otherwise to promote the sale, use or
26 * other dealings in this Software without prior written authorization of
27 * the copyright holder.
28 *
29 * Authors:
30 * Kristian Høgsberg (krh@redhat.com)
31 */
32
33 #ifndef _DRI2_H_
34 #define _DRI2_H_
35
36 typedef struct {
37 unsigned int attachment;
38 unsigned int name;
39 unsigned int pitch;
40 unsigned int cpp;
41 unsigned int flags;
42 } DRI2Buffer;
43
44 extern Bool
45 DRI2QueryExtension(Display *display, int *eventBase, int *errorBase);
46 extern Bool
47 DRI2QueryVersion(Display *display, int *major, int *minor);
48 extern Bool
49 DRI2Connect(Display *display, int screen,
50 char **driverName, char **busId, unsigned int *sareaHandle);
51 extern Bool
52 DRI2AuthConnection(Display *display, int screen, drm_magic_t magic);
53 extern void
54 DRI2CreateDrawable(Display *display, XID drawable);
55 extern void
56 DRI2DestroyDrawable(Display *display, XID handle);
57 extern DRI2Buffer *
58 DRI2GetBuffers(Display *dpy, XID drawable,
59 int *width, int *height,
60 unsigned int *attachments, int count,
61 int *outCount);
62 extern void
63 DRI2SwapBuffers(Display *dpy, XID drawable,
64 int x, int y, int width, int height);
65
66 #endif