xref: /OK3568_Linux_fs/external/xserver/hw/xquartz/xpr/dri.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /**************************************************************************
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun    Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4*4882a593Smuzhiyun    Copyright (c) 2002-2012 Apple Computer, Inc.
5*4882a593Smuzhiyun    All Rights Reserved.
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun    Permission is hereby granted, free of charge, to any person obtaining a
8*4882a593Smuzhiyun    copy of this software and associated documentation files (the
9*4882a593Smuzhiyun    "Software"), to deal in the Software without restriction, including
10*4882a593Smuzhiyun    without limitation the rights to use, copy, modify, merge, publish,
11*4882a593Smuzhiyun    distribute, sub license, and/or sell copies of the Software, and to
12*4882a593Smuzhiyun    permit persons to whom the Software is furnished to do so, subject to
13*4882a593Smuzhiyun    the following conditions:
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun    The above copyright notice and this permission notice (including the
16*4882a593Smuzhiyun    next paragraph) shall be included in all copies or substantial portions
17*4882a593Smuzhiyun    of the Software.
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20*4882a593Smuzhiyun    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21*4882a593Smuzhiyun    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22*4882a593Smuzhiyun    IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23*4882a593Smuzhiyun    ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24*4882a593Smuzhiyun    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25*4882a593Smuzhiyun    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun **************************************************************************/
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /*
30*4882a593Smuzhiyun  * Authors:
31*4882a593Smuzhiyun  *   Jens Owen <jens@precisioninsight.com>
32*4882a593Smuzhiyun  *   Jeremy Huddleston <jeremyhu@apple.com>
33*4882a593Smuzhiyun  */
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun /* Prototypes for AppleDRI functions */
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun #ifndef _DRI_H_
38*4882a593Smuzhiyun #define _DRI_H_
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun #include <X11/Xdefs.h>
41*4882a593Smuzhiyun #include "scrnintstr.h"
42*4882a593Smuzhiyun #define _APPLEDRI_SERVER_
43*4882a593Smuzhiyun #include "appledri.h"
44*4882a593Smuzhiyun #include <Xplugin.h>
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun typedef void (*ClipNotifyPtr)(WindowPtr, int, int);
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun /*
49*4882a593Smuzhiyun  * These functions can be wrapped by the DRI.  Each of these have
50*4882a593Smuzhiyun  * generic default funcs (initialized in DRICreateInfoRec) and can be
51*4882a593Smuzhiyun  * overridden by the driver in its [driver]DRIScreenInit function.
52*4882a593Smuzhiyun  */
53*4882a593Smuzhiyun typedef struct {
54*4882a593Smuzhiyun     CopyWindowProcPtr CopyWindow;
55*4882a593Smuzhiyun     ClipNotifyProcPtr ClipNotify;
56*4882a593Smuzhiyun } DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun typedef struct {
59*4882a593Smuzhiyun     xp_surface_id id;
60*4882a593Smuzhiyun     int kind;
61*4882a593Smuzhiyun } DRISurfaceNotifyArg;
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun extern Bool
64*4882a593Smuzhiyun DRIScreenInit(ScreenPtr pScreen);
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun extern Bool
67*4882a593Smuzhiyun DRIFinishScreenInit(ScreenPtr pScreen);
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun extern void
70*4882a593Smuzhiyun DRICloseScreen(ScreenPtr pScreen);
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun extern Bool
73*4882a593Smuzhiyun DRIExtensionInit(void);
74*4882a593Smuzhiyun 
75*4882a593Smuzhiyun extern void
76*4882a593Smuzhiyun DRIReset(void);
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun extern Bool
79*4882a593Smuzhiyun DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool *isCapable);
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun extern Bool
82*4882a593Smuzhiyun DRIAuthConnection(ScreenPtr pScreen, unsigned int magic);
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun extern Bool DRICreateSurface(ScreenPtr pScreen,
85*4882a593Smuzhiyun                              Drawable id,
86*4882a593Smuzhiyun                              DrawablePtr pDrawable,
87*4882a593Smuzhiyun                              xp_client_id client_id,
88*4882a593Smuzhiyun                              xp_surface_id * surface_id,
89*4882a593Smuzhiyun                              unsigned int key[2],
90*4882a593Smuzhiyun                              void (*notify)(void *arg, void *data),
91*4882a593Smuzhiyun                              void *notify_data);
92*4882a593Smuzhiyun 
93*4882a593Smuzhiyun extern Bool
94*4882a593Smuzhiyun DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
95*4882a593Smuzhiyun                   void (*notify)(void *arg,
96*4882a593Smuzhiyun                                  void *data), void *notify_data);
97*4882a593Smuzhiyun 
98*4882a593Smuzhiyun extern Bool
99*4882a593Smuzhiyun DRIDrawablePrivDelete(void *pResource, XID id);
100*4882a593Smuzhiyun 
101*4882a593Smuzhiyun extern DRIWrappedFuncsRec *
102*4882a593Smuzhiyun DRIGetWrappedFuncs(ScreenPtr pScreen);
103*4882a593Smuzhiyun 
104*4882a593Smuzhiyun extern void
105*4882a593Smuzhiyun DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
106*4882a593Smuzhiyun 
107*4882a593Smuzhiyun extern void
108*4882a593Smuzhiyun DRIClipNotify(WindowPtr pWin, int dx, int dy);
109*4882a593Smuzhiyun 
110*4882a593Smuzhiyun extern void
111*4882a593Smuzhiyun DRISurfaceNotify(xp_surface_id id, int kind);
112*4882a593Smuzhiyun 
113*4882a593Smuzhiyun extern void
114*4882a593Smuzhiyun DRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion);
115*4882a593Smuzhiyun 
116*4882a593Smuzhiyun extern Bool
117*4882a593Smuzhiyun DRICreatePixmap(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
118*4882a593Smuzhiyun                 char *path,
119*4882a593Smuzhiyun                 size_t pathmax);
120*4882a593Smuzhiyun 
121*4882a593Smuzhiyun extern Bool
122*4882a593Smuzhiyun DRIGetPixmapData(DrawablePtr pDrawable, int *width, int *height, int *pitch,
123*4882a593Smuzhiyun                  int *bpp,
124*4882a593Smuzhiyun                  void **ptr);
125*4882a593Smuzhiyun 
126*4882a593Smuzhiyun extern void
127*4882a593Smuzhiyun DRIDestroyPixmap(DrawablePtr pDrawable);
128*4882a593Smuzhiyun 
129*4882a593Smuzhiyun #endif
130