1848b8605Smrg/**************************************************************************
2848b8605Smrg
3848b8605SmrgCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4848b8605SmrgCopyright 2000 VA Linux Systems, Inc.
5848b8605SmrgAll Rights Reserved.
6848b8605Smrg
7848b8605SmrgPermission is hereby granted, free of charge, to any person obtaining a
8848b8605Smrgcopy of this software and associated documentation files (the
9848b8605Smrg"Software"), to deal in the Software without restriction, including
10848b8605Smrgwithout limitation the rights to use, copy, modify, merge, publish,
11848b8605Smrgdistribute, sub license, and/or sell copies of the Software, and to
12848b8605Smrgpermit persons to whom the Software is furnished to do so, subject to
13848b8605Smrgthe following conditions:
14848b8605Smrg
15848b8605SmrgThe above copyright notice and this permission notice (including the
16848b8605Smrgnext paragraph) shall be included in all copies or substantial portions
17848b8605Smrgof the Software.
18848b8605Smrg
19848b8605SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20848b8605SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21848b8605SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22848b8605SmrgIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23848b8605SmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24848b8605SmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25848b8605SmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26848b8605Smrg
27848b8605Smrg**************************************************************************/
28848b8605Smrg
29848b8605Smrg/**
30848b8605Smrg * \file xf86dri.h
31848b8605Smrg * Protocol numbers and function prototypes for DRI X protocol.
32848b8605Smrg *
33848b8605Smrg * \author Kevin E. Martin <martin@valinux.com>
34848b8605Smrg * \author Jens Owen <jowen@vmware.com>
35848b8605Smrg * \author Rickard E. (Rik) Faith <faith@valinux.com>
36848b8605Smrg */
37848b8605Smrg
38848b8605Smrg#ifndef _XF86DRI_H_
39848b8605Smrg#define _XF86DRI_H_
40848b8605Smrg
41848b8605Smrg#include <X11/Xfuncproto.h>
42848b8605Smrg#include <xf86drm.h>
43848b8605Smrg
44848b8605Smrg#define X_XF86DRIQueryVersion                   0
45848b8605Smrg#define X_XF86DRIQueryDirectRenderingCapable    1
46848b8605Smrg#define X_XF86DRIOpenConnection                 2
47848b8605Smrg#define X_XF86DRICloseConnection                3
48848b8605Smrg#define X_XF86DRIGetClientDriverName            4
49848b8605Smrg#define X_XF86DRICreateContext                  5
50848b8605Smrg#define X_XF86DRIDestroyContext                 6
51848b8605Smrg#define X_XF86DRICreateDrawable                 7
52848b8605Smrg#define X_XF86DRIDestroyDrawable                8
53848b8605Smrg#define X_XF86DRIGetDrawableInfo                9
54848b8605Smrg#define X_XF86DRIGetDeviceInfo                  10
55848b8605Smrg#define X_XF86DRIAuthConnection                 11
56848b8605Smrg#define X_XF86DRIOpenFullScreen                 12      /* Deprecated */
57848b8605Smrg#define X_XF86DRICloseFullScreen                13      /* Deprecated */
58848b8605Smrg
59848b8605Smrg#define XF86DRINumberEvents            0
60848b8605Smrg
61848b8605Smrg#define XF86DRIClientNotLocal          0
62848b8605Smrg#define XF86DRIOperationNotSupported   1
63848b8605Smrg#define XF86DRINumberErrors            (XF86DRIOperationNotSupported + 1)
64848b8605Smrg
65848b8605Smrg#ifndef _XF86DRI_SERVER_
66848b8605Smrg
67848b8605Smrg_XFUNCPROTOBEGIN
68848b8605Smrg   Bool XF86DRIQueryExtension(Display * dpy, int *event_base,
69848b8605Smrg                              int *error_base);
70848b8605Smrg
71848b8605SmrgBool XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion,
72848b8605Smrg                         int *patchVersion);
73848b8605Smrg
74848b8605SmrgBool XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen,
75848b8605Smrg                                        Bool * isCapable);
76848b8605Smrg
77848b8605SmrgBool XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
78848b8605Smrg                           char **busIDString);
79848b8605Smrg
80848b8605SmrgBool XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic);
81848b8605Smrg
82848b8605SmrgBool XF86DRICloseConnection(Display * dpy, int screen);
83848b8605Smrg
84848b8605SmrgBool XF86DRIGetClientDriverName(Display * dpy, int screen,
85848b8605Smrg                                int *ddxDriverMajorVersion,
86848b8605Smrg                                int *ddxDriverMinorVersion,
87848b8605Smrg                                int *ddxDriverPatchVersion,
88848b8605Smrg                                char **clientDriverName);
89848b8605Smrg
90848b8605SmrgBool XF86DRICreateContext(Display * dpy, int screen, Visual * visual,
91848b8605Smrg                          XID * ptr_to_returned_context_id,
92848b8605Smrg                          drm_context_t * hHWContext);
93848b8605Smrg
94848b8605SmrgBool XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID,
95848b8605Smrg                                    XID * ptr_to_returned_context_id,
96848b8605Smrg                                    drm_context_t * hHWContext);
97848b8605Smrg
98848b8605Smrgextern Bool XF86DRIDestroyContext(Display * dpy, int screen, XID context_id);
99848b8605Smrg
100848b8605Smrgextern Bool XF86DRICreateDrawable(Display * dpy, int screen,
101848b8605Smrg                                  XID drawable, drm_drawable_t * hHWDrawable);
102848b8605Smrg
103848b8605Smrgextern Bool XF86DRIDestroyDrawable(Display * dpy, int screen, XID drawable);
104848b8605Smrg
105848b8605SmrgBool XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
106848b8605Smrg                            unsigned int *index, unsigned int *stamp,
107848b8605Smrg                            int *X, int *Y, int *W, int *H,
108848b8605Smrg                            int *numClipRects, drm_clip_rect_t ** pClipRects,
109848b8605Smrg                            int *backX, int *backY,
110848b8605Smrg                            int *numBackClipRects,
111848b8605Smrg                            drm_clip_rect_t ** pBackClipRects);
112848b8605Smrg
113848b8605SmrgBool XF86DRIGetDeviceInfo(Display * dpy, int screen,
114848b8605Smrg                          drm_handle_t * hFrameBuffer, int *fbOrigin,
115848b8605Smrg                          int *fbSize, int *fbStride, int *devPrivateSize,
116848b8605Smrg                          void **pDevPrivate);
117848b8605Smrg
118848b8605SmrgBool XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable);
119848b8605Smrg
120848b8605SmrgBool XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable);
121848b8605Smrg
122848b8605Smrg_XFUNCPROTOEND
123848b8605Smrg#endif /* _XF86DRI_SERVER_ */
124848b8605Smrg#endif /* _XF86DRI_H_ */
125