mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-24 07:50:26 +00:00
glx: Remove DRI1
The DRI1 drivers were removed in Mesa 8.0, released in February 2012. Time to say goodnight. Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7660>
This commit is contained in:
parent
63822802ef
commit
94a9867b05
@ -237,7 +237,7 @@ x86_build-base:
|
||||
- .fdo.container-build@debian
|
||||
- .container
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &x86_build-base "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &x86_build-base "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-x86_build-base:
|
||||
extends:
|
||||
@ -255,7 +255,7 @@ x86_build:
|
||||
extends:
|
||||
- .use-x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &x86_build "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &x86_build "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-x86_build:
|
||||
variables:
|
||||
@ -269,7 +269,7 @@ i386_build:
|
||||
extends:
|
||||
- .use-x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &i386_build "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &i386_build "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-i386_build:
|
||||
variables:
|
||||
@ -283,7 +283,7 @@ ppc64el_build:
|
||||
extends:
|
||||
- .use-x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &ppc64el_build "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &ppc64el_build "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-ppc64el_build:
|
||||
variables:
|
||||
@ -297,7 +297,7 @@ s390x_build:
|
||||
extends:
|
||||
- .use-x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &s390x_build "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &s390x_build "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-s390x_build:
|
||||
variables:
|
||||
@ -311,7 +311,7 @@ android_build:
|
||||
extends:
|
||||
- .use-x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &android_build "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &android_build "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-android_build:
|
||||
variables:
|
||||
@ -324,7 +324,7 @@ android_build:
|
||||
x86_test-base:
|
||||
extends: x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &x86_test-base "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &x86_test-base "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-x86_test-base:
|
||||
extends:
|
||||
@ -353,7 +353,7 @@ x86_test-vk:
|
||||
x86_build_old:
|
||||
extends: x86_build-base
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &x86_build_old "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &x86_build_old "2020-12-01-no-more-dri1"
|
||||
FDO_DISTRIBUTION_VERSION: stretch-slim
|
||||
|
||||
.use-x86_build_old:
|
||||
@ -369,7 +369,7 @@ arm_build:
|
||||
- .fdo.container-build@debian@aarch64
|
||||
- .container
|
||||
variables:
|
||||
FDO_DISTRIBUTION_TAG: &arm_build "2020-11-05-kmod"
|
||||
FDO_DISTRIBUTION_TAG: &arm_build "2020-12-01-no-more-dri1"
|
||||
|
||||
.use-arm_build:
|
||||
variables:
|
||||
|
@ -50,7 +50,6 @@ apt-get install -y --no-remove \
|
||||
libvulkan-dev \
|
||||
libx11-dev \
|
||||
libx11-xcb-dev \
|
||||
libxdamage-dev \
|
||||
libxext-dev \
|
||||
libxml2-utils \
|
||||
libxrandr-dev \
|
||||
|
@ -1,3 +1,4 @@
|
||||
GL_EXT_demote_to_helper_invocation on radeonsi
|
||||
EGL_MESA_platform_xcb
|
||||
driconf: remove glx_disable_oml_sync_control, glx_disable_sgi_video_sync, and glx_disable_ext_buffer_age
|
||||
Removed support for loading DRI drivers older than Mesa 8.0, including all DRI1 support
|
||||
|
@ -1742,7 +1742,6 @@ endif
|
||||
|
||||
dep_x11 = null_dep
|
||||
dep_xext = null_dep
|
||||
dep_xdamage = null_dep
|
||||
dep_xfixes = null_dep
|
||||
dep_x11_xcb = null_dep
|
||||
dep_xcb = null_dep
|
||||
@ -1768,7 +1767,6 @@ if with_platform_x11
|
||||
elif with_glx == 'dri'
|
||||
dep_x11 = dependency('x11')
|
||||
dep_xext = dependency('xext')
|
||||
dep_xdamage = dependency('xdamage', version : '>= 1.1')
|
||||
dep_xfixes = dependency('xfixes', version : '>= 2.0')
|
||||
dep_xcb_glx = dependency('xcb-glx', version : '>= 1.8.1')
|
||||
dep_xcb_shm = dependency('xcb-shm')
|
||||
@ -1870,7 +1868,7 @@ if with_glx == 'xlib' or with_glx == 'gallium-xlib'
|
||||
gl_priv_reqs += ['x11', 'xext', 'xcb']
|
||||
elif with_glx == 'dri'
|
||||
gl_priv_reqs += [
|
||||
'x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'x11-xcb', 'xcb',
|
||||
'x11', 'xext', 'xfixes', 'x11-xcb', 'xcb',
|
||||
'xcb-glx >= 1.8.1']
|
||||
if with_dri_platform == 'drm'
|
||||
gl_priv_reqs += 'xcb-dri2 >= 1.8'
|
||||
|
@ -711,7 +711,7 @@ def generate(env):
|
||||
env.AddMethod(msvc2013_compat, 'MSVC2013Compat')
|
||||
env.AddMethod(unit_test, 'UnitTest')
|
||||
|
||||
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage >= 1.1', 'xfixes', 'glproto >= 1.4.13', 'dri2proto >= 2.8'])
|
||||
env.PkgCheckModules('X11', ['x11', 'xext', 'xfixes', 'glproto >= 1.4.13', 'dri2proto >= 2.8'])
|
||||
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])
|
||||
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
|
||||
env.PkgCheckModules('DRM', ['libdrm >= 2.4.75'])
|
||||
|
@ -36,7 +36,6 @@ def generate(env):
|
||||
'X11',
|
||||
'Xext',
|
||||
'Xxf86vm',
|
||||
'Xdamage',
|
||||
'Xfixes',
|
||||
])
|
||||
|
||||
|
@ -1,633 +0,0 @@
|
||||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
Copyright 2000 VA Linux Systems, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Kevin E. Martin <martin@valinux.com>
|
||||
* Jens Owen <jowen@vmware.com>
|
||||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* THIS IS NOT AN X CONSORTIUM STANDARD */
|
||||
|
||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||
|
||||
#include <X11/Xlibint.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/extensions/Xext.h>
|
||||
#include <X11/extensions/extutil.h>
|
||||
#include "xf86dristr.h"
|
||||
#include <limits.h>
|
||||
|
||||
static XExtensionInfo _xf86dri_info_data;
|
||||
static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
|
||||
static char xf86dri_extension_name[] = XF86DRINAME;
|
||||
|
||||
#define XF86DRICheckExtension(dpy,i,val) \
|
||||
XextCheckExtension (dpy, i, xf86dri_extension_name, val)
|
||||
|
||||
/*****************************************************************************
|
||||
* *
|
||||
* private utility routines *
|
||||
* *
|
||||
*****************************************************************************/
|
||||
|
||||
static int close_display(Display * dpy, XExtCodes * extCodes);
|
||||
static /* const */ XExtensionHooks xf86dri_extension_hooks = {
|
||||
NULL, /* create_gc */
|
||||
NULL, /* copy_gc */
|
||||
NULL, /* flush_gc */
|
||||
NULL, /* free_gc */
|
||||
NULL, /* create_font */
|
||||
NULL, /* free_font */
|
||||
close_display, /* close_display */
|
||||
NULL, /* wire_to_event */
|
||||
NULL, /* event_to_wire */
|
||||
NULL, /* error */
|
||||
NULL, /* error_string */
|
||||
};
|
||||
|
||||
static
|
||||
XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info,
|
||||
xf86dri_extension_name,
|
||||
&xf86dri_extension_hooks, 0, NULL)
|
||||
|
||||
static
|
||||
XEXT_GENERATE_CLOSE_DISPLAY(close_display, xf86dri_info)
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* *
|
||||
* public XFree86-DRI Extension routines *
|
||||
* *
|
||||
*****************************************************************************/
|
||||
#if 0
|
||||
#include <stdio.h>
|
||||
#define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg);
|
||||
#else
|
||||
#define TRACE(msg)
|
||||
#endif
|
||||
|
||||
Bool
|
||||
XF86DRIQueryExtension(Display * dpy, int *event_basep,
|
||||
int *error_basep)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
|
||||
TRACE("QueryExtension...");
|
||||
if (XextHasExtension(info)) {
|
||||
*event_basep = info->codes->first_event;
|
||||
*error_basep = info->codes->first_error;
|
||||
TRACE("QueryExtension... return True");
|
||||
return True;
|
||||
}
|
||||
else {
|
||||
TRACE("QueryExtension... return False");
|
||||
return False;
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion,
|
||||
int *patchVersion)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIQueryVersionReply rep;
|
||||
xXF86DRIQueryVersionReq *req;
|
||||
|
||||
TRACE("QueryVersion...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIQueryVersion, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIQueryVersion;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("QueryVersion... return False");
|
||||
return False;
|
||||
}
|
||||
*majorVersion = rep.majorVersion;
|
||||
*minorVersion = rep.minorVersion;
|
||||
*patchVersion = rep.patchVersion;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("QueryVersion... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen,
|
||||
Bool * isCapable)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIQueryDirectRenderingCapableReply rep;
|
||||
xXF86DRIQueryDirectRenderingCapableReq *req;
|
||||
|
||||
TRACE("QueryDirectRenderingCapable...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIQueryDirectRenderingCapable, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIQueryDirectRenderingCapable;
|
||||
req->screen = screen;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("QueryDirectRenderingCapable... return False");
|
||||
return False;
|
||||
}
|
||||
*isCapable = rep.isCapable;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("QueryDirectRenderingCapable... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
|
||||
char **busIdString)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIOpenConnectionReply rep;
|
||||
xXF86DRIOpenConnectionReq *req;
|
||||
|
||||
TRACE("OpenConnection...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIOpenConnection, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIOpenConnection;
|
||||
req->screen = screen;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("OpenConnection... return False");
|
||||
return False;
|
||||
}
|
||||
|
||||
*hSAREA = rep.hSAREALow;
|
||||
if (sizeof(drm_handle_t) == 8) {
|
||||
int shift = 32; /* var to prevent warning on next line */
|
||||
*hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift;
|
||||
}
|
||||
|
||||
if (rep.length) {
|
||||
if (rep.busIdStringLength < INT_MAX)
|
||||
*busIdString = calloc(rep.busIdStringLength + 1, 1);
|
||||
else
|
||||
*busIdString = NULL;
|
||||
if (*busIdString == NULL) {
|
||||
_XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("OpenConnection... return False");
|
||||
return False;
|
||||
}
|
||||
_XReadPad(dpy, *busIdString, rep.busIdStringLength);
|
||||
}
|
||||
else {
|
||||
*busIdString = NULL;
|
||||
}
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("OpenConnection... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIAuthConnectionReq *req;
|
||||
xXF86DRIAuthConnectionReply rep;
|
||||
|
||||
TRACE("AuthConnection...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIAuthConnection, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIAuthConnection;
|
||||
req->screen = screen;
|
||||
req->magic = magic;
|
||||
rep.authenticated = 0;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("AuthConnection... return False");
|
||||
return False;
|
||||
}
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("AuthConnection... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRICloseConnection(Display * dpy, int screen)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRICloseConnectionReq *req;
|
||||
|
||||
TRACE("CloseConnection...");
|
||||
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRICloseConnection, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRICloseConnection;
|
||||
req->screen = screen;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("CloseConnection... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIGetClientDriverName(Display * dpy, int screen,
|
||||
int *ddxDriverMajorVersion,
|
||||
int *ddxDriverMinorVersion,
|
||||
int *ddxDriverPatchVersion,
|
||||
char **clientDriverName)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIGetClientDriverNameReply rep;
|
||||
xXF86DRIGetClientDriverNameReq *req;
|
||||
|
||||
TRACE("GetClientDriverName...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIGetClientDriverName, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIGetClientDriverName;
|
||||
req->screen = screen;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetClientDriverName... return False");
|
||||
return False;
|
||||
}
|
||||
|
||||
*ddxDriverMajorVersion = rep.ddxDriverMajorVersion;
|
||||
*ddxDriverMinorVersion = rep.ddxDriverMinorVersion;
|
||||
*ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
|
||||
|
||||
if (rep.length) {
|
||||
if (rep.clientDriverNameLength < INT_MAX)
|
||||
*clientDriverName = calloc(rep.clientDriverNameLength + 1, 1);
|
||||
else
|
||||
*clientDriverName = NULL;
|
||||
if (*clientDriverName == NULL) {
|
||||
_XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetClientDriverName... return False");
|
||||
return False;
|
||||
}
|
||||
_XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength);
|
||||
}
|
||||
else {
|
||||
*clientDriverName = NULL;
|
||||
}
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetClientDriverName... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID,
|
||||
XID * context, drm_context_t * hHWContext)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRICreateContextReply rep;
|
||||
xXF86DRICreateContextReq *req;
|
||||
|
||||
TRACE("CreateContext...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRICreateContext, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRICreateContext;
|
||||
req->visual = configID;
|
||||
req->screen = screen;
|
||||
*context = XAllocID(dpy);
|
||||
req->context = *context;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("CreateContext... return False");
|
||||
return False;
|
||||
}
|
||||
*hHWContext = rep.hHWContext;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("CreateContext... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRICreateContext(Display * dpy, int screen, Visual * visual,
|
||||
XID * context, drm_context_t * hHWContext)
|
||||
{
|
||||
return XF86DRICreateContextWithConfig(dpy, screen, visual->visualid,
|
||||
context, hHWContext);
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIDestroyContext(Display * dpy, int screen, XID context)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIDestroyContextReq *req;
|
||||
|
||||
TRACE("DestroyContext...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIDestroyContext, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIDestroyContext;
|
||||
req->screen = screen;
|
||||
req->context = context;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("DestroyContext... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRICreateDrawable(Display * dpy, int screen,
|
||||
XID drawable, drm_drawable_t * hHWDrawable)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRICreateDrawableReply rep;
|
||||
xXF86DRICreateDrawableReq *req;
|
||||
|
||||
TRACE("CreateDrawable...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRICreateDrawable, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRICreateDrawable;
|
||||
req->screen = screen;
|
||||
req->drawable = drawable;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("CreateDrawable... return False");
|
||||
return False;
|
||||
}
|
||||
*hHWDrawable = rep.hHWDrawable;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("CreateDrawable... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
static int
|
||||
noopErrorHandler(Display * dpy, XErrorEvent * xerr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIDestroyDrawable(Display * dpy, int screen, XID drawable)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIDestroyDrawableReq *req;
|
||||
int (*oldXErrorHandler) (Display *, XErrorEvent *);
|
||||
|
||||
TRACE("DestroyDrawable...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
/* This is called from the DRI driver, which used call it like this
|
||||
*
|
||||
* if (windowExists(drawable))
|
||||
* destroyDrawable(drawable);
|
||||
*
|
||||
* which is a textbook race condition - the window may disappear
|
||||
* from the server between checking for its existence and
|
||||
* destroying it. Instead we change the semantics of
|
||||
* __DRIinterfaceMethodsRec::destroyDrawable() to succeed even if
|
||||
* the windows is gone, by wrapping the destroy call in an error
|
||||
* handler. */
|
||||
|
||||
XSync(dpy, False);
|
||||
oldXErrorHandler = XSetErrorHandler(noopErrorHandler);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIDestroyDrawable, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIDestroyDrawable;
|
||||
req->screen = screen;
|
||||
req->drawable = drawable;
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
|
||||
XSetErrorHandler(oldXErrorHandler);
|
||||
|
||||
TRACE("DestroyDrawable... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
|
||||
unsigned int *index, unsigned int *stamp,
|
||||
int *X, int *Y, int *W, int *H,
|
||||
int *numClipRects, drm_clip_rect_t ** pClipRects,
|
||||
int *backX, int *backY,
|
||||
int *numBackClipRects,
|
||||
drm_clip_rect_t ** pBackClipRects)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIGetDrawableInfoReply rep;
|
||||
xXF86DRIGetDrawableInfoReq *req;
|
||||
int total_rects;
|
||||
|
||||
TRACE("GetDrawableInfo...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIGetDrawableInfo, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIGetDrawableInfo;
|
||||
req->screen = screen;
|
||||
req->drawable = drawable;
|
||||
|
||||
if (!_XReply(dpy, (xReply *) & rep, 1, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetDrawableInfo... return False");
|
||||
return False;
|
||||
}
|
||||
*index = rep.drawableTableIndex;
|
||||
*stamp = rep.drawableTableStamp;
|
||||
*X = (int) rep.drawableX;
|
||||
*Y = (int) rep.drawableY;
|
||||
*W = (int) rep.drawableWidth;
|
||||
*H = (int) rep.drawableHeight;
|
||||
*numClipRects = rep.numClipRects;
|
||||
total_rects = *numClipRects;
|
||||
|
||||
*backX = rep.backX;
|
||||
*backY = rep.backY;
|
||||
*numBackClipRects = rep.numBackClipRects;
|
||||
total_rects += *numBackClipRects;
|
||||
|
||||
#if 0
|
||||
/* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks
|
||||
* backwards compatibility (Because of the >> 2 shift) but the fix
|
||||
* enables multi-threaded apps to work.
|
||||
*/
|
||||
if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) -
|
||||
SIZEOF(xGenericReply) +
|
||||
total_rects * sizeof(drm_clip_rect_t)) +
|
||||
3) & ~3) >> 2)) {
|
||||
_XEatData(dpy, rep.length);
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetDrawableInfo... return False");
|
||||
return False;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (*numClipRects) {
|
||||
int len = sizeof(drm_clip_rect_t) * (*numClipRects);
|
||||
|
||||
*pClipRects = calloc(len, 1);
|
||||
if (*pClipRects)
|
||||
_XRead(dpy, (char *) *pClipRects, len);
|
||||
}
|
||||
else {
|
||||
*pClipRects = NULL;
|
||||
}
|
||||
|
||||
if (*numBackClipRects) {
|
||||
int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
|
||||
|
||||
*pBackClipRects = calloc(len, 1);
|
||||
if (*pBackClipRects)
|
||||
_XRead(dpy, (char *) *pBackClipRects, len);
|
||||
}
|
||||
else {
|
||||
*pBackClipRects = NULL;
|
||||
}
|
||||
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetDrawableInfo... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer,
|
||||
int *fbOrigin, int *fbSize, int *fbStride,
|
||||
int *devPrivateSize, void **pDevPrivate)
|
||||
{
|
||||
XExtDisplayInfo *info = find_display(dpy);
|
||||
xXF86DRIGetDeviceInfoReply rep;
|
||||
xXF86DRIGetDeviceInfoReq *req;
|
||||
|
||||
TRACE("GetDeviceInfo...");
|
||||
XF86DRICheckExtension(dpy, info, False);
|
||||
|
||||
LockDisplay(dpy);
|
||||
GetReq(XF86DRIGetDeviceInfo, req);
|
||||
req->reqType = info->codes->major_opcode;
|
||||
req->driReqType = X_XF86DRIGetDeviceInfo;
|
||||
req->screen = screen;
|
||||
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetDeviceInfo... return False");
|
||||
return False;
|
||||
}
|
||||
|
||||
*hFrameBuffer = rep.hFrameBufferLow;
|
||||
if (sizeof(drm_handle_t) == 8) {
|
||||
int shift = 32; /* var to prevent warning on next line */
|
||||
*hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift;
|
||||
}
|
||||
|
||||
*fbOrigin = rep.framebufferOrigin;
|
||||
*fbSize = rep.framebufferSize;
|
||||
*fbStride = rep.framebufferStride;
|
||||
*devPrivateSize = rep.devPrivateSize;
|
||||
|
||||
if (rep.length) {
|
||||
if (!(*pDevPrivate = calloc(rep.devPrivateSize, 1))) {
|
||||
_XEatData(dpy, ((rep.devPrivateSize + 3) & ~3));
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetDeviceInfo... return False");
|
||||
return False;
|
||||
}
|
||||
_XRead(dpy, (char *) *pDevPrivate, rep.devPrivateSize);
|
||||
}
|
||||
else {
|
||||
*pDevPrivate = NULL;
|
||||
}
|
||||
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
TRACE("GetDeviceInfo... return True");
|
||||
return True;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable)
|
||||
{
|
||||
/* This function and the underlying X protocol are deprecated.
|
||||
*/
|
||||
(void) dpy;
|
||||
(void) screen;
|
||||
(void) drawable;
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool
|
||||
XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable)
|
||||
{
|
||||
/* This function and the underlying X protocol are deprecated.
|
||||
*/
|
||||
(void) dpy;
|
||||
(void) screen;
|
||||
(void) drawable;
|
||||
return True;
|
||||
}
|
||||
|
||||
#endif /* GLX_DIRECT_RENDERING */
|
@ -1,912 +0,0 @@
|
||||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* Brian Paul <brian@precisioninsight.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#include "glxclient.h"
|
||||
#include "xf86dri.h"
|
||||
#include "dri2.h"
|
||||
#include "dri_sarea.h"
|
||||
#include <dlfcn.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include "xf86drm.h"
|
||||
#include "dri_common.h"
|
||||
|
||||
struct dri_display
|
||||
{
|
||||
__GLXDRIdisplay base;
|
||||
|
||||
/*
|
||||
** XFree86-DRI version information
|
||||
*/
|
||||
int driMajor;
|
||||
int driMinor;
|
||||
int driPatch;
|
||||
};
|
||||
|
||||
struct dri_screen
|
||||
{
|
||||
struct glx_screen base;
|
||||
|
||||
__DRIscreen *driScreen;
|
||||
__GLXDRIscreen vtable;
|
||||
const __DRIlegacyExtension *legacy;
|
||||
const __DRIcoreExtension *core;
|
||||
const __DRIswapControlExtension *swapControl;
|
||||
const __DRImediaStreamCounterExtension *msc;
|
||||
const __DRIconfig **driver_configs;
|
||||
const __DRIcopySubBufferExtension *driCopySubBuffer;
|
||||
|
||||
void *driver;
|
||||
int fd;
|
||||
};
|
||||
|
||||
struct dri_context
|
||||
{
|
||||
struct glx_context base;
|
||||
__DRIcontext *driContext;
|
||||
XID hwContextID;
|
||||
};
|
||||
|
||||
struct dri_drawable
|
||||
{
|
||||
__GLXDRIdrawable base;
|
||||
|
||||
__DRIdrawable *driDrawable;
|
||||
};
|
||||
|
||||
static char *
|
||||
dri_get_driver_name(struct glx_screen *psc)
|
||||
{
|
||||
Display *dpy = psc->dpy;
|
||||
int scrNum = psc->scr;
|
||||
int directCapable;
|
||||
Bool b;
|
||||
int event, error;
|
||||
int driverMajor, driverMinor, driverPatch;
|
||||
char *driverName = NULL;
|
||||
|
||||
if (XF86DRIQueryExtension(dpy, &event, &error)) { /* DRI1 */
|
||||
if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) {
|
||||
ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n");
|
||||
return NULL;
|
||||
}
|
||||
if (!directCapable) {
|
||||
ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor,
|
||||
&driverPatch, &driverName);
|
||||
if (!b) {
|
||||
ErrorMessageF("Cannot determine driver name for screen %d\n",
|
||||
scrNum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
|
||||
driverMajor, driverMinor, driverPatch, driverName,
|
||||
scrNum);
|
||||
|
||||
return driverName;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unadjusted system time (UST). Currently, the UST is measured in
|
||||
* microseconds since Epoc. The actual resolution of the UST may vary from
|
||||
* system to system, and the units may vary from release to release.
|
||||
* Drivers should not call this function directly. They should instead use
|
||||
* \c glXGetProcAddress to obtain a pointer to the function.
|
||||
*
|
||||
* \param ust Location to store the 64-bit UST
|
||||
* \returns Zero on success or a negative errno value on failure.
|
||||
*
|
||||
* \sa glXGetProcAddress, PFNGLXGETUSTPROC
|
||||
*
|
||||
* \since Internal API version 20030317.
|
||||
*/
|
||||
static int
|
||||
__glXGetUST(int64_t * ust)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
if (ust == NULL) {
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (gettimeofday(&tv, NULL) == 0) {
|
||||
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
__driGetMSCRate(__DRIdrawable *draw,
|
||||
int32_t * numerator, int32_t * denominator,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
__GLXDRIdrawable *glxDraw = loaderPrivate;
|
||||
|
||||
return __glxGetMscRate(glxDraw->psc, numerator, denominator);
|
||||
}
|
||||
|
||||
static const __DRIsystemTimeExtension systemTimeExtension = {
|
||||
.base = {__DRI_SYSTEM_TIME, 1 },
|
||||
|
||||
.getUST = __glXGetUST,
|
||||
.getMSCRate = __driGetMSCRate
|
||||
};
|
||||
|
||||
static GLboolean
|
||||
has_damage_post(Display * dpy)
|
||||
{
|
||||
static GLboolean inited = GL_FALSE;
|
||||
static GLboolean has_damage;
|
||||
|
||||
if (!inited) {
|
||||
int major, minor;
|
||||
|
||||
if (XDamageQueryVersion(dpy, &major, &minor) &&
|
||||
major == 1 && minor >= 1) {
|
||||
has_damage = GL_TRUE;
|
||||
}
|
||||
else {
|
||||
has_damage = GL_FALSE;
|
||||
}
|
||||
inited = GL_TRUE;
|
||||
}
|
||||
|
||||
return has_damage;
|
||||
}
|
||||
|
||||
static void
|
||||
__glXReportDamage(__DRIdrawable * driDraw,
|
||||
int x, int y,
|
||||
drm_clip_rect_t * rects, int num_rects,
|
||||
GLboolean front_buffer, void *loaderPrivate)
|
||||
{
|
||||
XRectangle *xrects;
|
||||
XserverRegion region;
|
||||
int i;
|
||||
int x_off, y_off;
|
||||
__GLXDRIdrawable *glxDraw = loaderPrivate;
|
||||
struct glx_screen *psc = glxDraw->psc;
|
||||
Display *dpy = psc->dpy;
|
||||
Drawable drawable;
|
||||
|
||||
if (!has_damage_post(dpy))
|
||||
return;
|
||||
|
||||
if (front_buffer) {
|
||||
x_off = x;
|
||||
y_off = y;
|
||||
drawable = RootWindow(dpy, psc->scr);
|
||||
}
|
||||
else {
|
||||
x_off = 0;
|
||||
y_off = 0;
|
||||
drawable = glxDraw->xDrawable;
|
||||
}
|
||||
|
||||
xrects = malloc(sizeof(XRectangle) * num_rects);
|
||||
if (xrects == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < num_rects; i++) {
|
||||
xrects[i].x = rects[i].x1 + x_off;
|
||||
xrects[i].y = rects[i].y1 + y_off;
|
||||
xrects[i].width = rects[i].x2 - rects[i].x1;
|
||||
xrects[i].height = rects[i].y2 - rects[i].y1;
|
||||
}
|
||||
region = XFixesCreateRegion(dpy, xrects, num_rects);
|
||||
free(xrects);
|
||||
XDamageAdd(dpy, drawable, region);
|
||||
XFixesDestroyRegion(dpy, region);
|
||||
}
|
||||
|
||||
static const __DRIdamageExtension damageExtension = {
|
||||
.base = {__DRI_DAMAGE, 1 },
|
||||
|
||||
.reportDamage = __glXReportDamage,
|
||||
};
|
||||
|
||||
static GLboolean
|
||||
__glXDRIGetDrawableInfo(__DRIdrawable * drawable,
|
||||
unsigned int *index, unsigned int *stamp,
|
||||
int *X, int *Y, int *W, int *H,
|
||||
int *numClipRects, drm_clip_rect_t ** pClipRects,
|
||||
int *backX, int *backY,
|
||||
int *numBackClipRects,
|
||||
drm_clip_rect_t ** pBackClipRects,
|
||||
void *loaderPrivate)
|
||||
{
|
||||
__GLXDRIdrawable *glxDraw = loaderPrivate;
|
||||
struct glx_screen *psc = glxDraw->psc;
|
||||
Display *dpy = psc->dpy;
|
||||
|
||||
return XF86DRIGetDrawableInfo(dpy, psc->scr, glxDraw->drawable,
|
||||
index, stamp, X, Y, W, H,
|
||||
numClipRects, pClipRects,
|
||||
backX, backY,
|
||||
numBackClipRects, pBackClipRects);
|
||||
}
|
||||
|
||||
static const __DRIgetDrawableInfoExtension getDrawableInfoExtension = {
|
||||
.base = {__DRI_GET_DRAWABLE_INFO, 1 },
|
||||
|
||||
.getDrawableInfo = __glXDRIGetDrawableInfo
|
||||
};
|
||||
|
||||
static const __DRIextension *loader_extensions[] = {
|
||||
&systemTimeExtension.base,
|
||||
&getDrawableInfoExtension.base,
|
||||
&damageExtension.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
* Perform the required libGL-side initialization and call the client-side
|
||||
* driver's \c __driCreateNewScreen function.
|
||||
*
|
||||
* \param dpy Display pointer.
|
||||
* \param scrn Screen number on the display.
|
||||
* \param psc DRI screen information.
|
||||
* \param driDpy DRI display information.
|
||||
* \param createNewScreen Pointer to the client-side driver's
|
||||
* \c __driCreateNewScreen function.
|
||||
* \returns A pointer to the \c __DRIscreen structure returned by
|
||||
* the client-side driver on success, or \c NULL on failure.
|
||||
*/
|
||||
static void *
|
||||
CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
|
||||
struct dri_display * driDpy)
|
||||
{
|
||||
void *psp = NULL;
|
||||
drm_handle_t hSAREA;
|
||||
drmAddress pSAREA = MAP_FAILED;
|
||||
char *BusID;
|
||||
__DRIversion ddx_version;
|
||||
__DRIversion dri_version;
|
||||
__DRIversion drm_version;
|
||||
__DRIframebuffer framebuffer;
|
||||
int fd = -1;
|
||||
int status;
|
||||
|
||||
drm_magic_t magic;
|
||||
drmVersionPtr version;
|
||||
int newlyopened;
|
||||
char *driverName;
|
||||
drm_handle_t hFB;
|
||||
int junk;
|
||||
const __DRIconfig **driver_configs;
|
||||
struct glx_config *visual, *configs = NULL, *visuals = NULL;
|
||||
|
||||
/* DRI protocol version. */
|
||||
dri_version.major = driDpy->driMajor;
|
||||
dri_version.minor = driDpy->driMinor;
|
||||
dri_version.patch = driDpy->driPatch;
|
||||
|
||||
framebuffer.base = MAP_FAILED;
|
||||
framebuffer.dev_priv = NULL;
|
||||
framebuffer.size = 0;
|
||||
|
||||
if (!XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
|
||||
ErrorMessageF("XF86DRIOpenConnection failed\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
fd = drmOpenOnce(NULL, BusID, &newlyopened);
|
||||
|
||||
free(BusID); /* No longer needed */
|
||||
|
||||
if (fd < 0) {
|
||||
ErrorMessageF("drmOpenOnce failed (%s)\n", strerror(-fd));
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
if (drmGetMagic(fd, &magic)) {
|
||||
ErrorMessageF("drmGetMagic failed\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
version = drmGetVersion(fd);
|
||||
if (version) {
|
||||
drm_version.major = version->version_major;
|
||||
drm_version.minor = version->version_minor;
|
||||
drm_version.patch = version->version_patchlevel;
|
||||
drmFreeVersion(version);
|
||||
}
|
||||
else {
|
||||
drm_version.major = -1;
|
||||
drm_version.minor = -1;
|
||||
drm_version.patch = -1;
|
||||
}
|
||||
|
||||
if (newlyopened && !XF86DRIAuthConnection(dpy, scrn, magic)) {
|
||||
ErrorMessageF("XF86DRIAuthConnection failed\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
/* Get device name (like "radeon") and the ddx version numbers.
|
||||
* We'll check the version in each DRI driver's "createNewScreen"
|
||||
* function. */
|
||||
if (!XF86DRIGetClientDriverName(dpy, scrn,
|
||||
&ddx_version.major,
|
||||
&ddx_version.minor,
|
||||
&ddx_version.patch, &driverName)) {
|
||||
ErrorMessageF("XF86DRIGetClientDriverName failed\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
free(driverName); /* No longer needed. */
|
||||
|
||||
/*
|
||||
* Get device-specific info. pDevPriv will point to a struct
|
||||
* (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) that
|
||||
* has information about the screen size, depth, pitch, ancilliary
|
||||
* buffers, DRM mmap handles, etc.
|
||||
*/
|
||||
if (!XF86DRIGetDeviceInfo(dpy, scrn, &hFB, &junk,
|
||||
&framebuffer.size, &framebuffer.stride,
|
||||
&framebuffer.dev_priv_size,
|
||||
&framebuffer.dev_priv)) {
|
||||
ErrorMessageF("XF86DRIGetDeviceInfo failed\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
framebuffer.width = DisplayWidth(dpy, scrn);
|
||||
framebuffer.height = DisplayHeight(dpy, scrn);
|
||||
|
||||
/* Map the framebuffer region. */
|
||||
status = drmMap(fd, hFB, framebuffer.size,
|
||||
(drmAddressPtr) & framebuffer.base);
|
||||
if (status != 0) {
|
||||
ErrorMessageF("drmMap of framebuffer failed (%s)\n", strerror(-status));
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
/* Map the SAREA region. Further mmap regions may be setup in
|
||||
* each DRI driver's "createNewScreen" function.
|
||||
*/
|
||||
status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA);
|
||||
if (status != 0) {
|
||||
ErrorMessageF("drmMap of SAREA failed (%s)\n", strerror(-status));
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
psp = (*psc->legacy->createNewScreen) (scrn,
|
||||
&ddx_version,
|
||||
&dri_version,
|
||||
&drm_version,
|
||||
&framebuffer,
|
||||
pSAREA,
|
||||
fd,
|
||||
loader_extensions,
|
||||
&driver_configs, psc);
|
||||
|
||||
if (psp == NULL) {
|
||||
ErrorMessageF("Calling driver entry point failed\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs);
|
||||
visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs);
|
||||
|
||||
if (!configs || !visuals) {
|
||||
ErrorMessageF("No matching fbConfigs or visuals found\n");
|
||||
goto handle_error;
|
||||
}
|
||||
|
||||
glx_config_destroy_list(psc->base.configs);
|
||||
psc->base.configs = configs;
|
||||
glx_config_destroy_list(psc->base.visuals);
|
||||
psc->base.visuals = visuals;
|
||||
|
||||
psc->driver_configs = driver_configs;
|
||||
|
||||
/* Visuals with depth != screen depth are subject to automatic compositing
|
||||
* in the X server, so DRI1 can't render to them properly. Mark them as
|
||||
* non-conformant to prevent apps from picking them up accidentally.
|
||||
*/
|
||||
for (visual = psc->base.visuals; visual; visual = visual->next) {
|
||||
XVisualInfo templ;
|
||||
XVisualInfo *visuals;
|
||||
int num_visuals;
|
||||
long mask;
|
||||
|
||||
templ.visualid = visual->visualID;
|
||||
mask = VisualIDMask;
|
||||
visuals = XGetVisualInfo(dpy, mask, &templ, &num_visuals);
|
||||
|
||||
if (visuals) {
|
||||
if (num_visuals > 0 && visuals->depth != DefaultDepth(dpy, scrn))
|
||||
visual->visualRating = GLX_NON_CONFORMANT_CONFIG;
|
||||
|
||||
free(visuals);
|
||||
}
|
||||
}
|
||||
|
||||
return psp;
|
||||
|
||||
handle_error:
|
||||
if (configs)
|
||||
glx_config_destroy_list(configs);
|
||||
if (visuals)
|
||||
glx_config_destroy_list(visuals);
|
||||
|
||||
if (pSAREA != MAP_FAILED)
|
||||
drmUnmap(pSAREA, SAREA_MAX);
|
||||
|
||||
if (framebuffer.base != MAP_FAILED)
|
||||
drmUnmap((drmAddress) framebuffer.base, framebuffer.size);
|
||||
|
||||
free(framebuffer.dev_priv);
|
||||
|
||||
if (fd >= 0)
|
||||
drmCloseOnce(fd);
|
||||
|
||||
XF86DRICloseConnection(dpy, scrn);
|
||||
|
||||
ErrorMessageF("reverting to software direct rendering\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
dri_destroy_context(struct glx_context * context)
|
||||
{
|
||||
struct dri_context *pcp = (struct dri_context *) context;
|
||||
struct dri_screen *psc = (struct dri_screen *) context->psc;
|
||||
|
||||
driReleaseDrawables(&pcp->base);
|
||||
|
||||
free((char *) context->extensions);
|
||||
|
||||
(*psc->core->destroyContext) (pcp->driContext);
|
||||
|
||||
XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
|
||||
free(pcp);
|
||||
}
|
||||
|
||||
static int
|
||||
dri_bind_context(struct glx_context *context, struct glx_context *old,
|
||||
GLXDrawable draw, GLXDrawable read)
|
||||
{
|
||||
struct dri_context *pcp = (struct dri_context *) context;
|
||||
struct dri_screen *psc = (struct dri_screen *) pcp->base.psc;
|
||||
struct dri_drawable *pdraw, *pread;
|
||||
|
||||
pdraw = (struct dri_drawable *) driFetchDrawable(context, draw);
|
||||
pread = (struct dri_drawable *) driFetchDrawable(context, read);
|
||||
|
||||
driReleaseDrawables(&pcp->base);
|
||||
|
||||
if (pdraw == NULL || pread == NULL)
|
||||
return GLXBadDrawable;
|
||||
|
||||
if ((*psc->core->bindContext) (pcp->driContext,
|
||||
pdraw->driDrawable, pread->driDrawable))
|
||||
return Success;
|
||||
|
||||
return GLXBadContext;
|
||||
}
|
||||
|
||||
static void
|
||||
dri_unbind_context(struct glx_context *context, struct glx_context *new)
|
||||
{
|
||||
struct dri_context *pcp = (struct dri_context *) context;
|
||||
struct dri_screen *psc = (struct dri_screen *) pcp->base.psc;
|
||||
|
||||
(*psc->core->unbindContext) (pcp->driContext);
|
||||
}
|
||||
|
||||
static const struct glx_context_vtable dri_context_vtable = {
|
||||
.destroy = dri_destroy_context,
|
||||
.bind = dri_bind_context,
|
||||
.unbind = dri_unbind_context,
|
||||
.wait_gl = NULL,
|
||||
.wait_x = NULL,
|
||||
.use_x_font = DRI_glXUseXFont,
|
||||
.bind_tex_image = NULL,
|
||||
.release_tex_image = NULL,
|
||||
.get_proc_address = NULL,
|
||||
};
|
||||
|
||||
static struct glx_context *
|
||||
dri_create_context(struct glx_screen *base,
|
||||
struct glx_config *config_base,
|
||||
struct glx_context *shareList, int renderType)
|
||||
{
|
||||
struct dri_context *pcp, *pcp_shared;
|
||||
struct dri_screen *psc = (struct dri_screen *) base;
|
||||
drm_context_t hwContext;
|
||||
__DRIcontext *shared = NULL;
|
||||
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base;
|
||||
|
||||
if (!psc->base.driScreen)
|
||||
return NULL;
|
||||
|
||||
/* Check the renderType value */
|
||||
if (!validate_renderType_against_config(config_base, renderType))
|
||||
return NULL;
|
||||
|
||||
if (shareList) {
|
||||
/* If the shareList context is not a DRI context, we cannot possibly
|
||||
* create a DRI context that shares it.
|
||||
*/
|
||||
if (shareList->vtable->destroy != dri_destroy_context) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pcp_shared = (struct dri_context *) shareList;
|
||||
shared = pcp_shared->driContext;
|
||||
}
|
||||
|
||||
pcp = calloc(1, sizeof *pcp);
|
||||
if (pcp == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
|
||||
free(pcp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pcp->base.renderType = renderType;
|
||||
|
||||
if (!XF86DRICreateContextWithConfig(psc->base.dpy, psc->base.scr,
|
||||
config->base.visualID,
|
||||
&pcp->hwContextID, &hwContext)) {
|
||||
free(pcp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pcp->driContext =
|
||||
(*psc->legacy->createNewContext) (psc->driScreen,
|
||||
config->driConfig,
|
||||
renderType, shared, hwContext, pcp);
|
||||
if (pcp->driContext == NULL) {
|
||||
XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
|
||||
free(pcp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pcp->base.vtable = &dri_context_vtable;
|
||||
|
||||
return &pcp->base;
|
||||
}
|
||||
|
||||
static void
|
||||
driDestroyDrawable(__GLXDRIdrawable * pdraw)
|
||||
{
|
||||
struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
|
||||
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
|
||||
|
||||
(*psc->core->destroyDrawable) (pdp->driDrawable);
|
||||
XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, pdraw->drawable);
|
||||
free(pdraw);
|
||||
}
|
||||
|
||||
static __GLXDRIdrawable *
|
||||
driCreateDrawable(struct glx_screen *base,
|
||||
XID xDrawable,
|
||||
GLXDrawable drawable, struct glx_config *config_base)
|
||||
{
|
||||
drm_drawable_t hwDrawable;
|
||||
void *empty_attribute_list = NULL;
|
||||
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base;
|
||||
struct dri_screen *psc = (struct dri_screen *) base;
|
||||
struct dri_drawable *pdp;
|
||||
|
||||
/* Old dri can't handle GLX 1.3+ drawable constructors. */
|
||||
if (xDrawable != drawable)
|
||||
return NULL;
|
||||
|
||||
pdp = calloc(1, sizeof *pdp);
|
||||
if (!pdp)
|
||||
return NULL;
|
||||
|
||||
pdp->base.drawable = drawable;
|
||||
pdp->base.psc = &psc->base;
|
||||
|
||||
if (!XF86DRICreateDrawable(psc->base.dpy, psc->base.scr,
|
||||
drawable, &hwDrawable)) {
|
||||
free(pdp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Create a new drawable */
|
||||
pdp->driDrawable =
|
||||
(*psc->legacy->createNewDrawable) (psc->driScreen,
|
||||
config->driConfig,
|
||||
hwDrawable,
|
||||
GLX_WINDOW_BIT,
|
||||
empty_attribute_list, pdp);
|
||||
|
||||
if (!pdp->driDrawable) {
|
||||
XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, drawable);
|
||||
free(pdp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pdp->base.destroyDrawable = driDestroyDrawable;
|
||||
|
||||
return &pdp->base;
|
||||
}
|
||||
|
||||
static int64_t
|
||||
driSwapBuffers(__GLXDRIdrawable * pdraw, int64_t unused1, int64_t unused2,
|
||||
int64_t unused3, Bool flush)
|
||||
{
|
||||
struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
|
||||
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
|
||||
|
||||
if (flush) {
|
||||
glFlush();
|
||||
}
|
||||
|
||||
(*psc->core->swapBuffers) (pdp->driDrawable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
driCopySubBuffer(__GLXDRIdrawable * pdraw,
|
||||
int x, int y, int width, int height, Bool flush)
|
||||
{
|
||||
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
|
||||
struct dri_screen *psc = (struct dri_screen *) pdp->base.psc;
|
||||
|
||||
if (flush) {
|
||||
glFlush();
|
||||
}
|
||||
|
||||
(*psc->driCopySubBuffer->copySubBuffer) (pdp->driDrawable,
|
||||
x, y, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
driDestroyScreen(struct glx_screen *base)
|
||||
{
|
||||
struct dri_screen *psc = (struct dri_screen *) base;
|
||||
|
||||
/* Free the direct rendering per screen data */
|
||||
if (psc->driScreen)
|
||||
(*psc->core->destroyScreen) (psc->driScreen);
|
||||
driDestroyConfigs(psc->driver_configs);
|
||||
psc->driScreen = NULL;
|
||||
if (psc->driver)
|
||||
dlclose(psc->driver);
|
||||
}
|
||||
|
||||
static int
|
||||
driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
|
||||
{
|
||||
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
|
||||
|
||||
if (pdraw != NULL) {
|
||||
struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
|
||||
|
||||
if (psc->swapControl != NULL) {
|
||||
psc->swapControl->setSwapInterval(pdp->driDrawable, interval);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return GLX_BAD_CONTEXT;
|
||||
}
|
||||
|
||||
static int
|
||||
driGetSwapInterval(__GLXDRIdrawable *pdraw)
|
||||
{
|
||||
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
|
||||
|
||||
if (pdraw != NULL) {
|
||||
struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
|
||||
|
||||
if (psc->swapControl != NULL)
|
||||
return psc->swapControl->getSwapInterval(pdp->driDrawable);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Bind DRI1 specific extensions */
|
||||
static void
|
||||
driBindExtensions(struct dri_screen *psc, const __DRIextension **extensions)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
/* No DRI2 support for swap_control at the moment, since SwapBuffers
|
||||
* is done by the X server */
|
||||
if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) {
|
||||
psc->swapControl = (__DRIswapControlExtension *) extensions[i];
|
||||
__glXEnableDirectExtension(&psc->base, "GLX_SGI_swap_control");
|
||||
__glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control");
|
||||
}
|
||||
|
||||
if (strcmp(extensions[i]->name, __DRI_MEDIA_STREAM_COUNTER) == 0) {
|
||||
psc->msc = (__DRImediaStreamCounterExtension *) extensions[i];
|
||||
__glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
|
||||
}
|
||||
|
||||
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
|
||||
psc->driCopySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
|
||||
__glXEnableDirectExtension(&psc->base, "GLX_MESA_copy_sub_buffer");
|
||||
}
|
||||
|
||||
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
|
||||
__glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
|
||||
}
|
||||
/* Ignore unknown extensions */
|
||||
}
|
||||
}
|
||||
|
||||
static const struct glx_screen_vtable dri_screen_vtable = {
|
||||
.create_context = dri_create_context,
|
||||
.create_context_attribs = NULL,
|
||||
.query_renderer_integer = NULL,
|
||||
.query_renderer_string = NULL,
|
||||
.get_driver_name = dri_get_driver_name,
|
||||
};
|
||||
|
||||
static struct glx_screen *
|
||||
driCreateScreen(int screen, struct glx_display *priv)
|
||||
{
|
||||
struct dri_display *pdp;
|
||||
__GLXDRIscreen *psp;
|
||||
const __DRIextension **extensions;
|
||||
struct dri_screen *psc;
|
||||
char *driverName;
|
||||
int i;
|
||||
|
||||
psc = calloc(1, sizeof *psc);
|
||||
if (psc == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!glx_screen_init(&psc->base, screen, priv)) {
|
||||
free(psc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(driverName = dri_get_driver_name(&psc->base))) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
extensions = driOpenDriver(driverName, &psc->driver);
|
||||
if (extensions == NULL) {
|
||||
ErrorMessageF("driver exports no extensions (%s)\n", dlerror());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
if (strcmp(extensions[i]->name, __DRI_CORE) == 0)
|
||||
psc->core = (__DRIcoreExtension *) extensions[i];
|
||||
if (strcmp(extensions[i]->name, __DRI_LEGACY) == 0)
|
||||
psc->legacy = (__DRIlegacyExtension *) extensions[i];
|
||||
}
|
||||
|
||||
if (psc->core == NULL || psc->legacy == NULL)
|
||||
goto cleanup;
|
||||
|
||||
pdp = (struct dri_display *) priv->driDisplay;
|
||||
psc->driScreen =
|
||||
CallCreateNewScreen(psc->base.dpy, screen, psc, pdp);
|
||||
if (psc->driScreen == NULL)
|
||||
goto cleanup;
|
||||
|
||||
extensions = psc->core->getExtensions(psc->driScreen);
|
||||
driBindExtensions(psc, extensions);
|
||||
|
||||
psc->base.vtable = &dri_screen_vtable;
|
||||
psp = &psc->vtable;
|
||||
psc->base.driScreen = psp;
|
||||
if (psc->driCopySubBuffer)
|
||||
psp->copySubBuffer = driCopySubBuffer;
|
||||
|
||||
psp->destroyScreen = driDestroyScreen;
|
||||
psp->createDrawable = driCreateDrawable;
|
||||
psp->swapBuffers = driSwapBuffers;
|
||||
|
||||
psp->setSwapInterval = driSetSwapInterval;
|
||||
psp->getSwapInterval = driGetSwapInterval;
|
||||
|
||||
free(driverName);
|
||||
|
||||
return &psc->base;
|
||||
|
||||
cleanup:
|
||||
CriticalErrorMessageF("failed to load driver: %s\n", driverName);
|
||||
|
||||
free(driverName);
|
||||
|
||||
if (psc->driver)
|
||||
dlclose(psc->driver);
|
||||
glx_screen_cleanup(&psc->base);
|
||||
free(psc);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Called from __glXFreeDisplayPrivate.
|
||||
*/
|
||||
static void
|
||||
driDestroyDisplay(__GLXDRIdisplay * dpy)
|
||||
{
|
||||
free(dpy);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate, initialize and return a __DRIdisplayPrivate object.
|
||||
* This is called from __glXInitialize() when we are given a new
|
||||
* display pointer.
|
||||
*/
|
||||
_X_HIDDEN __GLXDRIdisplay *
|
||||
driCreateDisplay(Display * dpy)
|
||||
{
|
||||
struct dri_display *pdpyp;
|
||||
int eventBase, errorBase;
|
||||
int major, minor, patch;
|
||||
|
||||
if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!XF86DRIQueryVersion(dpy, &major, &minor, &patch)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pdpyp = malloc(sizeof *pdpyp);
|
||||
if (!pdpyp) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pdpyp->driMajor = major;
|
||||
pdpyp->driMinor = minor;
|
||||
pdpyp->driPatch = patch;
|
||||
|
||||
pdpyp->base.destroyDisplay = driDestroyDisplay;
|
||||
pdpyp->base.createScreen = driCreateScreen;
|
||||
|
||||
return &pdpyp->base;
|
||||
}
|
||||
|
||||
#endif /* GLX_DIRECT_RENDERING */
|
@ -1,92 +0,0 @@
|
||||
/**
|
||||
* \file dri_sarea.h
|
||||
* SAREA definitions.
|
||||
*
|
||||
* \author Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* \author Jens Owen <jowen@vmware.com>
|
||||
* \author Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* Copyright 2000 VA Linux Systems, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SAREA_H_
|
||||
#define _SAREA_H_
|
||||
|
||||
#include "xf86drm.h"
|
||||
|
||||
/* SAREA area needs to be at least a page */
|
||||
#if defined(__alpha__)
|
||||
#define SAREA_MAX 0x2000
|
||||
#elif defined(__ia64__)
|
||||
#define SAREA_MAX 0x10000 /* 64kB */
|
||||
#else
|
||||
/* Intel 830M driver needs at least 8k SAREA */
|
||||
#define SAREA_MAX 0x2000
|
||||
#endif
|
||||
|
||||
#define SAREA_MAX_DRAWABLES 256
|
||||
|
||||
#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
|
||||
|
||||
/**
|
||||
* SAREA per drawable information.
|
||||
*
|
||||
* \sa _XF86DRISAREA.
|
||||
*/
|
||||
typedef struct _XF86DRISAREADrawable {
|
||||
unsigned int stamp;
|
||||
unsigned int flags;
|
||||
} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
|
||||
|
||||
/**
|
||||
* SAREA frame information.
|
||||
*
|
||||
* \sa _XF86DRISAREA.
|
||||
*/
|
||||
typedef struct _XF86DRISAREAFrame {
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int fullscreen;
|
||||
} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
|
||||
|
||||
/**
|
||||
* SAREA definition.
|
||||
*/
|
||||
typedef struct _XF86DRISAREA {
|
||||
/** first thing is always the DRM locking structure */
|
||||
drmLock lock;
|
||||
/** \todo Use readers/writer lock for drawable_lock */
|
||||
drmLock drawable_lock;
|
||||
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
|
||||
XF86DRISAREAFrameRec frame;
|
||||
drm_context_t dummy_context;
|
||||
} XF86DRISAREARec, *XF86DRISAREAPtr;
|
||||
|
||||
#endif
|
@ -147,7 +147,6 @@ struct __GLXDRIdrawableRec
|
||||
** dependent methods.
|
||||
*/
|
||||
extern __GLXDRIdisplay *driswCreateDisplay(Display * dpy);
|
||||
extern __GLXDRIdisplay *driCreateDisplay(Display * dpy);
|
||||
extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy);
|
||||
extern __GLXDRIdisplay *dri3_create_display(Display * dpy);
|
||||
extern __GLXDRIdisplay *driwindowsCreateDisplay(Display * dpy);
|
||||
@ -608,7 +607,6 @@ struct glx_display
|
||||
* Per display direct rendering interface functions and data.
|
||||
*/
|
||||
__GLXDRIdisplay *driswDisplay;
|
||||
__GLXDRIdisplay *driDisplay;
|
||||
__GLXDRIdisplay *dri2Display;
|
||||
__GLXDRIdisplay *dri3Display;
|
||||
#endif
|
||||
|
@ -261,10 +261,6 @@ glx_display_free(struct glx_display *priv)
|
||||
priv->driswDisplay = NULL;
|
||||
|
||||
#if defined (GLX_USE_DRM)
|
||||
if (priv->driDisplay)
|
||||
(*priv->driDisplay->destroyDisplay) (priv->driDisplay);
|
||||
priv->driDisplay = NULL;
|
||||
|
||||
if (priv->dri2Display)
|
||||
(*priv->dri2Display->destroyDisplay) (priv->dri2Display);
|
||||
priv->dri2Display = NULL;
|
||||
@ -819,8 +815,6 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
|
||||
#endif /* HAVE_DRI3 */
|
||||
if (psc == NULL && priv->dri2Display)
|
||||
psc = (*priv->dri2Display->createScreen) (i, priv);
|
||||
if (psc == NULL && priv->driDisplay)
|
||||
psc = (*priv->driDisplay->createScreen) (i, priv);
|
||||
#endif /* GLX_USE_DRM */
|
||||
|
||||
#ifdef GLX_USE_WINDOWSGL
|
||||
@ -928,7 +922,6 @@ __glXInitialize(Display * dpy)
|
||||
#endif /* HAVE_DRI3 */
|
||||
if (!env_var_as_boolean("LIBGL_DRI2_DISABLE", false))
|
||||
dpyPriv->dri2Display = dri2CreateDisplay(dpy);
|
||||
dpyPriv->driDisplay = driCreateDisplay(dpy);
|
||||
}
|
||||
#endif /* GLX_USE_DRM */
|
||||
if (glx_direct)
|
||||
|
@ -84,11 +84,6 @@ if with_dri_platform == 'drm' and dep_libdrm.found()
|
||||
'dri2_glx.c',
|
||||
'dri2.h',
|
||||
'dri2_priv.h',
|
||||
'dri_glx.c',
|
||||
'dri_sarea.h',
|
||||
'XF86dri.c',
|
||||
'xf86dri.h',
|
||||
'xf86dristr.h',
|
||||
)
|
||||
endif
|
||||
|
||||
@ -158,7 +153,7 @@ libgl = shared_library(
|
||||
link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl],
|
||||
dependencies : [
|
||||
dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb,
|
||||
dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm,
|
||||
dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xxf86vm,
|
||||
dep_xcb_shm, extra_deps_libgl,
|
||||
],
|
||||
version : gl_lib_version,
|
||||
|
@ -1,124 +0,0 @@
|
||||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
Copyright 2000 VA Linux Systems, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/**
|
||||
* \file xf86dri.h
|
||||
* Protocol numbers and function prototypes for DRI X protocol.
|
||||
*
|
||||
* \author Kevin E. Martin <martin@valinux.com>
|
||||
* \author Jens Owen <jowen@vmware.com>
|
||||
* \author Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*/
|
||||
|
||||
#ifndef _XF86DRI_H_
|
||||
#define _XF86DRI_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <xf86drm.h>
|
||||
|
||||
#define X_XF86DRIQueryVersion 0
|
||||
#define X_XF86DRIQueryDirectRenderingCapable 1
|
||||
#define X_XF86DRIOpenConnection 2
|
||||
#define X_XF86DRICloseConnection 3
|
||||
#define X_XF86DRIGetClientDriverName 4
|
||||
#define X_XF86DRICreateContext 5
|
||||
#define X_XF86DRIDestroyContext 6
|
||||
#define X_XF86DRICreateDrawable 7
|
||||
#define X_XF86DRIDestroyDrawable 8
|
||||
#define X_XF86DRIGetDrawableInfo 9
|
||||
#define X_XF86DRIGetDeviceInfo 10
|
||||
#define X_XF86DRIAuthConnection 11
|
||||
#define X_XF86DRIOpenFullScreen 12 /* Deprecated */
|
||||
#define X_XF86DRICloseFullScreen 13 /* Deprecated */
|
||||
|
||||
#define XF86DRINumberEvents 0
|
||||
|
||||
#define XF86DRIClientNotLocal 0
|
||||
#define XF86DRIOperationNotSupported 1
|
||||
#define XF86DRINumberErrors (XF86DRIOperationNotSupported + 1)
|
||||
|
||||
#ifndef _XF86DRI_SERVER_
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
Bool XF86DRIQueryExtension(Display * dpy, int *event_base,
|
||||
int *error_base);
|
||||
|
||||
Bool XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion,
|
||||
int *patchVersion);
|
||||
|
||||
Bool XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen,
|
||||
Bool * isCapable);
|
||||
|
||||
Bool XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
|
||||
char **busIDString);
|
||||
|
||||
Bool XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic);
|
||||
|
||||
Bool XF86DRICloseConnection(Display * dpy, int screen);
|
||||
|
||||
Bool XF86DRIGetClientDriverName(Display * dpy, int screen,
|
||||
int *ddxDriverMajorVersion,
|
||||
int *ddxDriverMinorVersion,
|
||||
int *ddxDriverPatchVersion,
|
||||
char **clientDriverName);
|
||||
|
||||
Bool XF86DRICreateContext(Display * dpy, int screen, Visual * visual,
|
||||
XID * ptr_to_returned_context_id,
|
||||
drm_context_t * hHWContext);
|
||||
|
||||
Bool XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID,
|
||||
XID * ptr_to_returned_context_id,
|
||||
drm_context_t * hHWContext);
|
||||
|
||||
extern Bool XF86DRIDestroyContext(Display * dpy, int screen, XID context_id);
|
||||
|
||||
extern Bool XF86DRICreateDrawable(Display * dpy, int screen,
|
||||
XID drawable, drm_drawable_t * hHWDrawable);
|
||||
|
||||
extern Bool XF86DRIDestroyDrawable(Display * dpy, int screen, XID drawable);
|
||||
|
||||
Bool XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
|
||||
unsigned int *index, unsigned int *stamp,
|
||||
int *X, int *Y, int *W, int *H,
|
||||
int *numClipRects, drm_clip_rect_t ** pClipRects,
|
||||
int *backX, int *backY,
|
||||
int *numBackClipRects,
|
||||
drm_clip_rect_t ** pBackClipRects);
|
||||
|
||||
Bool XF86DRIGetDeviceInfo(Display * dpy, int screen,
|
||||
drm_handle_t * hFrameBuffer, int *fbOrigin,
|
||||
int *fbSize, int *fbStride, int *devPrivateSize,
|
||||
void **pDevPrivate);
|
||||
|
||||
Bool XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable);
|
||||
|
||||
Bool XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
#endif /* _XF86DRI_SERVER_ */
|
||||
#endif /* _XF86DRI_H_ */
|
@ -1,367 +0,0 @@
|
||||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
Copyright 2000 VA Linux Systems, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Kevin E. Martin <martin@valinux.com>
|
||||
* Jens Owen <jowen@vmware.com>
|
||||
* Rickard E. (Rik) Fiath <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _XF86DRISTR_H_
|
||||
#define _XF86DRISTR_H_
|
||||
|
||||
#include "xf86dri.h"
|
||||
|
||||
#define XF86DRINAME "XFree86-DRI"
|
||||
|
||||
/* The DRI version number. This was originally set to be the same of the
|
||||
* XFree86 version number. However, this version is really indepedent of
|
||||
* the XFree86 version.
|
||||
*
|
||||
* Version History:
|
||||
* 4.0.0: Original
|
||||
* 4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02
|
||||
* 4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02
|
||||
*/
|
||||
#define XF86DRI_MAJOR_VERSION 4
|
||||
#define XF86DRI_MINOR_VERSION 1
|
||||
#define XF86DRI_PATCH_VERSION 0
|
||||
|
||||
typedef struct _XF86DRIQueryVersion
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIQueryVersion */
|
||||
CARD16 length B16;
|
||||
} xXF86DRIQueryVersionReq;
|
||||
#define sz_xXF86DRIQueryVersionReq 4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD16 majorVersion B16; /* major version of DRI protocol */
|
||||
CARD16 minorVersion B16; /* minor version of DRI protocol */
|
||||
CARD32 patchVersion B32; /* patch version of DRI protocol */
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xXF86DRIQueryVersionReply;
|
||||
#define sz_xXF86DRIQueryVersionReply 32
|
||||
|
||||
typedef struct _XF86DRIQueryDirectRenderingCapable
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
} xXF86DRIQueryDirectRenderingCapableReq;
|
||||
#define sz_xXF86DRIQueryDirectRenderingCapableReq 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
BOOL isCapable;
|
||||
BOOL pad2;
|
||||
BOOL pad3;
|
||||
BOOL pad4;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
CARD32 pad7 B32;
|
||||
CARD32 pad8 B32;
|
||||
CARD32 pad9 B32;
|
||||
} xXF86DRIQueryDirectRenderingCapableReply;
|
||||
#define sz_xXF86DRIQueryDirectRenderingCapableReply 32
|
||||
|
||||
typedef struct _XF86DRIOpenConnection
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIOpenConnection */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
} xXF86DRIOpenConnectionReq;
|
||||
#define sz_xXF86DRIOpenConnectionReq 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 hSAREALow B32;
|
||||
CARD32 hSAREAHigh B32;
|
||||
CARD32 busIdStringLength B32;
|
||||
CARD32 pad6 B32;
|
||||
CARD32 pad7 B32;
|
||||
CARD32 pad8 B32;
|
||||
} xXF86DRIOpenConnectionReply;
|
||||
#define sz_xXF86DRIOpenConnectionReply 32
|
||||
|
||||
typedef struct _XF86DRIAuthConnection
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRICloseConnection */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 magic B32;
|
||||
} xXF86DRIAuthConnectionReq;
|
||||
#define sz_xXF86DRIAuthConnectionReq 12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type;
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 authenticated B32;
|
||||
CARD32 pad2 B32;
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xXF86DRIAuthConnectionReply;
|
||||
#define zx_xXF86DRIAuthConnectionReply 32
|
||||
|
||||
typedef struct _XF86DRICloseConnection
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRICloseConnection */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
} xXF86DRICloseConnectionReq;
|
||||
#define sz_xXF86DRICloseConnectionReq 8
|
||||
|
||||
typedef struct _XF86DRIGetClientDriverName
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIGetClientDriverName */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
} xXF86DRIGetClientDriverNameReq;
|
||||
#define sz_xXF86DRIGetClientDriverNameReq 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 ddxDriverMajorVersion B32;
|
||||
CARD32 ddxDriverMinorVersion B32;
|
||||
CARD32 ddxDriverPatchVersion B32;
|
||||
CARD32 clientDriverNameLength B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xXF86DRIGetClientDriverNameReply;
|
||||
#define sz_xXF86DRIGetClientDriverNameReply 32
|
||||
|
||||
typedef struct _XF86DRICreateContext
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRICreateContext */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 visual B32;
|
||||
CARD32 context B32;
|
||||
} xXF86DRICreateContextReq;
|
||||
#define sz_xXF86DRICreateContextReq 16
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 hHWContext B32;
|
||||
CARD32 pad2 B32;
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xXF86DRICreateContextReply;
|
||||
#define sz_xXF86DRICreateContextReply 32
|
||||
|
||||
typedef struct _XF86DRIDestroyContext
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIDestroyContext */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 context B32;
|
||||
} xXF86DRIDestroyContextReq;
|
||||
#define sz_xXF86DRIDestroyContextReq 12
|
||||
|
||||
typedef struct _XF86DRICreateDrawable
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRICreateDrawable */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 drawable B32;
|
||||
} xXF86DRICreateDrawableReq;
|
||||
#define sz_xXF86DRICreateDrawableReq 12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 hHWDrawable B32;
|
||||
CARD32 pad2 B32;
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xXF86DRICreateDrawableReply;
|
||||
#define sz_xXF86DRICreateDrawableReply 32
|
||||
|
||||
typedef struct _XF86DRIDestroyDrawable
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIDestroyDrawable */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 drawable B32;
|
||||
} xXF86DRIDestroyDrawableReq;
|
||||
#define sz_xXF86DRIDestroyDrawableReq 12
|
||||
|
||||
typedef struct _XF86DRIGetDrawableInfo
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIGetDrawableInfo */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 drawable B32;
|
||||
} xXF86DRIGetDrawableInfoReq;
|
||||
#define sz_xXF86DRIGetDrawableInfoReq 12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 drawableTableIndex B32;
|
||||
CARD32 drawableTableStamp B32;
|
||||
INT16 drawableX B16;
|
||||
INT16 drawableY B16;
|
||||
INT16 drawableWidth B16;
|
||||
INT16 drawableHeight B16;
|
||||
CARD32 numClipRects B32;
|
||||
INT16 backX B16;
|
||||
INT16 backY B16;
|
||||
CARD32 numBackClipRects B32;
|
||||
} xXF86DRIGetDrawableInfoReply;
|
||||
|
||||
#define sz_xXF86DRIGetDrawableInfoReply 36
|
||||
|
||||
|
||||
typedef struct _XF86DRIGetDeviceInfo
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIGetDeviceInfo */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
} xXF86DRIGetDeviceInfoReq;
|
||||
#define sz_xXF86DRIGetDeviceInfoReq 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type; /* X_Reply */
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 hFrameBufferLow B32;
|
||||
CARD32 hFrameBufferHigh B32;
|
||||
CARD32 framebufferOrigin B32;
|
||||
CARD32 framebufferSize B32;
|
||||
CARD32 framebufferStride B32;
|
||||
CARD32 devPrivateSize B32;
|
||||
} xXF86DRIGetDeviceInfoReply;
|
||||
#define sz_xXF86DRIGetDeviceInfoReply 32
|
||||
|
||||
typedef struct _XF86DRIOpenFullScreen
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRIOpenFullScreen */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 drawable B32;
|
||||
} xXF86DRIOpenFullScreenReq;
|
||||
#define sz_xXF86DRIOpenFullScreenReq 12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type;
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 isFullScreen B32;
|
||||
CARD32 pad2 B32;
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
} xXF86DRIOpenFullScreenReply;
|
||||
#define sz_xXF86DRIOpenFullScreenReply 32
|
||||
|
||||
typedef struct _XF86DRICloseFullScreen
|
||||
{
|
||||
CARD8 reqType; /* always DRIReqCode */
|
||||
CARD8 driReqType; /* always X_DRICloseFullScreen */
|
||||
CARD16 length B16;
|
||||
CARD32 screen B32;
|
||||
CARD32 drawable B32;
|
||||
} xXF86DRICloseFullScreenReq;
|
||||
#define sz_xXF86DRICloseFullScreenReq 12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTE type;
|
||||
BOOL pad1;
|
||||
CARD16 sequenceNumber B16;
|
||||
CARD32 length B32;
|
||||
CARD32 pad2 B32;
|
||||
CARD32 pad3 B32;
|
||||
CARD32 pad4 B32;
|
||||
CARD32 pad5 B32;
|
||||
CARD32 pad6 B32;
|
||||
CARD32 pad7 B32;
|
||||
} xXF86DRICloseFullScreenReply;
|
||||
#define sz_xXF86DRICloseFullScreenReply 32
|
||||
|
||||
|
||||
#endif /* _XF86DRISTR_H_ */
|
Loading…
Reference in New Issue
Block a user