73
73
static int DRIErrorBase;
75
static DISPATCH_PROC(ProcXF86DRIQueryVersion);
76
static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
77
static DISPATCH_PROC(ProcXF86DRIOpenConnection);
78
static DISPATCH_PROC(ProcXF86DRICloseConnection);
79
static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
80
static DISPATCH_PROC(ProcXF86DRICreateContext);
81
static DISPATCH_PROC(ProcXF86DRIDestroyContext);
82
static DISPATCH_PROC(ProcXF86DRICreateDrawable);
83
static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
84
static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
85
static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
86
static DISPATCH_PROC(ProcXF86DRIDispatch);
87
static DISPATCH_PROC(ProcXF86DRIAuthConnection);
89
static DISPATCH_PROC(SProcXF86DRIQueryVersion);
90
static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
91
static DISPATCH_PROC(SProcXF86DRIDispatch);
93
77
static Bool ephyrDRIScreenInit (ScreenPtr a_screen) ;
94
78
static Bool ephyrDRICreateWindow (WindowPtr a_win) ;
119
103
#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \
120
104
dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey))
124
ephyrDRIExtensionInit (ScreenPtr a_screen)
127
ExtensionEntry* extEntry=NULL;
128
EphyrDRIScreenPrivPtr screen_priv=NULL ;
130
EPHYR_LOG ("enter\n") ;
131
if (!hostx_has_dri ()) {
132
EPHYR_LOG ("host does not have DRI extension\n") ;
135
EPHYR_LOG ("host X does have DRI extension\n") ;
136
if (!hostx_has_xshape ()) {
137
EPHYR_LOG ("host does not have XShape extension\n") ;
140
EPHYR_LOG ("host X does have XShape extension\n") ;
142
#ifdef XF86DRI_EVENTS
143
EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
145
EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
150
if ((extEntry = AddExtension(XF86DRINAME,
154
SProcXF86DRIDispatch,
156
StandardMinorOpcode))) {
157
DRIReqCode = (unsigned char)extEntry->base;
158
DRIErrorBase = extEntry->errorBase;
160
EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
163
screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
165
EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
168
dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
170
if (!ephyrDRIScreenInit (a_screen)) {
171
EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
174
EphyrMirrorHostVisuals (a_screen) ;
177
EPHYR_LOG ("leave\n") ;
182
107
ephyrDRIScreenInit (ScreenPtr a_screen)
1358
ephyrDRIExtensionInit (ScreenPtr a_screen)
1361
ExtensionEntry* extEntry=NULL;
1362
EphyrDRIScreenPrivPtr screen_priv=NULL ;
1364
EPHYR_LOG ("enter\n") ;
1365
if (!hostx_has_dri ()) {
1366
EPHYR_LOG ("host does not have DRI extension\n") ;
1369
EPHYR_LOG ("host X does have DRI extension\n") ;
1370
if (!hostx_has_xshape ()) {
1371
EPHYR_LOG ("host does not have XShape extension\n") ;
1374
EPHYR_LOG ("host X does have XShape extension\n") ;
1376
#ifdef XF86DRI_EVENTS
1377
EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
1379
EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
1384
if ((extEntry = AddExtension(XF86DRINAME,
1385
XF86DRINumberEvents,
1386
XF86DRINumberErrors,
1387
ProcXF86DRIDispatch,
1388
SProcXF86DRIDispatch,
1390
StandardMinorOpcode))) {
1391
DRIReqCode = (unsigned char)extEntry->base;
1392
DRIErrorBase = extEntry->errorBase;
1394
EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
1397
screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
1399
EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
1402
dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
1404
if (!ephyrDRIScreenInit (a_screen)) {
1405
EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
1408
EphyrMirrorHostVisuals (a_screen) ;
1411
EPHYR_LOG ("leave\n") ;