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