[Mesa-dev] [PATCH 1/3] vl: cleanup dri winsys abstraction
Christian König
deathsimple at vodafone.de
Tue Feb 21 02:36:02 PST 2012
There was way to much dead code in it.
Signed-off-by: Christian König <deathsimple at vodafone.de>
---
src/gallium/winsys/g3dvl/dri/Makefile | 2 -
src/gallium/winsys/g3dvl/dri/XF86dri.c | 591 -----------------------------
src/gallium/winsys/g3dvl/dri/dri_winsys.c | 96 +++--
src/gallium/winsys/g3dvl/dri/driclient.c | 388 -------------------
src/gallium/winsys/g3dvl/dri/driclient.h | 93 -----
src/gallium/winsys/g3dvl/dri/xf86dri.h | 119 ------
src/gallium/winsys/g3dvl/dri/xf86dristr.h | 342 -----------------
7 files changed, 56 insertions(+), 1575 deletions(-)
delete mode 100644 src/gallium/winsys/g3dvl/dri/XF86dri.c
delete mode 100644 src/gallium/winsys/g3dvl/dri/driclient.c
delete mode 100644 src/gallium/winsys/g3dvl/dri/driclient.h
delete mode 100644 src/gallium/winsys/g3dvl/dri/xf86dri.h
delete mode 100644 src/gallium/winsys/g3dvl/dri/xf86dristr.h
diff --git a/src/gallium/winsys/g3dvl/dri/Makefile b/src/gallium/winsys/g3dvl/dri/Makefile
index 572571d..7a9b38f 100644
--- a/src/gallium/winsys/g3dvl/dri/Makefile
+++ b/src/gallium/winsys/g3dvl/dri/Makefile
@@ -7,8 +7,6 @@ LIBRARY_INCLUDES = -I$(TOP)/src/gallium/winsys/g3dvl \
$(shell $(PKG_CONFIG) libdrm --cflags-only-I)
C_SOURCES = \
- driclient.c \
- XF86dri.c \
dri2.c \
dri_winsys.c
diff --git a/src/gallium/winsys/g3dvl/dri/XF86dri.c b/src/gallium/winsys/g3dvl/dri/XF86dri.c
deleted file mode 100644
index 648f9af..0000000
--- a/src/gallium/winsys/g3dvl/dri/XF86dri.c
+++ /dev/null
@@ -1,591 +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 at valinux.com>
- * Jens Owen <jens at tungstengraphics.com>
- * Rickard E. (Rik) Faith <faith at valinux.com>
- *
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#include <X11/Xlibint.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include "xf86dristr.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
-
-#define PUBLIC
-
-PUBLIC Bool XF86DRIQueryExtension (dpy, event_basep, error_basep)
- Display *dpy;
- int *event_basep, *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;
- }
-}
-
-PUBLIC Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
- 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;
-}
-
-PUBLIC Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
- 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;
-}
-
-PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
- 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 (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) {
- _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;
-}
-
-PUBLIC Bool XF86DRIAuthConnection(dpy, screen, magic)
- 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;
-}
-
-PUBLIC Bool XF86DRICloseConnection(dpy, screen)
- 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;
-}
-
-PUBLIC Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
- ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
- 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 (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) {
- _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;
-}
-
-PUBLIC Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
- hHWContext)
- 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;
-}
-
-PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
- Display* dpy;
- int screen;
- Visual* visual;
- XID* context;
- drm_context_t * hHWContext;
-{
- return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
- context, hHWContext );
-}
-
-PUBLIC Bool XF86DRIDestroyContext( Display * ndpy, int screen,
- XID context )
-{
- Display * const dpy = (Display *) ndpy;
- 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;
-}
-
-PUBLIC Bool XF86DRICreateDrawable( Display * ndpy, int screen,
- Drawable drawable, drm_drawable_t * hHWDrawable )
-{
- Display * const dpy = (Display *) ndpy;
- 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;
-}
-
-PUBLIC Bool XF86DRIDestroyDrawable( Display * ndpy, int screen,
- Drawable drawable )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xXF86DRIDestroyDrawableReq *req;
-
- TRACE("DestroyDrawable...");
- XF86DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DRIDestroyDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_XF86DRIDestroyDrawable;
- req->screen = screen;
- req->drawable = drawable;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("DestroyDrawable... return True");
- return True;
-}
-
-PUBLIC 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 = (drm_clip_rect_t *)Xcalloc(len, 1);
- if (*pClipRects)
- _XRead(dpy, (char*)*pClipRects, len);
- } else {
- *pClipRects = NULL;
- }
-
- if (*numBackClipRects) {
- int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
-
- *pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
- if (*pBackClipRects)
- _XRead(dpy, (char*)*pBackClipRects, len);
- } else {
- *pBackClipRects = NULL;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("GetDrawableInfo... return True");
- return True;
-}
-
-PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
- fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate)
- 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 = (void *)Xcalloc(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;
-}
diff --git a/src/gallium/winsys/g3dvl/dri/dri_winsys.c b/src/gallium/winsys/g3dvl/dri/dri_winsys.c
index aef88f2..1875d49 100644
--- a/src/gallium/winsys/g3dvl/dri/dri_winsys.c
+++ b/src/gallium/winsys/g3dvl/dri/dri_winsys.c
@@ -25,37 +25,40 @@
*
**************************************************************************/
-#include "vl_winsys.h"
-#include "driclient.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/dri2tokens.h>
+#include <xf86drm.h>
+
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"
+#include "state_tracker/drm_driver.h"
+
#include "util/u_memory.h"
#include "util/u_hash.h"
#include "util/u_hash_table.h"
#include "util/u_inlines.h"
-#include "state_tracker/drm_driver.h"
-#include <X11/Xlibint.h>
+
+#include "vl_winsys.h"
+#include "dri2.h"
struct vl_dri_screen
{
struct vl_screen base;
- dri_screen_t *dri_screen;
+ Display *display;
struct util_hash_table *drawable_table;
Drawable last_seen_drawable;
};
-struct vl_dri_context
-{
- struct vl_context base;
- int fd;
-};
-
static struct pipe_surface*
vl_dri2_get_front(struct vl_context *vctx, Drawable drawable)
{
int w, h;
- unsigned int attachments[1] = {DRI_BUFFER_FRONT_LEFT};
+ unsigned int attachments[1] = {DRI2BufferFrontLeft};
int count;
DRI2Buffer *dri2_front;
struct pipe_resource *front_tex;
@@ -66,8 +69,8 @@ vl_dri2_get_front(struct vl_context *vctx, Drawable drawable)
struct vl_dri_screen *vl_dri_scrn = (struct vl_dri_screen*)vctx->vscreen;
assert(vl_dri_scrn);
- dri2_front = DRI2GetBuffers(vl_dri_scrn->dri_screen->display,
- drawable, &w, &h, attachments, 1, &count);
+ dri2_front = DRI2GetBuffers(vl_dri_scrn->display, drawable, &w, &h,
+ attachments, 1, &count);
assert(count == 1);
@@ -112,15 +115,18 @@ vl_dri2_flush_frontbuffer(struct pipe_screen *screen,
unsigned level, unsigned layer,
void *context_private)
{
- struct vl_dri_context *vl_dri_ctx = (struct vl_dri_context*)context_private;
- struct vl_dri_screen *vl_dri_scrn = (struct vl_dri_screen*)vl_dri_ctx->base.vscreen;
+ struct vl_context *vl_dri_ctx = (struct vl_context*)context_private;
+ struct vl_dri_screen *vl_dri_scrn = (struct vl_dri_screen*)vl_dri_ctx->vscreen;
+ XserverRegion region;
assert(screen);
assert(resource);
assert(context_private);
- dri2CopyDrawable(vl_dri_scrn->dri_screen, vl_dri_scrn->last_seen_drawable,
- DRI_BUFFER_FRONT_LEFT, DRI_BUFFER_FAKE_FRONT_LEFT);
+ region = XFixesCreateRegionFromWindow(vl_dri_scrn->display, vl_dri_scrn->last_seen_drawable, WindowRegionBounding);
+ DRI2CopyRegion(vl_dri_scrn->display, vl_dri_scrn->last_seen_drawable, region,
+ DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
+ XFixesDestroyRegion(vl_dri_scrn->display, region);
}
struct pipe_surface*
@@ -136,7 +142,7 @@ vl_drawable_surface_get(struct vl_context *vctx, Drawable drawable)
assert(None == NULL);
Drawable lookup_drawable = (Drawable)util_hash_table_get(vl_dri_scrn->drawable_table, (void*)drawable);
if (lookup_drawable == None) {
- dri2CreateDrawable(vl_dri_scrn->dri_screen, drawable);
+ DRI2CreateDrawable(vl_dri_scrn->display, drawable);
util_hash_table_set(vl_dri_scrn->drawable_table, (void*)drawable, (void*)drawable);
}
vl_dri_scrn->last_seen_drawable = drawable;
@@ -171,6 +177,10 @@ struct vl_screen*
vl_screen_create(Display *display, int screen)
{
struct vl_dri_screen *vl_dri_scrn;
+ drm_magic_t magic;
+ char *drvName;
+ char *devName;
+ int fd;
assert(display);
@@ -178,13 +188,27 @@ vl_screen_create(Display *display, int screen)
if (!vl_dri_scrn)
goto no_struct;
- if (dri2CreateScreen(display, screen, &vl_dri_scrn->dri_screen))
- goto no_dri2screen;
+ vl_dri_scrn->display = display;
+ if (!DRI2Connect(display, XRootWindow(display, screen), &drvName, &devName))
+ goto free_screen;
+
+ fd = open(devName, O_RDWR);
+ Xfree(drvName);
+ Xfree(devName);
+
+ if (fd < 0)
+ goto free_screen;
+
+ if (drmGetMagic(fd, &magic))
+ goto free_screen;
- vl_dri_scrn->base.pscreen = driver_descriptor.create_screen(vl_dri_scrn->dri_screen->fd);
+ if (!DRI2Authenticate(display, RootWindow(display, screen), magic))
+ goto free_screen;
+
+ vl_dri_scrn->base.pscreen = driver_descriptor.create_screen(fd);
if (!vl_dri_scrn->base.pscreen)
- goto no_pscreen;
+ goto free_screen;
vl_dri_scrn->drawable_table = util_hash_table_create(&drawable_hash, &drawable_cmp);
if (!vl_dri_scrn->drawable_table)
@@ -197,9 +221,7 @@ vl_screen_create(Display *display, int screen)
no_hash:
vl_dri_scrn->base.pscreen->destroy(vl_dri_scrn->base.pscreen);
-no_pscreen:
- dri2DestroyScreen(vl_dri_scrn->dri_screen);
-no_dri2screen:
+free_screen:
FREE(vl_dri_scrn);
no_struct:
return NULL;
@@ -213,32 +235,28 @@ void vl_screen_destroy(struct vl_screen *vscreen)
util_hash_table_destroy(vl_dri_scrn->drawable_table);
vl_dri_scrn->base.pscreen->destroy(vl_dri_scrn->base.pscreen);
- dri2DestroyScreen(vl_dri_scrn->dri_screen);
FREE(vl_dri_scrn);
}
struct vl_context*
vl_video_create(struct vl_screen *vscreen)
{
- struct vl_dri_screen *vl_dri_scrn = (struct vl_dri_screen*)vscreen;
- struct vl_dri_context *vl_dri_ctx;
+ struct vl_context *vl_dri_ctx;
- vl_dri_ctx = CALLOC_STRUCT(vl_dri_context);
+ vl_dri_ctx = CALLOC_STRUCT(vl_context);
if (!vl_dri_ctx)
goto no_struct;
- vl_dri_ctx->base.pipe = vscreen->pscreen->context_create(vscreen->pscreen, vl_dri_ctx);
- if (!vl_dri_ctx->base.pipe) {
+ vl_dri_ctx->vscreen = vscreen;
+ vl_dri_ctx->pipe = vscreen->pscreen->context_create(vscreen->pscreen, vl_dri_ctx);
+ if (!vl_dri_ctx->pipe) {
debug_printf("[G3DVL] No video support found on %s/%s.\n",
vscreen->pscreen->get_vendor(vscreen->pscreen),
vscreen->pscreen->get_name(vscreen->pscreen));
goto no_pipe;
}
- vl_dri_ctx->base.vscreen = vscreen;
- vl_dri_ctx->fd = vl_dri_scrn->dri_screen->fd;
-
- return &vl_dri_ctx->base;
+ return vl_dri_ctx;
no_pipe:
FREE(vl_dri_ctx);
@@ -249,10 +267,8 @@ no_struct:
void vl_video_destroy(struct vl_context *vctx)
{
- struct vl_dri_context *vl_dri_ctx = (struct vl_dri_context*)vctx;
-
assert(vctx);
- vl_dri_ctx->base.pipe->destroy(vl_dri_ctx->base.pipe);
- FREE(vl_dri_ctx);
+ vctx->pipe->destroy(vctx->pipe);
+ FREE(vctx);
}
diff --git a/src/gallium/winsys/g3dvl/dri/driclient.c b/src/gallium/winsys/g3dvl/dri/driclient.c
deleted file mode 100644
index 90e48a7..0000000
--- a/src/gallium/winsys/g3dvl/dri/driclient.c
+++ /dev/null
@@ -1,388 +0,0 @@
-#include "driclient.h"
-#include <assert.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <X11/Xlibint.h>
-
-int driCreateScreen(Display *display, int screen, dri_screen_t **dri_screen, dri_framebuffer_t *dri_framebuf)
-{
- int evbase, errbase;
- char *driver_name;
- int newly_opened;
- drm_magic_t magic;
- drmVersionPtr drm_version;
- drm_handle_t sarea_handle;
- char *bus_id;
- dri_screen_t *dri_scrn;
-
- assert(display);
- assert(dri_screen);
-
- if (!XF86DRIQueryExtension(display, &evbase, &errbase))
- return 1;
-
- dri_scrn = calloc(1, sizeof(dri_screen_t));
-
- if (!dri_scrn)
- return 1;
-
- if (!XF86DRIQueryVersion(display, &dri_scrn->dri.major, &dri_scrn->dri.minor, &dri_scrn->dri.patch))
- goto free_screen;
-
- dri_scrn->display = display;
- dri_scrn->num = screen;
- dri_scrn->draw_lock_id = 1;
-
- if (!XF86DRIOpenConnection(display, screen, &sarea_handle, &bus_id))
- goto free_screen;
-
- dri_scrn->fd = -1;
- dri_scrn->fd = drmOpenOnce(NULL, bus_id, &newly_opened);
- XFree(bus_id);
-
- if (dri_scrn->fd < 0)
- goto close_connection;
-
- if (drmGetMagic(dri_scrn->fd, &magic))
- goto close_drm;
-
- drm_version = drmGetVersion(dri_scrn->fd);
-
- if (!drm_version)
- goto close_drm;
-
- dri_scrn->drm.major = drm_version->version_major;
- dri_scrn->drm.minor = drm_version->version_minor;
- dri_scrn->drm.patch = drm_version->version_patchlevel;
- drmFreeVersion(drm_version);
-
- if (!XF86DRIAuthConnection(display, screen, magic))
- goto close_drm;
-
- if (!XF86DRIGetClientDriverName
- (
- display,
- screen,
- &dri_scrn->ddx.major,
- &dri_scrn->ddx.minor,
- &dri_scrn->ddx.patch,
- &driver_name
- ))
- goto close_drm;
-
- if (drmMap(dri_scrn->fd, sarea_handle, SAREA_MAX, (drmAddress)&dri_scrn->sarea))
- goto close_drm;
-
- dri_scrn->drawable_hash = drmHashCreate();
-
- if (!dri_scrn->drawable_hash)
- goto unmap_sarea;
-
- if (dri_framebuf)
- {
- if (!XF86DRIGetDeviceInfo
- (
- display,
- screen, &dri_framebuf->drm_handle,
- &dri_framebuf->base,
- &dri_framebuf->size,
- &dri_framebuf->stride,
- &dri_framebuf->private_size,
- &dri_framebuf->private
- ))
- goto destroy_hash;
- }
-
- *dri_screen = dri_scrn;
-
- return 0;
-
-destroy_hash:
- drmHashDestroy(dri_scrn->drawable_hash);
-unmap_sarea:
- drmUnmap(dri_scrn->sarea, SAREA_MAX);
-close_drm:
- drmCloseOnce(dri_scrn->fd);
-close_connection:
- XF86DRICloseConnection(display, screen);
-free_screen:
- free(dri_scrn);
-
- return 1;
-}
-
-int driDestroyScreen(dri_screen_t *dri_screen)
-{
- Drawable draw;
- dri_drawable_t *dri_draw;
-
- assert(dri_screen);
-
- if (drmHashFirst(dri_screen->drawable_hash, &draw, (void**)&dri_draw))
- {
- dri_draw->refcount = 1;
- driDestroyDrawable(dri_draw);
-
- while (drmHashNext(dri_screen->drawable_hash, &draw, (void**)&dri_draw))
- {
- dri_draw->refcount = 1;
- driDestroyDrawable(dri_draw);
- }
- }
-
- drmHashDestroy(dri_screen->drawable_hash);
- drmUnmap(dri_screen->sarea, SAREA_MAX);
- drmCloseOnce(dri_screen->fd);
- XF86DRICloseConnection(dri_screen->display, dri_screen->num);
- free(dri_screen);
-
- return 0;
-}
-
-int driCreateDrawable(dri_screen_t *dri_screen, Drawable drawable, dri_drawable_t **dri_drawable)
-{
- int evbase, errbase;
- dri_drawable_t *dri_draw;
-
- assert(dri_screen);
- assert(dri_drawable);
-
- if (!XF86DRIQueryExtension(dri_screen->display, &evbase, &errbase))
- return 1;
-
- if (!drmHashLookup(dri_screen->drawable_hash, drawable, (void**)dri_drawable))
- {
- /* Found */
- (*dri_drawable)->refcount++;
- return 0;
- }
-
- dri_draw = calloc(1, sizeof(dri_drawable_t));
-
- if (!dri_draw)
- return 1;
-
- if (!XF86DRICreateDrawable(dri_screen->display, 0, drawable, &dri_draw->drm_drawable))
- {
- free(dri_draw);
- return 1;
- }
-
- dri_draw->x_drawable = drawable;
- dri_draw->sarea_index = 0;
- dri_draw->sarea_stamp = NULL;
- dri_draw->last_sarea_stamp = 0;
- dri_draw->dri_screen = dri_screen;
- dri_draw->refcount = 1;
-
- if (drmHashInsert(dri_screen->drawable_hash, drawable, dri_draw))
- {
- XF86DRIDestroyDrawable(dri_screen->display, dri_screen->num, drawable);
- free(dri_draw);
- return 1;
- }
-
- if (!dri_draw->sarea_stamp || *dri_draw->sarea_stamp != dri_draw->last_sarea_stamp)
- {
- DRM_SPINLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);
-
- if (driUpdateDrawableInfo(dri_draw))
- {
- XF86DRIDestroyDrawable(dri_screen->display, dri_screen->num, drawable);
- free(dri_draw);
- DRM_SPINUNLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);
- return 1;
- }
-
- DRM_SPINUNLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);
- }
-
- *dri_drawable = dri_draw;
-
- return 0;
-}
-
-int driUpdateDrawableInfo(dri_drawable_t *dri_drawable)
-{
- assert(dri_drawable);
-
- if (dri_drawable->cliprects)
- {
- XFree(dri_drawable->cliprects);
- dri_drawable->cliprects = NULL;
- }
- if (dri_drawable->back_cliprects)
- {
- XFree(dri_drawable->back_cliprects);
- dri_drawable->back_cliprects = NULL;
- }
-
- DRM_SPINUNLOCK(&dri_drawable->dri_screen->sarea->drawable_lock, dri_drawable->dri_screen->draw_lock_id);
-
- if (!XF86DRIGetDrawableInfo
- (
- dri_drawable->dri_screen->display,
- dri_drawable->dri_screen->num,
- dri_drawable->x_drawable,
- &dri_drawable->sarea_index,
- &dri_drawable->last_sarea_stamp,
- &dri_drawable->x,
- &dri_drawable->y,
- &dri_drawable->w,
- &dri_drawable->h,
- &dri_drawable->num_cliprects,
- &dri_drawable->cliprects,
- &dri_drawable->back_x,
- &dri_drawable->back_y,
- &dri_drawable->num_back_cliprects,
- &dri_drawable->back_cliprects
- ))
- {
- dri_drawable->sarea_stamp = &dri_drawable->last_sarea_stamp;
- dri_drawable->num_cliprects = 0;
- dri_drawable->cliprects = NULL;
- dri_drawable->num_back_cliprects = 0;
- dri_drawable->back_cliprects = 0;
-
- return 1;
- }
- else
- dri_drawable->sarea_stamp = &dri_drawable->dri_screen->sarea->drawableTable[dri_drawable->sarea_index].stamp;
-
- DRM_SPINLOCK(&dri_drawable->dri_screen->sarea->drawable_lock, dri_drawable->dri_screen->draw_lock_id);
-
- return 0;
-}
-
-int driDestroyDrawable(dri_drawable_t *dri_drawable)
-{
- assert(dri_drawable);
-
- if (--dri_drawable->refcount == 0)
- {
- if (dri_drawable->cliprects)
- XFree(dri_drawable->cliprects);
- if (dri_drawable->back_cliprects)
- XFree(dri_drawable->back_cliprects);
- drmHashDelete(dri_drawable->dri_screen->drawable_hash, dri_drawable->x_drawable);
- XF86DRIDestroyDrawable(dri_drawable->dri_screen->display, dri_drawable->dri_screen->num, dri_drawable->x_drawable);
- free(dri_drawable);
- }
-
- return 0;
-}
-
-int driCreateContext(dri_screen_t *dri_screen, Visual *visual, dri_context_t **dri_context)
-{
- int evbase, errbase;
- dri_context_t *dri_ctx;
-
- assert(dri_screen);
- assert(visual);
- assert(dri_context);
-
- if (!XF86DRIQueryExtension(dri_screen->display, &evbase, &errbase))
- return 1;
-
- dri_ctx = calloc(1, sizeof(dri_context_t));
-
- if (!dri_ctx)
- return 1;
-
- if (!XF86DRICreateContext(dri_screen->display, dri_screen->num, visual, &dri_ctx->id, &dri_ctx->drm_context))
- {
- free(dri_ctx);
- return 1;
- }
-
- dri_ctx->dri_screen = dri_screen;
- *dri_context = dri_ctx;
-
- return 0;
-}
-
-int driDestroyContext(dri_context_t *dri_context)
-{
- assert(dri_context);
-
- XF86DRIDestroyContext(dri_context->dri_screen->display, dri_context->dri_screen->num, dri_context->id);
- free(dri_context);
-
- return 0;
-}
-
-int dri2CreateScreen(Display *display, int screen, dri_screen_t **dri_screen)
-{
- dri_screen_t *dri_scrn;
- drm_magic_t magic;
- char *drvName;
- char *devName;
-
- dri_scrn = calloc(1, sizeof(dri_screen_t));
-
- if (!dri_scrn)
- return 1;
-
- if (!DRI2Connect(display, XRootWindow(display, screen), &drvName, &devName))
- goto free_screen;
-
- dri_scrn->fd = open(devName, O_RDWR);
- Xfree(drvName);
- Xfree(devName);
- if (dri_scrn->fd < 0)
- goto free_screen;
-
- if (drmGetMagic(dri_scrn->fd, &magic))
- goto free_screen;
-
- if (!DRI2Authenticate(display, RootWindow(display, screen), magic))
- goto free_screen;
-
- dri_scrn->display = display;
- dri_scrn->num = screen;
- *dri_screen = dri_scrn;
-
- return 0;
-
-free_screen:
- free(dri_scrn);
-
- return 1;
-}
-
-int dri2DestroyScreen(dri_screen_t *dri_screen)
-{
- /* Not much to do here apparently... */
- assert(dri_screen);
- free(dri_screen);
- return 0;
-}
-
-int dri2CreateDrawable(dri_screen_t *dri_screen, XID drawable)
-{
- assert(dri_screen);
- DRI2CreateDrawable(dri_screen->display, drawable);
- return 0;
-}
-
-int dri2DestroyDrawable(dri_screen_t *dri_screen, XID drawable)
-{
- assert(dri_screen);
- DRI2DestroyDrawable(dri_screen->display, drawable);
- return 0;
-}
-
-int dri2CopyDrawable(dri_screen_t *dri_screen, XID drawable, int dest, int src)
-{
- XserverRegion region;
-
- assert(dri_screen);
- assert(dest >= DRI_BUFFER_FRONT_LEFT && dest <= DRI_BUFFER_DEPTH_STENCIL);
- assert(src >= DRI_BUFFER_FRONT_LEFT && src <= DRI_BUFFER_DEPTH_STENCIL);
-
- region = XFixesCreateRegionFromWindow(dri_screen->display, drawable, WindowRegionBounding);
- DRI2CopyRegion(dri_screen->display, drawable, region, dest, src);
- XFixesDestroyRegion(dri_screen->display, region);
-
- return 0;
-}
diff --git a/src/gallium/winsys/g3dvl/dri/driclient.h b/src/gallium/winsys/g3dvl/dri/driclient.h
deleted file mode 100644
index 271fd11..0000000
--- a/src/gallium/winsys/g3dvl/dri/driclient.h
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef driclient_h
-#define driclient_h
-
-#include <stdint.h>
-#include <X11/Xmd.h>
-#include <X11/Xlib.h>
-#include <drm_sarea.h>
-//#include <X11/extensions/dri2proto.h>
-#include "xf86dri.h"
-#include "dri2.h"
-
-/* TODO: Bring in DRI XML options */
-
-typedef struct dri_version
-{
- int major;
- int minor;
- int patch;
-} dri_version_t;
-
-typedef struct dri_screen
-{
- Display *display;
- unsigned int num;
- dri_version_t ddx, dri, drm;
- int draw_lock_id;
- int fd;
- drm_sarea_t *sarea;
- void *drawable_hash;
- void *private;
-} dri_screen_t;
-
-struct dri_context;
-
-typedef struct dri_drawable
-{
- drm_drawable_t drm_drawable;
- Drawable x_drawable;
- unsigned int sarea_index;
- unsigned int *sarea_stamp;
- unsigned int last_sarea_stamp;
- int x, y, w, h;
- int back_x, back_y;
- int num_cliprects, num_back_cliprects;
- drm_clip_rect_t *cliprects, *back_cliprects;
- dri_screen_t *dri_screen;
- unsigned int refcount;
- void *private;
-} dri_drawable_t;
-
-typedef struct dri_context
-{
- XID id;
- drm_context_t drm_context;
- dri_screen_t *dri_screen;
- void *private;
-} dri_context_t;
-
-typedef struct dri_framebuffer
-{
- drm_handle_t drm_handle;
- int base, size, stride;
- int private_size;
- void *private;
-} dri_framebuffer_t;
-
-int driCreateScreen(Display *display, int screen, dri_screen_t **dri_screen, dri_framebuffer_t *dri_framebuf);
-int driDestroyScreen(dri_screen_t *dri_screen);
-int driCreateDrawable(dri_screen_t *dri_screen, Drawable drawable, dri_drawable_t **dri_drawable);
-int driUpdateDrawableInfo(dri_drawable_t *dri_drawable);
-int driDestroyDrawable(dri_drawable_t *dri_drawable);
-int driCreateContext(dri_screen_t *dri_screen, Visual *visual, dri_context_t **dri_context);
-int driDestroyContext(dri_context_t *dri_context);
-
-int dri2CreateScreen(Display *display, int screen, dri_screen_t **dri_screen);
-int dri2DestroyScreen(dri_screen_t *dri_screen);
-int dri2CreateDrawable(dri_screen_t *dri_screen, XID drawable);
-int dri2DestroyDrawable(dri_screen_t *dri_screen, XID drawable);
-int dri2CopyDrawable(dri_screen_t *dri_screen, XID drawable, int dest, int src);
-
-#define DRI_BUFFER_FRONT_LEFT 0
-#define DRI_BUFFER_BACK_LEFT 1
-#define DRI_BUFFER_FRONT_RIGHT 2
-#define DRI_BUFFER_BACK_RIGHT 3
-#define DRI_BUFFER_DEPTH 4
-#define DRI_BUFFER_STENCIL 5
-#define DRI_BUFFER_ACCUM 6
-#define DRI_BUFFER_FAKE_FRONT_LEFT 7
-#define DRI_BUFFER_FAKE_FRONT_RIGHT 8
-#define DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
-
-#endif
-
diff --git a/src/gallium/winsys/g3dvl/dri/xf86dri.h b/src/gallium/winsys/g3dvl/dri/xf86dri.h
deleted file mode 100644
index baf80a7..0000000
--- a/src/gallium/winsys/g3dvl/dri/xf86dri.h
+++ /dev/null
@@ -1,119 +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 at valinux.com>
- * \author Jens Owen <jens at tungstengraphics.com>
- * \author Rickard E. (Rik) Faith <faith at 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 );
-
-Bool XF86DRIDestroyContext( Display *dpy, int screen,
- XID context_id );
-
-Bool XF86DRICreateDrawable( Display *dpy, int screen,
- Drawable drawable, drm_drawable_t *hHWDrawable );
-
-Bool XF86DRIDestroyDrawable( Display *dpy, int screen,
- Drawable 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 );
-
-_XFUNCPROTOEND
-
-#endif /* _XF86DRI_SERVER_ */
-
-#endif /* _XF86DRI_H_ */
-
diff --git a/src/gallium/winsys/g3dvl/dri/xf86dristr.h b/src/gallium/winsys/g3dvl/dri/xf86dristr.h
deleted file mode 100644
index b834bd1..0000000
--- a/src/gallium/winsys/g3dvl/dri/xf86dristr.h
+++ /dev/null
@@ -1,342 +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 at valinux.com>
- * Jens Owen <jens at tungstengraphics.com>
- * Rickard E. (Rik) Fiath <faith at 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_ */
--
1.7.5.4
More information about the mesa-dev
mailing list