summaryrefslogtreecommitdiff
path: root/src/x11
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2009-01-21 06:29:34 -0500
committerAustin Yuan <shengquan.yuan@intel.com>2009-01-21 06:29:34 -0500
commit16a51b8c6c289211c3e991f06fbfb6c68d7ca19c (patch)
treea693b094818780a795606b29cd405751a8ea1e5a /src/x11
parentb1a802f06a3c9883d7267e804ebf66cdbcf4a0fa (diff)
downloadlibva-16a51b8c6c289211c3e991f06fbfb6c68d7ca19c.tar.gz
Fix path issue of "va_x11.h"
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/Makefile.am28
-rw-r--r--src/x11/va_dri.c624
-rw-r--r--src/x11/va_dri.h120
-rw-r--r--src/x11/va_dristr.h344
-rw-r--r--src/x11/va_x11.c206
-rwxr-xr-xsrc/x11/va_x11.h75
6 files changed, 0 insertions, 1397 deletions
diff --git a/src/x11/Makefile.am b/src/x11/Makefile.am
deleted file mode 100644
index 72bfebd..0000000
--- a/src/x11/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-# INTEL CONFIDENTIAL
-# Copyright 2007 Intel Corporation. All Rights Reserved.
-#
-# The source code contained or described herein and all documents related to
-# the source code ("Material") are owned by Intel Corporation or its suppliers
-# or licensors. Title to the Material remains with Intel Corporation or its
-# suppliers and licensors. The Material may contain trade secrets and
-# proprietary and confidential information of Intel Corporation and its
-# suppliers and licensors, and is protected by worldwide copyright and trade
-# secret laws and treaty provisions. No part of the Material may be used,
-# copied, reproduced, modified, published, uploaded, posted, transmitted,
-# distributed, or disclosed in any way without Intel's prior express written
-# permission.
-#
-# No license under any patent, copyright, trade secret or other intellectual
-# property right is granted to or conferred upon you by disclosure or delivery
-# of the Materials, either expressly, by implication, inducement, estoppel or
-# otherwise. Any license under such intellectual property rights must be
-# express and approved by Intel in writing.
-
-AM_CFLAGS = -DLINUX -I$(top_srcdir)/src $(DRM_CFLAGS)
-
-noinst_LTLIBRARIES = libva_x11.la
-
-libva_x11includedir = ${includedir}
-libva_x11include_HEADERS = va_x11.h va_dri.h
-
-libva_x11_la_SOURCES = va_x11.c va_dri.c
diff --git a/src/x11/va_dri.c b/src/x11/va_dri.c
deleted file mode 100644
index ce3b7cd..0000000
--- a/src/x11/va_dri.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.13 2002/10/30 12:51:25 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-Copyright 2007 Intel Corporation
-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 <jens@tungstengraphics.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#define NEED_REPLIES
-#include <X11/Xlibint.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include "va_dristr.h"
-
-#define PUBLIC
-
-static XExtensionInfo _va_dri_info_data;
-static XExtensionInfo *va_dri_info = &_va_dri_info_data;
-static char va_dri_extension_name[] = VA_DRINAME;
-
-#define VA_DRICheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, va_dri_extension_name, val)
-
-/*****************************************************************************
- * *
- * private utility routines *
- * *
- *****************************************************************************/
-
-static int close_display(Display *dpy, XExtCodes *extCodes);
-static /* const */ XExtensionHooks va_dri_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, va_dri_info,
- va_dri_extension_name,
- &va_dri_extension_hooks,
- 0, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, va_dri_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
-
-
-PUBLIC Bool VA_DRIQueryExtension (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 VA_DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
- Display* dpy;
- int* majorVersion;
- int* minorVersion;
- int* patchVersion;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIQueryVersionReply rep;
- xVA_DRIQueryVersionReq *req;
-
- TRACE("QueryVersion...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIQueryVersion;
- 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 VA_DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
- Display* dpy;
- int screen;
- Bool* isCapable;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIQueryDirectRenderingCapableReply rep;
- xVA_DRIQueryDirectRenderingCapableReq *req;
-
- TRACE("QueryDirectRenderingCapable...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIQueryDirectRenderingCapable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIQueryDirectRenderingCapable;
- 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 VA_DRIOpenConnection(dpy, screen, hSAREA, busIdString)
- Display* dpy;
- int screen;
- drm_handle_t * hSAREA;
- char **busIdString;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIOpenConnectionReply rep;
- xVA_DRIOpenConnectionReq *req;
-
- TRACE("OpenConnection...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIOpenConnection, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIOpenConnection;
- 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 VA_DRIAuthConnection(dpy, screen, magic)
- Display* dpy;
- int screen;
- drm_magic_t magic;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIAuthConnectionReq *req;
- xVA_DRIAuthConnectionReply rep;
-
- TRACE("AuthConnection...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIAuthConnection, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIAuthConnection;
- 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 VA_DRICloseConnection(dpy, screen)
- Display* dpy;
- int screen;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRICloseConnectionReq *req;
-
- TRACE("CloseConnection...");
-
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRICloseConnection, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRICloseConnection;
- req->screen = screen;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("CloseConnection... return True");
- return True;
-}
-
-PUBLIC Bool VA_DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
- ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
- Display* dpy;
- int screen;
- int* ddxDriverMajorVersion;
- int* ddxDriverMinorVersion;
- int* ddxDriverPatchVersion;
- char** clientDriverName;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIGetClientDriverNameReply rep;
- xVA_DRIGetClientDriverNameReq *req;
-
- TRACE("GetClientDriverName...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIGetClientDriverName, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIGetClientDriverName;
- 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 VA_DRICreateContextWithConfig(dpy, screen, configID, context,
- hHWContext)
- Display* dpy;
- int screen;
- int configID;
- XID* context;
- drm_context_t * hHWContext;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRICreateContextReply rep;
- xVA_DRICreateContextReq *req;
-
- TRACE("CreateContext...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRICreateContext, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRICreateContext;
- 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 VA_DRICreateContext(dpy, screen, visual, context, hHWContext)
- Display* dpy;
- int screen;
- Visual* visual;
- XID* context;
- drm_context_t * hHWContext;
-{
- return VA_DRICreateContextWithConfig( dpy, screen, visual->visualid,
- context, hHWContext );
-}
-
-PUBLIC Bool VA_DRIDestroyContext( __DRInativeDisplay * ndpy, int screen,
- __DRIid context )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIDestroyContextReq *req;
-
- TRACE("DestroyContext...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIDestroyContext, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIDestroyContext;
- req->screen = screen;
- req->context = context;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("DestroyContext... return True");
- return True;
-}
-
-PUBLIC Bool VA_DRICreateDrawable( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable, drm_drawable_t * hHWDrawable )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRICreateDrawableReply rep;
- xVA_DRICreateDrawableReq *req;
-
- TRACE("CreateDrawable...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRICreateDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRICreateDrawable;
- 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 VA_DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen,
- __DRIid drawable )
-{
- Display * const dpy = (Display *) ndpy;
- XExtDisplayInfo *info = find_display (dpy);
- xVA_DRIDestroyDrawableReq *req;
-
- TRACE("DestroyDrawable...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIDestroyDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIDestroyDrawable;
- req->screen = screen;
- req->drawable = drawable;
- UnlockDisplay(dpy);
- SyncHandle();
- TRACE("DestroyDrawable... return True");
- return True;
-}
-
-PUBLIC Bool VA_DRIGetDrawableInfo(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);
- xVA_DRIGetDrawableInfoReply rep;
- xVA_DRIGetDrawableInfoReq *req;
- int total_rects;
-
- TRACE("GetDrawableInfo...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIGetDrawableInfo, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIGetDrawableInfo;
- 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(xVA_DRIGetDrawableInfoReply) -
- 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 VA_DRIGetDeviceInfo(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);
- xVA_DRIGetDeviceInfoReply rep;
- xVA_DRIGetDeviceInfoReq *req;
-
- TRACE("GetDeviceInfo...");
- VA_DRICheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(VA_DRIGetDeviceInfo, req);
- req->reqType = info->codes->major_opcode;
- req->driReqType = X_VA_DRIGetDeviceInfo;
- 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;
-}
-
-PUBLIC Bool VA_DRIOpenFullScreen(dpy, screen, drawable)
- Display* dpy;
- int screen;
- Drawable drawable;
-{
- /* This function and the underlying X protocol are deprecated.
- */
- (void) dpy;
- (void) screen;
- (void) drawable;
- return False;
-}
-
-PUBLIC Bool VA_DRICloseFullScreen(dpy, screen, drawable)
- Display* dpy;
- int screen;
- Drawable drawable;
-{
- /* This function and the underlying X protocol are deprecated.
- */
- (void) dpy;
- (void) screen;
- (void) drawable;
- return True;
-}
-
-#undef TRACE
-
diff --git a/src/x11/va_dri.h b/src/x11/va_dri.h
deleted file mode 100644
index 91f87a2..0000000
--- a/src/x11/va_dri.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-Copyright 2007 Intel Corporation
-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 <jens@tungstengraphics.com>
- * \author Rickard E. (Rik) Faith <faith@valinux.com>
- */
-
-#ifndef _VA_DRI_H_
-#define _VA_DRI_H_
-
-#include <X11/Xfuncproto.h>
-#include <xf86drm.h>
-
-#define X_VA_DRIQueryVersion 0
-#define X_VA_DRIQueryDirectRenderingCapable 1
-#define X_VA_DRIOpenConnection 2
-#define X_VA_DRICloseConnection 3
-#define X_VA_DRIGetClientDriverName 4
-#define X_VA_DRICreateContext 5
-#define X_VA_DRIDestroyContext 6
-#define X_VA_DRICreateDrawable 7
-#define X_VA_DRIDestroyDrawable 8
-#define X_VA_DRIGetDrawableInfo 9
-#define X_VA_DRIGetDeviceInfo 10
-#define X_VA_DRIAuthConnection 11
-#define X_VA_DRIOpenFullScreen 12 /* Deprecated */
-#define X_VA_DRICloseFullScreen 13 /* Deprecated */
-
-#define VA_DRINumberEvents 0
-
-#define VA_DRIClientNotLocal 0
-#define VA_DRIOperationNotSupported 1
-#define VA_DRINumberErrors (VA_DRIOperationNotSupported + 1)
-
-typedef unsigned long __DRIid;
-typedef void __DRInativeDisplay;
-
-_XFUNCPROTOBEGIN
-
-Bool VA_DRIQueryExtension( Display *dpy, int *event_base, int *error_base );
-
-Bool VA_DRIQueryVersion( Display *dpy, int *majorVersion, int *minorVersion,
- int *patchVersion );
-
-Bool VA_DRIQueryDirectRenderingCapable( Display *dpy, int screen,
- Bool *isCapable );
-
-Bool VA_DRIOpenConnection( Display *dpy, int screen, drm_handle_t *hSAREA,
- char **busIDString );
-
-Bool VA_DRIAuthConnection( Display *dpy, int screen, drm_magic_t magic );
-
-Bool VA_DRICloseConnection( Display *dpy, int screen );
-
-Bool VA_DRIGetClientDriverName( Display *dpy, int screen,
- int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
- int *ddxDriverPatchVersion, char **clientDriverName );
-
-Bool VA_DRICreateContext( Display *dpy, int screen, Visual *visual,
- XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-
-Bool VA_DRICreateContextWithConfig( Display *dpy, int screen, int configID,
- XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-
-Bool VA_DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
- __DRIid context_id );
-
-Bool VA_DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
- __DRIid drawable, drm_drawable_t *hHWDrawable );
-
-Bool VA_DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
- __DRIid drawable);
-
-Bool VA_DRIGetDrawableInfo( 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 VA_DRIGetDeviceInfo( Display *dpy, int screen,
- drm_handle_t *hFrameBuffer, int *fbOrigin, int *fbSize,
- int *fbStride, int *devPrivateSize, void **pDevPrivate );
-
-_XFUNCPROTOEND
-
-#endif /* _VA_DRI_H_ */
-
diff --git a/src/x11/va_dristr.h b/src/x11/va_dristr.h
deleted file mode 100644
index 3e391de..0000000
--- a/src/x11/va_dristr.h
+++ /dev/null
@@ -1,344 +0,0 @@
-/* $XFree86: xc/lib/GL/dri/xf86dristr.h,v 1.10 2002/10/30 12:51:25 alanh Exp $ */
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-Copyright 2007 Intel Corporation
-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 <jens@tungstengraphics.com>
- * Rickard E. (Rik) Fiath <faith@valinux.com>
- *
- */
-
-#ifndef _VA_DRISTR_H_
-#define _VA_DRISTR_H_
-
-#include "va_dri.h"
-
-#define VA_DRINAME "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 VA_DRI_MAJOR_VERSION 4
-#define VA_DRI_MINOR_VERSION 1
-#define VA_DRI_PATCH_VERSION 0
-
-typedef struct _VA_DRIQueryVersion {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIQueryVersion */
- CARD16 length B16;
-} xVA_DRIQueryVersionReq;
-#define sz_xVA_DRIQueryVersionReq 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;
-} xVA_DRIQueryVersionReply;
-#define sz_xVA_DRIQueryVersionReply 32
-
-typedef struct _VA_DRIQueryDirectRenderingCapable {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */
- CARD16 length B16;
- CARD32 screen B32;
-} xVA_DRIQueryDirectRenderingCapableReq;
-#define sz_xVA_DRIQueryDirectRenderingCapableReq 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;
-} xVA_DRIQueryDirectRenderingCapableReply;
-#define sz_xVA_DRIQueryDirectRenderingCapableReply 32
-
-typedef struct _VA_DRIOpenConnection {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIOpenConnection */
- CARD16 length B16;
- CARD32 screen B32;
-} xVA_DRIOpenConnectionReq;
-#define sz_xVA_DRIOpenConnectionReq 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;
-} xVA_DRIOpenConnectionReply;
-#define sz_xVA_DRIOpenConnectionReply 32
-
-typedef struct _VA_DRIAuthConnection {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICloseConnection */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 magic B32;
-} xVA_DRIAuthConnectionReq;
-#define sz_xVA_DRIAuthConnectionReq 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;
-} xVA_DRIAuthConnectionReply;
-#define zx_xVA_DRIAuthConnectionReply 32
-
-typedef struct _VA_DRICloseConnection {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICloseConnection */
- CARD16 length B16;
- CARD32 screen B32;
-} xVA_DRICloseConnectionReq;
-#define sz_xVA_DRICloseConnectionReq 8
-
-typedef struct _VA_DRIGetClientDriverName {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIGetClientDriverName */
- CARD16 length B16;
- CARD32 screen B32;
-} xVA_DRIGetClientDriverNameReq;
-#define sz_xVA_DRIGetClientDriverNameReq 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;
-} xVA_DRIGetClientDriverNameReply;
-#define sz_xVA_DRIGetClientDriverNameReply 32
-
-typedef struct _VA_DRICreateContext {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICreateContext */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 visual B32;
- CARD32 context B32;
-} xVA_DRICreateContextReq;
-#define sz_xVA_DRICreateContextReq 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;
-} xVA_DRICreateContextReply;
-#define sz_xVA_DRICreateContextReply 32
-
-typedef struct _VA_DRIDestroyContext {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIDestroyContext */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 context B32;
-} xVA_DRIDestroyContextReq;
-#define sz_xVA_DRIDestroyContextReq 12
-
-typedef struct _VA_DRICreateDrawable {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICreateDrawable */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xVA_DRICreateDrawableReq;
-#define sz_xVA_DRICreateDrawableReq 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;
-} xVA_DRICreateDrawableReply;
-#define sz_xVA_DRICreateDrawableReply 32
-
-typedef struct _VA_DRIDestroyDrawable {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIDestroyDrawable */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xVA_DRIDestroyDrawableReq;
-#define sz_xVA_DRIDestroyDrawableReq 12
-
-typedef struct _VA_DRIGetDrawableInfo {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIGetDrawableInfo */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xVA_DRIGetDrawableInfoReq;
-#define sz_xVA_DRIGetDrawableInfoReq 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;
-} xVA_DRIGetDrawableInfoReply;
-
-#define sz_xVA_DRIGetDrawableInfoReply 36
-
-
-typedef struct _VA_DRIGetDeviceInfo {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIGetDeviceInfo */
- CARD16 length B16;
- CARD32 screen B32;
-} xVA_DRIGetDeviceInfoReq;
-#define sz_xVA_DRIGetDeviceInfoReq 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;
-} xVA_DRIGetDeviceInfoReply;
-#define sz_xVA_DRIGetDeviceInfoReply 32
-
-typedef struct _VA_DRIOpenFullScreen {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRIOpenFullScreen */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xVA_DRIOpenFullScreenReq;
-#define sz_xVA_DRIOpenFullScreenReq 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;
-} xVA_DRIOpenFullScreenReply;
-#define sz_xVA_DRIOpenFullScreenReply 32
-
-typedef struct _VA_DRICloseFullScreen {
- CARD8 reqType; /* always DRIReqCode */
- CARD8 driReqType; /* always X_DRICloseFullScreen */
- CARD16 length B16;
- CARD32 screen B32;
- CARD32 drawable B32;
-} xVA_DRICloseFullScreenReq;
-#define sz_xVA_DRICloseFullScreenReq 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;
-} xVA_DRICloseFullScreenReply;
-#define sz_xVA_DRICloseFullScreenReply 32
-
-
-#endif /* _VA_DRISTR_H_ */
diff --git a/src/x11/va_x11.c b/src/x11/va_x11.c
deleted file mode 100644
index 2d129a9..0000000
--- a/src/x11/va_x11.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2007 Intel Corporation. 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.
- */
-
-#include "config.h"
-#include "va.h"
-#include "va_backend.h"
-#include "va_x11.h"
-#include "va_dri.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-static VADisplayContextP pDisplayContexts = NULL;
-
-static void va_errorMessage(const char *msg, ...)
-{
- va_list args;
-
- fprintf(stderr, "libva error: ");
- va_start(args, msg);
- vfprintf(stderr, msg, args);
- va_end(args);
-}
-
-static void va_infoMessage(const char *msg, ...)
-{
- va_list args;
-
- fprintf(stderr, "libva: ");
- va_start(args, msg);
- vfprintf(stderr, msg, args);
- va_end(args);
-}
-
-static int va_DisplayContextIsValid (
- VADisplayContextP pDisplayContext
-)
-{
- VADisplayContextP ctx = pDisplayContexts;
-
- while (ctx)
- {
- if (ctx == pDisplayContext && pDisplayContext->pDriverContext)
- return 1;
- ctx = ctx->pNext;
- }
- return 0;
-}
-
-static void va_DisplayContextDestroy (
- VADisplayContextP pDisplayContext
-)
-{
- VADisplayContextP *ctx = &pDisplayContexts;
-
- /* Throw away pDisplayContext */
- while (*ctx)
- {
- if (*ctx == pDisplayContext)
- {
- *ctx = pDisplayContext->pNext;
- pDisplayContext->pNext = NULL;
- break;
- }
- ctx = &((*ctx)->pNext);
- }
- free(pDisplayContext->pDriverContext);
- free(pDisplayContext);
-}
-
-static VAStatus va_DisplayContextGetDriverName (
- VADisplayContextP pDisplayContext,
- char **driver_name
-)
-{
- VADriverContextP ctx = pDisplayContext->pDriverContext;
- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
- int direct_capable;
- int driver_major;
- int driver_minor;
- int driver_patch;
- Bool result = True;
- char *x_driver_name = NULL;
-
- if (driver_name)
- *driver_name = NULL;
- if (geteuid() == getuid())
- {
- /* don't allow setuid apps to use LIBVA_DRIVER_NAME */
- if (getenv("LIBVA_DRIVER_NAME"))
- {
- /* For easier debugging */
- *driver_name = strdup(getenv("LIBVA_DRIVER_NAME"));
- return VA_STATUS_SUCCESS;
- }
- }
- if (result)
- {
- result = VA_DRIQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen, &direct_capable);
- if (!result)
- {
- va_errorMessage("VA_DRIQueryDirectRenderingCapable failed\n");
- }
- }
- if (result)
- {
- result = direct_capable;
- if (!result)
- {
- va_errorMessage("VA_DRIQueryDirectRenderingCapable returned false\n");
- }
- }
- if (result)
- {
- result = VA_DRIGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, &driver_major, &driver_minor,
- &driver_patch, &x_driver_name);
- if (!result)
- {
- va_errorMessage("VA_DRIGetClientDriverName returned false\n");
- }
- }
- if (result)
- {
- vaStatus = VA_STATUS_SUCCESS;
- va_infoMessage("VA_DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
- driver_major, driver_minor, driver_patch, x_driver_name, ctx->x11_screen);
- if (driver_name)
- *driver_name = strdup(x_driver_name);
- }
- if (x_driver_name)
- XFree(x_driver_name);
-
- return vaStatus;
-}
-
-VADisplay vaGetDisplay (
- Display *native_dpy
-)
-{
- VADisplay dpy = NULL;
- VADisplayContextP pDisplayContext = pDisplayContexts;
-
- if (!native_dpy)
- return NULL;
-
- while (pDisplayContext)
- {
- if (pDisplayContext->pDriverContext &&
- pDisplayContext->pDriverContext->x11_dpy == native_dpy)
- {
- dpy = (VADisplay)pDisplayContext;
- break;
- }
- pDisplayContext = pDisplayContext->pNext;
- }
-
- if (!dpy)
- {
- /* create new entry */
- VADriverContextP pDriverContext;
- pDisplayContext = calloc(1, sizeof(*pDisplayContext));
- pDriverContext = calloc(1, sizeof(*pDriverContext));
- if (pDisplayContext && pDriverContext)
- {
- pDriverContext->old_pNext = (void *)(unsigned long)0xdeadbeef;
- pDriverContext->x11_dpy = native_dpy;
- pDisplayContext->pNext = pDisplayContexts;
- pDisplayContext->pDriverContext = pDriverContext;
- pDisplayContext->vaIsValid = va_DisplayContextIsValid;
- pDisplayContext->vaDestroy = va_DisplayContextDestroy;
- pDisplayContext->vaGetDriverName = va_DisplayContextGetDriverName;
- pDisplayContexts = pDisplayContext;
- dpy = (VADisplay)pDisplayContext;
- }
- else
- {
- if (pDisplayContext)
- free(pDisplayContext);
- if (pDriverContext)
- free(pDriverContext);
- }
- }
-
- return dpy;
-}
diff --git a/src/x11/va_x11.h b/src/x11/va_x11.h
deleted file mode 100755
index 9ef73cd..0000000
--- a/src/x11/va_x11.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Video Decode Acceleration API, X11 specific functions
- *
- * Rev. 0.15
- * <jonathan.bian@intel.com>
- *
- * Revision History:
- * rev 0.1 (12/10/06 Jonathan Bian) - Initial draft
- * rev 0.11 (12/15/06 Jonathan Bian) - Fixed some errors
- * rev 0.12 (02/05/07 Jonathan Bian) - Added VC-1 data structures
- * rev 0.13 (02/28/07 Jonathan Bian) - Added GetDisplay()
- * rev 0.14 (04/13/07 Jonathan Bian) - Fixed MPEG-2 PictureParameter struct, cleaned up a few funcs.
- * rev 0.15 (04/20/07 Jonathan Bian) - Overhauled buffer management
- *
- */
-
-#ifndef _VA_X11_H_
-#define _VA_X11_H_
-
-#include <va.h>
-#include <X11/Xlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Returns a suitable VADisplay for VA API
- */
-VADisplay vaGetDisplay (
- Display *dpy
-);
-
-/*
- * Output rendering
- * Following is the rendering interface for X windows,
- * to get the decode output surface to a X drawable
- * It basically performs a de-interlacing (if needed),
- * color space conversion and scaling to the destination
- * rectangle
- */
-
-/* de-interlace flags for vaPutSurface */
-#define VA_FRAME_PICTURE 0x00000000
-#define VA_TOP_FIELD 0x00000001
-#define VA_BOTTOM_FIELD 0x00000002
-/*
- * clears the drawable with background color.
- * for hardware overlay based implementation this flag
- * can be used to turn off the overlay
- */
-#define VA_CLEAR_DRAWABLE 0x00000008
-
-VAStatus vaPutSurface (
- VADisplay dpy,
- VASurfaceID surface,
- Drawable draw, /* X Drawable */
- short srcx,
- short srcy,
- unsigned short srcw,
- unsigned short srch,
- short destx,
- short desty,
- unsigned short destw,
- unsigned short desth,
- VARectangle *cliprects, /* client supplied clip list */
- unsigned int number_cliprects, /* number of clip rects in the clip list */
- unsigned int flags /* de-interlacing flags */
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _VA_X11_H_ */