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