Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 1 | /************************************************************************** |
| 2 | |
| 3 | Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. |
| 4 | Copyright 2000 VA Linux Systems, 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 | * Kevin E. Martin <martin@valinux.com> |
José Fonseca | 8771285 | 2014-01-17 16:27:50 +0000 | [diff] [blame] | 32 | * Jens Owen <jowen@vmware.com> |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 33 | * Rickard E. (Rik) Faith <faith@valinux.com> |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | /* THIS IS NOT AN X CONSORTIUM STANDARD */ |
| 38 | |
Jeremy Huddleston | 80b280d | 2010-04-02 01:35:19 -0700 | [diff] [blame] | 39 | #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) |
Adam Jackson | be85fde | 2006-08-10 20:19:57 +0000 | [diff] [blame] | 40 | |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 41 | #include <X11/Xlibint.h> |
Kristian Høgsberg | 38c51a7 | 2010-07-28 10:20:41 -0400 | [diff] [blame] | 42 | #include <X11/Xfuncproto.h> |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 43 | #include <X11/extensions/Xext.h> |
Brian Paul | 82dfd4b | 2005-08-11 14:18:53 +0000 | [diff] [blame] | 44 | #include <X11/extensions/extutil.h> |
Adam Jackson | 1074eae | 2005-01-08 03:54:38 +0000 | [diff] [blame] | 45 | #include "xf86dristr.h" |
Alan Coopersmith | 2e5a268 | 2013-04-26 16:31:58 -0700 | [diff] [blame] | 46 | #include <limits.h> |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 47 | |
| 48 | static XExtensionInfo _xf86dri_info_data; |
| 49 | static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; |
Adam Jackson | 5dd18e9 | 2004-11-03 18:55:20 +0000 | [diff] [blame] | 50 | static char xf86dri_extension_name[] = XF86DRINAME; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 51 | |
| 52 | #define XF86DRICheckExtension(dpy,i,val) \ |
| 53 | XextCheckExtension (dpy, i, xf86dri_extension_name, val) |
| 54 | |
| 55 | /***************************************************************************** |
| 56 | * * |
| 57 | * private utility routines * |
| 58 | * * |
| 59 | *****************************************************************************/ |
| 60 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 61 | static int close_display(Display * dpy, XExtCodes * extCodes); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 62 | static /* const */ XExtensionHooks xf86dri_extension_hooks = { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 63 | NULL, /* create_gc */ |
| 64 | NULL, /* copy_gc */ |
| 65 | NULL, /* flush_gc */ |
| 66 | NULL, /* free_gc */ |
| 67 | NULL, /* create_font */ |
| 68 | NULL, /* free_font */ |
| 69 | close_display, /* close_display */ |
| 70 | NULL, /* wire_to_event */ |
| 71 | NULL, /* event_to_wire */ |
| 72 | NULL, /* error */ |
| 73 | NULL, /* error_string */ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 74 | }; |
| 75 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 76 | static |
| 77 | XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info, |
| 78 | xf86dri_extension_name, |
| 79 | &xf86dri_extension_hooks, 0, NULL) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 80 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 81 | static |
| 82 | XEXT_GENERATE_CLOSE_DISPLAY(close_display, xf86dri_info) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 83 | |
| 84 | |
| 85 | /***************************************************************************** |
| 86 | * * |
| 87 | * public XFree86-DRI Extension routines * |
| 88 | * * |
| 89 | *****************************************************************************/ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 90 | #if 0 |
| 91 | #include <stdio.h> |
| 92 | #define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg); |
| 93 | #else |
| 94 | #define TRACE(msg) |
| 95 | #endif |
| 96 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 97 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 98 | XF86DRIQueryExtension(Display * dpy, int *event_basep, |
| 99 | int *error_basep) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 100 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 101 | XExtDisplayInfo *info = find_display(dpy); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 102 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 103 | TRACE("QueryExtension..."); |
| 104 | if (XextHasExtension(info)) { |
| 105 | *event_basep = info->codes->first_event; |
| 106 | *error_basep = info->codes->first_error; |
| 107 | TRACE("QueryExtension... return True"); |
| 108 | return True; |
| 109 | } |
| 110 | else { |
| 111 | TRACE("QueryExtension... return False"); |
| 112 | return False; |
| 113 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 116 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 117 | XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, |
| 118 | int *patchVersion) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 119 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 120 | XExtDisplayInfo *info = find_display(dpy); |
| 121 | xXF86DRIQueryVersionReply rep; |
| 122 | xXF86DRIQueryVersionReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 123 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 124 | TRACE("QueryVersion..."); |
| 125 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 126 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 127 | LockDisplay(dpy); |
| 128 | GetReq(XF86DRIQueryVersion, req); |
| 129 | req->reqType = info->codes->major_opcode; |
| 130 | req->driReqType = X_XF86DRIQueryVersion; |
| 131 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 132 | UnlockDisplay(dpy); |
| 133 | SyncHandle(); |
| 134 | TRACE("QueryVersion... return False"); |
| 135 | return False; |
| 136 | } |
| 137 | *majorVersion = rep.majorVersion; |
| 138 | *minorVersion = rep.minorVersion; |
| 139 | *patchVersion = rep.patchVersion; |
| 140 | UnlockDisplay(dpy); |
| 141 | SyncHandle(); |
| 142 | TRACE("QueryVersion... return True"); |
| 143 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 144 | } |
| 145 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 146 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 147 | XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen, |
| 148 | Bool * isCapable) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 149 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 150 | XExtDisplayInfo *info = find_display(dpy); |
| 151 | xXF86DRIQueryDirectRenderingCapableReply rep; |
| 152 | xXF86DRIQueryDirectRenderingCapableReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 153 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 154 | TRACE("QueryDirectRenderingCapable..."); |
| 155 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 156 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 157 | LockDisplay(dpy); |
| 158 | GetReq(XF86DRIQueryDirectRenderingCapable, req); |
| 159 | req->reqType = info->codes->major_opcode; |
| 160 | req->driReqType = X_XF86DRIQueryDirectRenderingCapable; |
| 161 | req->screen = screen; |
| 162 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 163 | UnlockDisplay(dpy); |
| 164 | SyncHandle(); |
| 165 | TRACE("QueryDirectRenderingCapable... return False"); |
| 166 | return False; |
| 167 | } |
| 168 | *isCapable = rep.isCapable; |
| 169 | UnlockDisplay(dpy); |
| 170 | SyncHandle(); |
| 171 | TRACE("QueryDirectRenderingCapable... return True"); |
| 172 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 173 | } |
| 174 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 175 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 176 | XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, |
| 177 | char **busIdString) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 178 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 179 | XExtDisplayInfo *info = find_display(dpy); |
| 180 | xXF86DRIOpenConnectionReply rep; |
| 181 | xXF86DRIOpenConnectionReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 182 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 183 | TRACE("OpenConnection..."); |
| 184 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 185 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 186 | LockDisplay(dpy); |
| 187 | GetReq(XF86DRIOpenConnection, req); |
| 188 | req->reqType = info->codes->major_opcode; |
| 189 | req->driReqType = X_XF86DRIOpenConnection; |
| 190 | req->screen = screen; |
| 191 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 192 | UnlockDisplay(dpy); |
| 193 | SyncHandle(); |
| 194 | TRACE("OpenConnection... return False"); |
| 195 | return False; |
| 196 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 197 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 198 | *hSAREA = rep.hSAREALow; |
| 199 | if (sizeof(drm_handle_t) == 8) { |
| 200 | int shift = 32; /* var to prevent warning on next line */ |
| 201 | *hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift; |
| 202 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 203 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 204 | if (rep.length) { |
Alan Coopersmith | 2e5a268 | 2013-04-26 16:31:58 -0700 | [diff] [blame] | 205 | if (rep.busIdStringLength < INT_MAX) |
| 206 | *busIdString = calloc(rep.busIdStringLength + 1, 1); |
| 207 | else |
| 208 | *busIdString = NULL; |
| 209 | if (*busIdString == NULL) { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 210 | _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3)); |
| 211 | UnlockDisplay(dpy); |
| 212 | SyncHandle(); |
| 213 | TRACE("OpenConnection... return False"); |
| 214 | return False; |
| 215 | } |
| 216 | _XReadPad(dpy, *busIdString, rep.busIdStringLength); |
| 217 | } |
| 218 | else { |
| 219 | *busIdString = NULL; |
| 220 | } |
| 221 | UnlockDisplay(dpy); |
| 222 | SyncHandle(); |
| 223 | TRACE("OpenConnection... return True"); |
| 224 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 225 | } |
| 226 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 227 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 228 | XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 229 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 230 | XExtDisplayInfo *info = find_display(dpy); |
| 231 | xXF86DRIAuthConnectionReq *req; |
| 232 | xXF86DRIAuthConnectionReply rep; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 233 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 234 | TRACE("AuthConnection..."); |
| 235 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 236 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 237 | LockDisplay(dpy); |
| 238 | GetReq(XF86DRIAuthConnection, req); |
| 239 | req->reqType = info->codes->major_opcode; |
| 240 | req->driReqType = X_XF86DRIAuthConnection; |
| 241 | req->screen = screen; |
| 242 | req->magic = magic; |
| 243 | rep.authenticated = 0; |
| 244 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) { |
| 245 | UnlockDisplay(dpy); |
| 246 | SyncHandle(); |
| 247 | TRACE("AuthConnection... return False"); |
| 248 | return False; |
| 249 | } |
| 250 | UnlockDisplay(dpy); |
| 251 | SyncHandle(); |
| 252 | TRACE("AuthConnection... return True"); |
| 253 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 254 | } |
| 255 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 256 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 257 | XF86DRICloseConnection(Display * dpy, int screen) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 258 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 259 | XExtDisplayInfo *info = find_display(dpy); |
| 260 | xXF86DRICloseConnectionReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 261 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 262 | TRACE("CloseConnection..."); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 263 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 264 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 265 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 266 | LockDisplay(dpy); |
| 267 | GetReq(XF86DRICloseConnection, req); |
| 268 | req->reqType = info->codes->major_opcode; |
| 269 | req->driReqType = X_XF86DRICloseConnection; |
| 270 | req->screen = screen; |
| 271 | UnlockDisplay(dpy); |
| 272 | SyncHandle(); |
| 273 | TRACE("CloseConnection... return True"); |
| 274 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 275 | } |
| 276 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 277 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 278 | XF86DRIGetClientDriverName(Display * dpy, int screen, |
| 279 | int *ddxDriverMajorVersion, |
| 280 | int *ddxDriverMinorVersion, |
| 281 | int *ddxDriverPatchVersion, |
| 282 | char **clientDriverName) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 283 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 284 | XExtDisplayInfo *info = find_display(dpy); |
| 285 | xXF86DRIGetClientDriverNameReply rep; |
| 286 | xXF86DRIGetClientDriverNameReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 287 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 288 | TRACE("GetClientDriverName..."); |
| 289 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 290 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 291 | LockDisplay(dpy); |
| 292 | GetReq(XF86DRIGetClientDriverName, req); |
| 293 | req->reqType = info->codes->major_opcode; |
| 294 | req->driReqType = X_XF86DRIGetClientDriverName; |
| 295 | req->screen = screen; |
| 296 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 297 | UnlockDisplay(dpy); |
| 298 | SyncHandle(); |
| 299 | TRACE("GetClientDriverName... return False"); |
| 300 | return False; |
| 301 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 302 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 303 | *ddxDriverMajorVersion = rep.ddxDriverMajorVersion; |
| 304 | *ddxDriverMinorVersion = rep.ddxDriverMinorVersion; |
| 305 | *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 306 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 307 | if (rep.length) { |
Alan Coopersmith | 306f630 | 2013-04-26 16:33:03 -0700 | [diff] [blame] | 308 | if (rep.clientDriverNameLength < INT_MAX) |
| 309 | *clientDriverName = calloc(rep.clientDriverNameLength + 1, 1); |
| 310 | else |
| 311 | *clientDriverName = NULL; |
| 312 | if (*clientDriverName == NULL) { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 313 | _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3)); |
| 314 | UnlockDisplay(dpy); |
| 315 | SyncHandle(); |
| 316 | TRACE("GetClientDriverName... return False"); |
| 317 | return False; |
| 318 | } |
| 319 | _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength); |
| 320 | } |
| 321 | else { |
| 322 | *clientDriverName = NULL; |
| 323 | } |
| 324 | UnlockDisplay(dpy); |
| 325 | SyncHandle(); |
| 326 | TRACE("GetClientDriverName... return True"); |
| 327 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 328 | } |
| 329 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 330 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 331 | XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID, |
| 332 | XID * context, drm_context_t * hHWContext) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 333 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 334 | XExtDisplayInfo *info = find_display(dpy); |
| 335 | xXF86DRICreateContextReply rep; |
| 336 | xXF86DRICreateContextReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 337 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 338 | TRACE("CreateContext..."); |
| 339 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 340 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 341 | LockDisplay(dpy); |
| 342 | GetReq(XF86DRICreateContext, req); |
| 343 | req->reqType = info->codes->major_opcode; |
| 344 | req->driReqType = X_XF86DRICreateContext; |
| 345 | req->visual = configID; |
| 346 | req->screen = screen; |
| 347 | *context = XAllocID(dpy); |
| 348 | req->context = *context; |
| 349 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 350 | UnlockDisplay(dpy); |
| 351 | SyncHandle(); |
| 352 | TRACE("CreateContext... return False"); |
| 353 | return False; |
| 354 | } |
| 355 | *hHWContext = rep.hHWContext; |
| 356 | UnlockDisplay(dpy); |
| 357 | SyncHandle(); |
| 358 | TRACE("CreateContext... return True"); |
| 359 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 360 | } |
| 361 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 362 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 363 | XF86DRICreateContext(Display * dpy, int screen, Visual * visual, |
| 364 | XID * context, drm_context_t * hHWContext) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 365 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 366 | return XF86DRICreateContextWithConfig(dpy, screen, visual->visualid, |
| 367 | context, hHWContext); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 368 | } |
| 369 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 370 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 371 | XF86DRIDestroyContext(Display * dpy, int screen, XID context) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 372 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 373 | XExtDisplayInfo *info = find_display(dpy); |
| 374 | xXF86DRIDestroyContextReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 375 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 376 | TRACE("DestroyContext..."); |
| 377 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 378 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 379 | LockDisplay(dpy); |
| 380 | GetReq(XF86DRIDestroyContext, req); |
| 381 | req->reqType = info->codes->major_opcode; |
| 382 | req->driReqType = X_XF86DRIDestroyContext; |
| 383 | req->screen = screen; |
| 384 | req->context = context; |
| 385 | UnlockDisplay(dpy); |
| 386 | SyncHandle(); |
| 387 | TRACE("DestroyContext... return True"); |
| 388 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 389 | } |
| 390 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 391 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 392 | XF86DRICreateDrawable(Display * dpy, int screen, |
| 393 | XID drawable, drm_drawable_t * hHWDrawable) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 394 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 395 | XExtDisplayInfo *info = find_display(dpy); |
| 396 | xXF86DRICreateDrawableReply rep; |
| 397 | xXF86DRICreateDrawableReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 398 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 399 | TRACE("CreateDrawable..."); |
| 400 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 401 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 402 | LockDisplay(dpy); |
| 403 | GetReq(XF86DRICreateDrawable, req); |
| 404 | req->reqType = info->codes->major_opcode; |
| 405 | req->driReqType = X_XF86DRICreateDrawable; |
| 406 | req->screen = screen; |
| 407 | req->drawable = drawable; |
| 408 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 409 | UnlockDisplay(dpy); |
| 410 | SyncHandle(); |
| 411 | TRACE("CreateDrawable... return False"); |
| 412 | return False; |
| 413 | } |
| 414 | *hHWDrawable = rep.hHWDrawable; |
| 415 | UnlockDisplay(dpy); |
| 416 | SyncHandle(); |
| 417 | TRACE("CreateDrawable... return True"); |
| 418 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 419 | } |
| 420 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 421 | static int |
| 422 | noopErrorHandler(Display * dpy, XErrorEvent * xerr) |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 423 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 424 | return 0; |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 425 | } |
| 426 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 427 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 428 | XF86DRIDestroyDrawable(Display * dpy, int screen, XID drawable) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 429 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 430 | XExtDisplayInfo *info = find_display(dpy); |
| 431 | xXF86DRIDestroyDrawableReq *req; |
| 432 | int (*oldXErrorHandler) (Display *, XErrorEvent *); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 433 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 434 | TRACE("DestroyDrawable..."); |
| 435 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 436 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 437 | /* This is called from the DRI driver, which used call it like this |
| 438 | * |
| 439 | * if (windowExists(drawable)) |
| 440 | * destroyDrawable(drawable); |
| 441 | * |
| 442 | * which is a textbook race condition - the window may disappear |
Zoë Blade | 05e7f7f | 2015-04-22 11:33:17 +0100 | [diff] [blame] | 443 | * from the server between checking for its existence and |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 444 | * destroying it. Instead we change the semantics of |
| 445 | * __DRIinterfaceMethodsRec::destroyDrawable() to succeed even if |
| 446 | * the windows is gone, by wrapping the destroy call in an error |
| 447 | * handler. */ |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 448 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 449 | XSync(dpy, False); |
| 450 | oldXErrorHandler = XSetErrorHandler(noopErrorHandler); |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 451 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 452 | LockDisplay(dpy); |
| 453 | GetReq(XF86DRIDestroyDrawable, req); |
| 454 | req->reqType = info->codes->major_opcode; |
| 455 | req->driReqType = X_XF86DRIDestroyDrawable; |
| 456 | req->screen = screen; |
| 457 | req->drawable = drawable; |
| 458 | UnlockDisplay(dpy); |
| 459 | SyncHandle(); |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 460 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 461 | XSetErrorHandler(oldXErrorHandler); |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 462 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 463 | TRACE("DestroyDrawable... return True"); |
| 464 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 465 | } |
| 466 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 467 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 468 | XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, |
| 469 | unsigned int *index, unsigned int *stamp, |
| 470 | int *X, int *Y, int *W, int *H, |
| 471 | int *numClipRects, drm_clip_rect_t ** pClipRects, |
| 472 | int *backX, int *backY, |
| 473 | int *numBackClipRects, |
| 474 | drm_clip_rect_t ** pBackClipRects) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 475 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 476 | XExtDisplayInfo *info = find_display(dpy); |
| 477 | xXF86DRIGetDrawableInfoReply rep; |
| 478 | xXF86DRIGetDrawableInfoReq *req; |
| 479 | int total_rects; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 480 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 481 | TRACE("GetDrawableInfo..."); |
| 482 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 483 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 484 | LockDisplay(dpy); |
| 485 | GetReq(XF86DRIGetDrawableInfo, req); |
| 486 | req->reqType = info->codes->major_opcode; |
| 487 | req->driReqType = X_XF86DRIGetDrawableInfo; |
| 488 | req->screen = screen; |
| 489 | req->drawable = drawable; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 490 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 491 | if (!_XReply(dpy, (xReply *) & rep, 1, xFalse)) { |
| 492 | UnlockDisplay(dpy); |
| 493 | SyncHandle(); |
| 494 | TRACE("GetDrawableInfo... return False"); |
| 495 | return False; |
| 496 | } |
| 497 | *index = rep.drawableTableIndex; |
| 498 | *stamp = rep.drawableTableStamp; |
| 499 | *X = (int) rep.drawableX; |
| 500 | *Y = (int) rep.drawableY; |
| 501 | *W = (int) rep.drawableWidth; |
| 502 | *H = (int) rep.drawableHeight; |
| 503 | *numClipRects = rep.numClipRects; |
| 504 | total_rects = *numClipRects; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 505 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 506 | *backX = rep.backX; |
| 507 | *backY = rep.backY; |
| 508 | *numBackClipRects = rep.numBackClipRects; |
| 509 | total_rects += *numBackClipRects; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 510 | |
| 511 | #if 0 |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 512 | /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks |
| 513 | * backwards compatibility (Because of the >> 2 shift) but the fix |
| 514 | * enables multi-threaded apps to work. |
| 515 | */ |
| 516 | if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) - |
| 517 | SIZEOF(xGenericReply) + |
| 518 | total_rects * sizeof(drm_clip_rect_t)) + |
| 519 | 3) & ~3) >> 2)) { |
| 520 | _XEatData(dpy, rep.length); |
| 521 | UnlockDisplay(dpy); |
| 522 | SyncHandle(); |
| 523 | TRACE("GetDrawableInfo... return False"); |
| 524 | return False; |
| 525 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 526 | #endif |
| 527 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 528 | if (*numClipRects) { |
| 529 | int len = sizeof(drm_clip_rect_t) * (*numClipRects); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 530 | |
Matt Turner | 2b7a972 | 2012-09-03 19:44:00 -0700 | [diff] [blame] | 531 | *pClipRects = calloc(len, 1); |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 532 | if (*pClipRects) |
| 533 | _XRead(dpy, (char *) *pClipRects, len); |
| 534 | } |
| 535 | else { |
| 536 | *pClipRects = NULL; |
| 537 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 538 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 539 | if (*numBackClipRects) { |
| 540 | int len = sizeof(drm_clip_rect_t) * (*numBackClipRects); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 541 | |
Matt Turner | 2b7a972 | 2012-09-03 19:44:00 -0700 | [diff] [blame] | 542 | *pBackClipRects = calloc(len, 1); |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 543 | if (*pBackClipRects) |
| 544 | _XRead(dpy, (char *) *pBackClipRects, len); |
| 545 | } |
| 546 | else { |
| 547 | *pBackClipRects = NULL; |
| 548 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 549 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 550 | UnlockDisplay(dpy); |
| 551 | SyncHandle(); |
| 552 | TRACE("GetDrawableInfo... return True"); |
| 553 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 554 | } |
| 555 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 556 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 557 | XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, |
| 558 | int *fbOrigin, int *fbSize, int *fbStride, |
| 559 | int *devPrivateSize, void **pDevPrivate) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 560 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 561 | XExtDisplayInfo *info = find_display(dpy); |
| 562 | xXF86DRIGetDeviceInfoReply rep; |
| 563 | xXF86DRIGetDeviceInfoReq *req; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 564 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 565 | TRACE("GetDeviceInfo..."); |
| 566 | XF86DRICheckExtension(dpy, info, False); |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 567 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 568 | LockDisplay(dpy); |
| 569 | GetReq(XF86DRIGetDeviceInfo, req); |
| 570 | req->reqType = info->codes->major_opcode; |
| 571 | req->driReqType = X_XF86DRIGetDeviceInfo; |
| 572 | req->screen = screen; |
| 573 | if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { |
| 574 | UnlockDisplay(dpy); |
| 575 | SyncHandle(); |
| 576 | TRACE("GetDeviceInfo... return False"); |
| 577 | return False; |
| 578 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 579 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 580 | *hFrameBuffer = rep.hFrameBufferLow; |
| 581 | if (sizeof(drm_handle_t) == 8) { |
| 582 | int shift = 32; /* var to prevent warning on next line */ |
| 583 | *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; |
| 584 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 585 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 586 | *fbOrigin = rep.framebufferOrigin; |
| 587 | *fbSize = rep.framebufferSize; |
| 588 | *fbStride = rep.framebufferStride; |
| 589 | *devPrivateSize = rep.devPrivateSize; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 590 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 591 | if (rep.length) { |
Matt Turner | 2b7a972 | 2012-09-03 19:44:00 -0700 | [diff] [blame] | 592 | if (!(*pDevPrivate = calloc(rep.devPrivateSize, 1))) { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 593 | _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3)); |
| 594 | UnlockDisplay(dpy); |
| 595 | SyncHandle(); |
| 596 | TRACE("GetDeviceInfo... return False"); |
| 597 | return False; |
| 598 | } |
| 599 | _XRead(dpy, (char *) *pDevPrivate, rep.devPrivateSize); |
| 600 | } |
| 601 | else { |
| 602 | *pDevPrivate = NULL; |
| 603 | } |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 604 | |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 605 | UnlockDisplay(dpy); |
| 606 | SyncHandle(); |
| 607 | TRACE("GetDeviceInfo... return True"); |
| 608 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 609 | } |
| 610 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 611 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 612 | XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 613 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 614 | /* This function and the underlying X protocol are deprecated. |
| 615 | */ |
| 616 | (void) dpy; |
| 617 | (void) screen; |
| 618 | (void) drawable; |
| 619 | return False; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 620 | } |
| 621 | |
Kristian Høgsberg | 697e221 | 2010-02-05 11:04:48 -0500 | [diff] [blame] | 622 | Bool |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 623 | XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 624 | { |
RALOVICH, Kristóf | 4d2a381 | 2008-10-13 15:03:13 +0200 | [diff] [blame] | 625 | /* This function and the underlying X protocol are deprecated. |
| 626 | */ |
| 627 | (void) dpy; |
| 628 | (void) screen; |
| 629 | (void) drawable; |
| 630 | return True; |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 631 | } |
Adam Jackson | be85fde | 2006-08-10 20:19:57 +0000 | [diff] [blame] | 632 | |
| 633 | #endif /* GLX_DIRECT_RENDERING */ |