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