1d722e3fbSopenharmony_ci/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */
2d722e3fbSopenharmony_ci/**************************************************************************
3d722e3fbSopenharmony_ci
4d722e3fbSopenharmony_ciCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5d722e3fbSopenharmony_ciCopyright 2000 VA Linux Systems, Inc.
6d722e3fbSopenharmony_ciAll Rights Reserved.
7d722e3fbSopenharmony_ci
8d722e3fbSopenharmony_ciPermission is hereby granted, free of charge, to any person obtaining a
9d722e3fbSopenharmony_cicopy of this software and associated documentation files (the
10d722e3fbSopenharmony_ci"Software"), to deal in the Software without restriction, including
11d722e3fbSopenharmony_ciwithout limitation the rights to use, copy, modify, merge, publish,
12d722e3fbSopenharmony_cidistribute, sub license, and/or sell copies of the Software, and to
13d722e3fbSopenharmony_cipermit persons to whom the Software is furnished to do so, subject to
14d722e3fbSopenharmony_cithe following conditions:
15d722e3fbSopenharmony_ci
16d722e3fbSopenharmony_ciThe above copyright notice and this permission notice (including the
17d722e3fbSopenharmony_cinext paragraph) shall be included in all copies or substantial portions
18d722e3fbSopenharmony_ciof the Software.
19d722e3fbSopenharmony_ci
20d722e3fbSopenharmony_ciTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21d722e3fbSopenharmony_ciOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22d722e3fbSopenharmony_ciMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
23d722e3fbSopenharmony_ciIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
24d722e3fbSopenharmony_ciANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25d722e3fbSopenharmony_ciTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26d722e3fbSopenharmony_ciSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27d722e3fbSopenharmony_ci
28d722e3fbSopenharmony_ci**************************************************************************/
29d722e3fbSopenharmony_ci
30d722e3fbSopenharmony_ci/**
31d722e3fbSopenharmony_ci * \file xf86dri.h
32d722e3fbSopenharmony_ci * Protocol numbers and function prototypes for DRI X protocol.
33d722e3fbSopenharmony_ci *
34d722e3fbSopenharmony_ci * \author Kevin E. Martin <martin@valinux.com>
35d722e3fbSopenharmony_ci * \author Jens Owen <jens@tungstengraphics.com>
36d722e3fbSopenharmony_ci * \author Rickard E. (Rik) Faith <faith@valinux.com>
37d722e3fbSopenharmony_ci */
38d722e3fbSopenharmony_ci
39d722e3fbSopenharmony_ci#ifndef _XF86DRI_H_
40d722e3fbSopenharmony_ci#define _XF86DRI_H_
41d722e3fbSopenharmony_ci
42d722e3fbSopenharmony_ci#include <X11/Xfuncproto.h>
43d722e3fbSopenharmony_ci#include <drm/drm.h>
44d722e3fbSopenharmony_ci
45d722e3fbSopenharmony_ci#define X_XF86DRIQueryVersion			0
46d722e3fbSopenharmony_ci#define X_XF86DRIQueryDirectRenderingCapable	1
47d722e3fbSopenharmony_ci#define X_XF86DRIOpenConnection			2
48d722e3fbSopenharmony_ci#define X_XF86DRICloseConnection		3
49d722e3fbSopenharmony_ci#define X_XF86DRIGetClientDriverName		4
50d722e3fbSopenharmony_ci#define X_XF86DRICreateContext			5
51d722e3fbSopenharmony_ci#define X_XF86DRIDestroyContext			6
52d722e3fbSopenharmony_ci#define X_XF86DRICreateDrawable			7
53d722e3fbSopenharmony_ci#define X_XF86DRIDestroyDrawable		8
54d722e3fbSopenharmony_ci#define X_XF86DRIGetDrawableInfo		9
55d722e3fbSopenharmony_ci#define X_XF86DRIGetDeviceInfo			10
56d722e3fbSopenharmony_ci#define X_XF86DRIAuthConnection                 11
57d722e3fbSopenharmony_ci#define X_XF86DRIOpenFullScreen                 12	/* Deprecated */
58d722e3fbSopenharmony_ci#define X_XF86DRICloseFullScreen                13	/* Deprecated */
59d722e3fbSopenharmony_ci
60d722e3fbSopenharmony_ci#define XF86DRINumberEvents		0
61d722e3fbSopenharmony_ci
62d722e3fbSopenharmony_ci#define XF86DRIClientNotLocal		0
63d722e3fbSopenharmony_ci#define XF86DRIOperationNotSupported	1
64d722e3fbSopenharmony_ci#define XF86DRINumberErrors		(XF86DRIOperationNotSupported + 1)
65d722e3fbSopenharmony_ci
66d722e3fbSopenharmony_ci#ifndef _XF86DRI_SERVER_
67d722e3fbSopenharmony_ci
68d722e3fbSopenharmony_ci_XFUNCPROTOBEGIN
69d722e3fbSopenharmony_ci    Bool uniDRIQueryExtension(Display * dpy, int *event_base,
70d722e3fbSopenharmony_ci    int *error_base);
71d722e3fbSopenharmony_ci
72d722e3fbSopenharmony_ciBool uniDRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion,
73d722e3fbSopenharmony_ci    int *patchVersion);
74d722e3fbSopenharmony_ci
75d722e3fbSopenharmony_ciBool uniDRIQueryDirectRenderingCapable(Display * dpy, int screen,
76d722e3fbSopenharmony_ci    Bool * isCapable);
77d722e3fbSopenharmony_ci
78d722e3fbSopenharmony_ciBool uniDRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
79d722e3fbSopenharmony_ci    char **busIDString);
80d722e3fbSopenharmony_ci
81d722e3fbSopenharmony_ciBool uniDRIAuthConnection(Display * dpy, int screen, drm_magic_t magic);
82d722e3fbSopenharmony_ci
83d722e3fbSopenharmony_ciBool uniDRICloseConnection(Display * dpy, int screen);
84d722e3fbSopenharmony_ci
85d722e3fbSopenharmony_ciBool uniDRIGetClientDriverName(Display * dpy, int screen,
86d722e3fbSopenharmony_ci    int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
87d722e3fbSopenharmony_ci    int *ddxDriverPatchVersion, char **clientDriverName);
88d722e3fbSopenharmony_ci
89d722e3fbSopenharmony_ciBool uniDRICreateContext(Display * dpy, int screen, Visual * visual,
90d722e3fbSopenharmony_ci    XID * ptr_to_returned_context_id, drm_context_t * hHWContext);
91d722e3fbSopenharmony_ci
92d722e3fbSopenharmony_ciBool uniDRICreateContextWithConfig(Display * dpy, int screen, int configID,
93d722e3fbSopenharmony_ci    XID * ptr_to_returned_context_id, drm_context_t * hHWContext);
94d722e3fbSopenharmony_ci
95d722e3fbSopenharmony_ciextern Bool uniDRIDestroyContext(Display * dpy, int screen, XID context_id);
96d722e3fbSopenharmony_ci
97d722e3fbSopenharmony_ciextern Bool uniDRICreateDrawable(Display * dpy, int screen,
98d722e3fbSopenharmony_ci    Drawable drawable, drm_drawable_t * hHWDrawable);
99d722e3fbSopenharmony_ci
100d722e3fbSopenharmony_ciextern Bool uniDRIDestroyDrawable(Display * dpy, int screen,
101d722e3fbSopenharmony_ci    Drawable drawable);
102d722e3fbSopenharmony_ci
103d722e3fbSopenharmony_ciBool uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
104d722e3fbSopenharmony_ci    unsigned int *index, unsigned int *stamp,
105d722e3fbSopenharmony_ci    int *X, int *Y, int *W, int *H,
106d722e3fbSopenharmony_ci    int *numClipRects, drm_clip_rect_t ** pClipRects,
107d722e3fbSopenharmony_ci    int *backX, int *backY,
108d722e3fbSopenharmony_ci    int *numBackClipRects, drm_clip_rect_t ** pBackClipRects);
109d722e3fbSopenharmony_ci
110d722e3fbSopenharmony_ciBool uniDRIGetDeviceInfo(Display * dpy, int screen,
111d722e3fbSopenharmony_ci    drm_handle_t * hFrameBuffer, int *fbOrigin, int *fbSize,
112d722e3fbSopenharmony_ci    int *fbStride, int *devPrivateSize, void **pDevPrivate);
113d722e3fbSopenharmony_ci
114d722e3fbSopenharmony_ci_XFUNCPROTOEND
115d722e3fbSopenharmony_ci#endif /* _XF86DRI_SERVER_ */
116d722e3fbSopenharmony_ci#endif /* _XF86DRI_H_ */
117