xref: /aosp_15_r20/external/mesa3d/src/glx/dri2.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  * Copyright © 2007,2008 Red Hat, Inc.
3*61046927SAndroid Build Coastguard Worker  *
4*61046927SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
5*61046927SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Soft-
6*61046927SAndroid Build Coastguard Worker  * ware"), to deal in the Software without restriction, including without
7*61046927SAndroid Build Coastguard Worker  * limitation the rights to use, copy, modify, merge, publish, distribute,
8*61046927SAndroid Build Coastguard Worker  * and/or sell copies of the Software, and to permit persons to whom the
9*61046927SAndroid Build Coastguard Worker  * Software is furnished to do so, provided that the above copyright
10*61046927SAndroid Build Coastguard Worker  * notice(s) and this permission notice appear in all copies of the Soft-
11*61046927SAndroid Build Coastguard Worker  * ware and that both the above copyright notice(s) and this permission
12*61046927SAndroid Build Coastguard Worker  * notice appear in supporting documentation.
13*61046927SAndroid Build Coastguard Worker  *
14*61046927SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15*61046927SAndroid Build Coastguard Worker  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16*61046927SAndroid Build Coastguard Worker  * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
17*61046927SAndroid Build Coastguard Worker  * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
18*61046927SAndroid Build Coastguard Worker  * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
19*61046927SAndroid Build Coastguard Worker  * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20*61046927SAndroid Build Coastguard Worker  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21*61046927SAndroid Build Coastguard Worker  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
22*61046927SAndroid Build Coastguard Worker  * MANCE OF THIS SOFTWARE.
23*61046927SAndroid Build Coastguard Worker  *
24*61046927SAndroid Build Coastguard Worker  * Except as contained in this notice, the name of a copyright holder shall
25*61046927SAndroid Build Coastguard Worker  * not be used in advertising or otherwise to promote the sale, use or
26*61046927SAndroid Build Coastguard Worker  * other dealings in this Software without prior written authorization of
27*61046927SAndroid Build Coastguard Worker  * the copyright holder.
28*61046927SAndroid Build Coastguard Worker  *
29*61046927SAndroid Build Coastguard Worker  * Authors:
30*61046927SAndroid Build Coastguard Worker  *   Kristian Høgsberg ([email protected])
31*61046927SAndroid Build Coastguard Worker  */
32*61046927SAndroid Build Coastguard Worker 
33*61046927SAndroid Build Coastguard Worker #ifndef _DRI2_H_
34*61046927SAndroid Build Coastguard Worker #define _DRI2_H_
35*61046927SAndroid Build Coastguard Worker 
36*61046927SAndroid Build Coastguard Worker #include "util/libdrm.h"
37*61046927SAndroid Build Coastguard Worker #include <X11/extensions/Xfixes.h>
38*61046927SAndroid Build Coastguard Worker #include <X11/extensions/dri2tokens.h>
39*61046927SAndroid Build Coastguard Worker 
40*61046927SAndroid Build Coastguard Worker typedef struct
41*61046927SAndroid Build Coastguard Worker {
42*61046927SAndroid Build Coastguard Worker    unsigned int attachment;
43*61046927SAndroid Build Coastguard Worker    unsigned int name;
44*61046927SAndroid Build Coastguard Worker    unsigned int pitch;
45*61046927SAndroid Build Coastguard Worker    unsigned int cpp;
46*61046927SAndroid Build Coastguard Worker    unsigned int flags;
47*61046927SAndroid Build Coastguard Worker } DRI2Buffer;
48*61046927SAndroid Build Coastguard Worker 
49*61046927SAndroid Build Coastguard Worker struct glx_screen;
50*61046927SAndroid Build Coastguard Worker 
51*61046927SAndroid Build Coastguard Worker extern Bool
52*61046927SAndroid Build Coastguard Worker DRI2QueryExtension(Display * display, int *eventBase, int *errorBase);
53*61046927SAndroid Build Coastguard Worker 
54*61046927SAndroid Build Coastguard Worker extern Bool
55*61046927SAndroid Build Coastguard Worker DRI2QueryVersion(Display * display, int *major, int *minor);
56*61046927SAndroid Build Coastguard Worker 
57*61046927SAndroid Build Coastguard Worker extern Bool
58*61046927SAndroid Build Coastguard Worker DRI2Connect(Display * display, XID window,
59*61046927SAndroid Build Coastguard Worker             char **driverName, char **deviceName);
60*61046927SAndroid Build Coastguard Worker 
61*61046927SAndroid Build Coastguard Worker extern Bool
62*61046927SAndroid Build Coastguard Worker DRI2Authenticate(Display * display, XID window, drm_magic_t magic);
63*61046927SAndroid Build Coastguard Worker 
64*61046927SAndroid Build Coastguard Worker extern void
65*61046927SAndroid Build Coastguard Worker DRI2CreateDrawable(Display * display, XID drawable);
66*61046927SAndroid Build Coastguard Worker 
67*61046927SAndroid Build Coastguard Worker extern void
68*61046927SAndroid Build Coastguard Worker DRI2DestroyDrawable(Display * display, XID handle);
69*61046927SAndroid Build Coastguard Worker 
70*61046927SAndroid Build Coastguard Worker extern DRI2Buffer*
71*61046927SAndroid Build Coastguard Worker DRI2GetBuffers(Display * dpy, XID drawable,
72*61046927SAndroid Build Coastguard Worker                int *width, int *height,
73*61046927SAndroid Build Coastguard Worker                unsigned int *attachments, int count,
74*61046927SAndroid Build Coastguard Worker                int *outCount);
75*61046927SAndroid Build Coastguard Worker 
76*61046927SAndroid Build Coastguard Worker /**
77*61046927SAndroid Build Coastguard Worker  * \note
78*61046927SAndroid Build Coastguard Worker  * This function is only supported with DRI2 version 1.1 or later.
79*61046927SAndroid Build Coastguard Worker  */
80*61046927SAndroid Build Coastguard Worker extern DRI2Buffer*
81*61046927SAndroid Build Coastguard Worker DRI2GetBuffersWithFormat(Display * dpy, XID drawable,
82*61046927SAndroid Build Coastguard Worker                          int *width, int *height,
83*61046927SAndroid Build Coastguard Worker                          unsigned int *attachments,
84*61046927SAndroid Build Coastguard Worker                          int count, int *outCount);
85*61046927SAndroid Build Coastguard Worker 
86*61046927SAndroid Build Coastguard Worker extern void
87*61046927SAndroid Build Coastguard Worker DRI2CopyRegion(Display * dpy, XID drawable,
88*61046927SAndroid Build Coastguard Worker                XserverRegion region,
89*61046927SAndroid Build Coastguard Worker                CARD32 dest, CARD32 src);
90*61046927SAndroid Build Coastguard Worker 
91*61046927SAndroid Build Coastguard Worker #endif
92