190b17f1bSmrg/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */
290b17f1bSmrg/**************************************************************************
390b17f1bSmrg
490b17f1bSmrgCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
590b17f1bSmrgCopyright 2000 VA Linux Systems, Inc.
690b17f1bSmrgAll Rights Reserved.
790b17f1bSmrg
890b17f1bSmrgPermission is hereby granted, free of charge, to any person obtaining a
990b17f1bSmrgcopy of this software and associated documentation files (the
1090b17f1bSmrg"Software"), to deal in the Software without restriction, including
1190b17f1bSmrgwithout limitation the rights to use, copy, modify, merge, publish,
1290b17f1bSmrgdistribute, sub license, and/or sell copies of the Software, and to
1390b17f1bSmrgpermit persons to whom the Software is furnished to do so, subject to
1490b17f1bSmrgthe following conditions:
1590b17f1bSmrg
1690b17f1bSmrgThe above copyright notice and this permission notice (including the
1790b17f1bSmrgnext paragraph) shall be included in all copies or substantial portions
1890b17f1bSmrgof the Software.
1990b17f1bSmrg
2090b17f1bSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2190b17f1bSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2290b17f1bSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2390b17f1bSmrgIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
2490b17f1bSmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2590b17f1bSmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2690b17f1bSmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2790b17f1bSmrg
2890b17f1bSmrg**************************************************************************/
2990b17f1bSmrg
3090b17f1bSmrg/**
3190b17f1bSmrg * \file xf86dri.h
3290b17f1bSmrg * Protocol numbers and function prototypes for DRI X protocol.
3390b17f1bSmrg *
3490b17f1bSmrg * \author Kevin E. Martin <martin@valinux.com>
3590b17f1bSmrg * \author Jens Owen <jens@tungstengraphics.com>
3690b17f1bSmrg * \author Rickard E. (Rik) Faith <faith@valinux.com>
3790b17f1bSmrg */
3890b17f1bSmrg
3990b17f1bSmrg#ifndef _XF86DRI_H_
4090b17f1bSmrg#define _XF86DRI_H_
4190b17f1bSmrg
4290b17f1bSmrg#include <X11/Xfuncproto.h>
4390b17f1bSmrg#include <xf86drm.h>
4490b17f1bSmrg
4590b17f1bSmrg#define X_XF86DRIQueryVersion			0
4690b17f1bSmrg#define X_XF86DRIQueryDirectRenderingCapable	1
4790b17f1bSmrg#define X_XF86DRIOpenConnection			2
4890b17f1bSmrg#define X_XF86DRICloseConnection		3
4990b17f1bSmrg#define X_XF86DRIGetClientDriverName		4
5090b17f1bSmrg#define X_XF86DRICreateContext			5
5190b17f1bSmrg#define X_XF86DRIDestroyContext			6
5290b17f1bSmrg#define X_XF86DRICreateDrawable			7
5390b17f1bSmrg#define X_XF86DRIDestroyDrawable		8
5490b17f1bSmrg#define X_XF86DRIGetDrawableInfo		9
5590b17f1bSmrg#define X_XF86DRIGetDeviceInfo			10
5690b17f1bSmrg#define X_XF86DRIAuthConnection                 11
5790b17f1bSmrg#define X_XF86DRIOpenFullScreen                 12	/* Deprecated */
5890b17f1bSmrg#define X_XF86DRICloseFullScreen                13	/* Deprecated */
5990b17f1bSmrg
6090b17f1bSmrg#define XF86DRINumberEvents		0
6190b17f1bSmrg
6290b17f1bSmrg#define XF86DRIClientNotLocal		0
6390b17f1bSmrg#define XF86DRIOperationNotSupported	1
6490b17f1bSmrg#define XF86DRINumberErrors		(XF86DRIOperationNotSupported + 1)
6590b17f1bSmrg
6690b17f1bSmrg#ifndef _XF86DRI_SERVER_
6790b17f1bSmrg
6890b17f1bSmrg_XFUNCPROTOBEGIN
6990b17f1bSmrg    Bool uniDRIQueryExtension(Display * dpy, int *event_base,
7090b17f1bSmrg    int *error_base);
7190b17f1bSmrg
7290b17f1bSmrgBool uniDRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion,
7390b17f1bSmrg    int *patchVersion);
7490b17f1bSmrg
7590b17f1bSmrgBool uniDRIQueryDirectRenderingCapable(Display * dpy, int screen,
7690b17f1bSmrg    Bool * isCapable);
7790b17f1bSmrg
7890b17f1bSmrgBool uniDRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
7990b17f1bSmrg    char **busIDString);
8090b17f1bSmrg
8190b17f1bSmrgBool uniDRIAuthConnection(Display * dpy, int screen, drm_magic_t magic);
8290b17f1bSmrg
8390b17f1bSmrgBool uniDRICloseConnection(Display * dpy, int screen);
8490b17f1bSmrg
8590b17f1bSmrgBool uniDRIGetClientDriverName(Display * dpy, int screen,
8690b17f1bSmrg    int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
8790b17f1bSmrg    int *ddxDriverPatchVersion, char **clientDriverName);
8890b17f1bSmrg
8990b17f1bSmrgBool uniDRICreateContext(Display * dpy, int screen, Visual * visual,
9090b17f1bSmrg    XID * ptr_to_returned_context_id, drm_context_t * hHWContext);
9190b17f1bSmrg
9290b17f1bSmrgBool uniDRICreateContextWithConfig(Display * dpy, int screen, int configID,
9390b17f1bSmrg    XID * ptr_to_returned_context_id, drm_context_t * hHWContext);
9490b17f1bSmrg
9590b17f1bSmrgextern Bool uniDRIDestroyContext(Display * dpy, int screen, XID context_id);
9690b17f1bSmrg
9790b17f1bSmrgextern Bool uniDRICreateDrawable(Display * dpy, int screen,
9890b17f1bSmrg    Drawable drawable, drm_drawable_t * hHWDrawable);
9990b17f1bSmrg
10090b17f1bSmrgextern Bool uniDRIDestroyDrawable(Display * dpy, int screen,
10190b17f1bSmrg    Drawable drawable);
10290b17f1bSmrg
10390b17f1bSmrgBool uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
10490b17f1bSmrg    unsigned int *index, unsigned int *stamp,
10590b17f1bSmrg    int *X, int *Y, int *W, int *H,
10690b17f1bSmrg    int *numClipRects, drm_clip_rect_t ** pClipRects,
10790b17f1bSmrg    int *backX, int *backY,
10890b17f1bSmrg    int *numBackClipRects, drm_clip_rect_t ** pBackClipRects);
10990b17f1bSmrg
11090b17f1bSmrgBool uniDRIGetDeviceInfo(Display * dpy, int screen,
11190b17f1bSmrg    drm_handle_t * hFrameBuffer, int *fbOrigin, int *fbSize,
11290b17f1bSmrg    int *fbStride, int *devPrivateSize, void **pDevPrivate);
11390b17f1bSmrg
11490b17f1bSmrg_XFUNCPROTOEND
11590b17f1bSmrg#endif /* _XF86DRI_SERVER_ */
11690b17f1bSmrg#endif /* _XF86DRI_H_ */
117