summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2009-01-12 06:49:57 -0500
committerAustin Yuan <shengquan.yuan@intel.com>2009-01-12 06:49:57 -0500
commite1b1327bff4d9b524c1eb0f9ed711dee9c6e3927 (patch)
tree6bed725bf00c17ba82fcc0d2abd4706483ee5b33
parentf08cc6d5b8f0b2b2bb3034e7d846076bfd0966cd (diff)
downloadlibva-e1b1327bff4d9b524c1eb0f9ed711dee9c6e3927.tar.gz
Apply the patch to split va and display/x11 from Gwenole Beauchesne [mailto:gbeauchesne@splitted-desktop.com]
Bellow is his explanation: > Finally, looking further at <va_x11.h>, I think it should be enough to have > vaInitialize() in display-dependent headers/libs. The va_x11_getDriverName() > suggestion was to factor out the thing at the implementation (source > code/files) level. > > Or we could keep vaInitialize() in common lib and rather have vaGetDisplay() > in the display-specific part? And, while being at it, also rename the > function to vaCreateDisplay(), to be meaningful about the API change? > > Besides, for a different windowing system, we probably would need more than > just the Display (as we have in X11 land) anyway. e.g. what about OpenGL, > OpenGL E|S? I don't know, it's just an idea. > > I read that Canmore/Sodaville are using the same engines as the Poulsbo > (SGX535 and VXD370). However, the former platforms only support OpenGL E|S. > So, how does video acceleration work here? I know it works, I saw it but > since we still haven't received the machines, I just don't know about the > actual API. You'd probably want libVA there too. > > Splitting libVA between a Core API and a Display API would make it possible > to reduce code duplication from a player point of view. i.e. I don't think > it's necessary to have client applications implement > vaBeginPicture()..vaEndPicture() sequences themselves. I think it should be > the role of the codec library (ffmpeg, in my case), and it should be able to > do so without an explicit dependency on X11. > > On the other hand, the Core API won't be useful/functional alone. So, that > could be confusing too. > > In practise, I would like to have it working as follows. It's my ideal > vision, not necessarily the right/correct one. ;-) > > Roles of a codec implementation library: > - Create buffers > - Render the pictures, in the vaBeginPicture()..vaEndPicture(), > vaRenderPicture() sense > > Roles of a player application: > - Create display, surfaces, and decode pipeline for the codec library > - Render the picture, visually, i.e. in the vaPutSurface() sense > > Example use: > VApplication|initialize display > CodecLibrary|characterise bitstream (codec and other useful info) > VApplication|create decode pipeline > VApplication|create surfaces > CodecLibrary|create buffers (1) > CodecLibrary|render picture (2) > VApplication|display picture (3) > repeat (1) -> (3) while the end of stream is not reached > VApplication|destroy everything > > Have CodecLibrary linked against libva-core-VERSION.so.MAJOR, without any > dependency on windowing system library. > > Have VApplication linked against libva-x11-VERSION.so.MAJOR, itself linked > against libva-core-VERSION.so.MAJOR and other windowing system libraries. > > Regards, > Gwenole. > Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
-rw-r--r--configure.ac9
-rw-r--r--libva.pc.in2
-rw-r--r--src/Makefile.am8
-rw-r--r--src/va.c422
-rwxr-xr-xsrc/va.h4
-rwxr-xr-xsrc/va_backend.h22
-rw-r--r--src/x11/Makefile498
-rw-r--r--src/x11/Makefile.am28
-rw-r--r--src/x11/Makefile.in498
-rw-r--r--src/x11/libva_x11.la35
-rw-r--r--src/x11/va_dri.c (renamed from src/va_dri.c)0
-rw-r--r--src/x11/va_dri.h (renamed from src/va_dri.h)0
-rw-r--r--src/x11/va_dri.lo12
-rw-r--r--src/x11/va_dristr.h (renamed from src/va_dristr.h)0
-rw-r--r--src/x11/va_x11.c206
-rwxr-xr-xsrc/x11/va_x11.h (renamed from src/va_x11.h)10
-rw-r--r--src/x11/va_x11.lo12
-rw-r--r--test/test.c3
-rw-r--r--test/test_12.c5
-rw-r--r--test/test_common.c3
-rw-r--r--test/vainfo.c3
21 files changed, 1502 insertions, 278 deletions
diff --git a/configure.ac b/configure.ac
index 9a3f3cd..249fd6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AC_PREREQ(2.57)
-AC_INIT([libva], 0.29, [waldo.bastian@intel.com], libva)
+AC_INIT([libva], 0.30, [waldo.bastian@intel.com], libva)
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2])
@@ -36,11 +36,12 @@ AC_SYS_LARGEFILE
PKG_CHECK_MODULES([X11], [x11])
PKG_CHECK_MODULES([XEXT], [xext])
-PKG_CHECK_MODULES([XDAMAGE], [xfixes])
+PKG_CHECK_MODULES([Xfixes], [xfixes])
PKG_CHECK_MODULES([XDAMAGE], [xdamage])
-PKG_CHECK_MODULES([libva_la], [libdrm])
+PKG_CHECK_MODULES([DRM], [libdrm])
+#PKG_CHECK_MODULES([libva_la], [libdrm])
pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir)
-AC_OUTPUT([Makefile src/Makefile dummy_drv_video/Makefile test/Makefile libva.pc])
+AC_OUTPUT([Makefile src/Makefile src/x11/Makefile dummy_drv_video/Makefile test/Makefile libva.pc])
diff --git a/libva.pc.in b/libva.pc.in
index d46f53c..16fb6aa 100644
--- a/libva.pc.in
+++ b/libva.pc.in
@@ -4,7 +4,7 @@ libdir=@libdir@
includedir=@includedir@
Name: libva
-Description: Userspace Video Acceleration (VA) interface
+Description: Userspace Video Acceleration (VA) core interface
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lva
Cflags: -I${includedir}
diff --git a/src/Makefile.am b/src/Makefile.am
index 6161da3..6297e12 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,11 +23,13 @@
libva_la_LTLIBRARIES = libva.la
libva_ladir = $(libdir)
libva_la_LDFLAGS = -version-number 0:30:0 -no-undefined
-libva_la_LIBADD = -ldl -lX11 -lXext -lXfixes -lXdamage
+libva_la_LIBADD = -ldl -lX11 -lXext -lXfixes -lXdamage x11/libva_x11.la
-libva_la_SOURCES = va_dri.c va.c va_dristr.h
+SUBDIRS = x11
+
+libva_la_SOURCES = va.c
libvaincludedir = ${includedir}
-libvainclude_HEADERS = va.h va_x11.h va_dri.h va_backend.h
+libvainclude_HEADERS = va.h va_backend.h
EXTRA_DIST = ChangeLog TODO
diff --git a/src/va.c b/src/va.c
index ca560ce..2bfeb49 100644
--- a/src/va.c
+++ b/src/va.c
@@ -22,17 +22,15 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "X11/Xlib.h"
#include "va.h"
#include "va_backend.h"
-#include "assert.h"
+#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
#include <unistd.h>
-#include "va_dri.h"
#define VA_MAJOR_VERSION 0
#define VA_MINOR_VERSION 30
@@ -41,8 +39,9 @@
#define DEFAULT_DRIVER_DIR "/usr/lib/dri/"
#define DRIVER_EXTENSION "_drv_video.so"
-#define CTX(dpy) ((VADriverContextP) dpy );
-#define CHECK_CONTEXT(dpy) if( !vaContextIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; }
+#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
+#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; }
+
#define ASSERT assert
#define CHECK_VTABLE(s, ctx, func) if (!va_checkVtable(ctx->vtable.va##func, #func)) s = VA_STATUS_ERROR_UNKNOWN;
#define CHECK_MAXIMUM(s, ctx, var) if (!va_checkMaximum(ctx->max_##var, #var)) s = VA_STATUS_ERROR_UNKNOWN;
@@ -50,57 +49,12 @@
#define TRACE(func) if (va_debug_trace) va_infoMessage("[TR] %s\n", #func);
-static VADriverContextP pDriverContexts = NULL;
static int va_debug_trace = 0;
-static Bool vaContextIsValid(VADriverContextP arg_ctx)
-{
- VADriverContextP ctx = pDriverContexts;
-
- while (ctx)
- {
- if (ctx == arg_ctx)
- {
- return True;
- }
- ctx = ctx->pNext;
- }
- return False;
-}
-
-VADisplay vaGetDisplay (
- NativeDisplay native_dpy /* implementation specific */
-)
+static int vaDisplayIsValid(VADisplay dpy)
{
- VADisplay dpy = NULL;
- VADriverContextP ctx = pDriverContexts;
-
- if (!native_dpy)
- {
- return NULL;
- }
-
- while (ctx)
- {
- if (ctx->x11_dpy == (Display *)native_dpy)
- {
- dpy = (VADisplay) ctx;
- break;
- }
- ctx = ctx->pNext;
- }
-
- if (!dpy)
- {
- /* create new entry */
- ctx = (VADriverContextP) calloc(1, sizeof(struct VADriverContext));
- ctx->pNext = pDriverContexts;
- ctx->x11_dpy = (Display *) native_dpy;
- pDriverContexts = ctx;
- dpy = (VADisplay) ctx;
- }
-
- return dpy;
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ return pDisplayContext && pDisplayContext->vaIsValid(pDisplayContext);
}
static void va_errorMessage(const char *msg, ...)
@@ -153,63 +107,15 @@ static Bool va_checkString(const char* value, char *variable)
return True;
}
-static VAStatus va_getDriverName(VADriverContextP ctx, char **driver_name)
+static VAStatus va_getDriverName(VADisplay dpy, char **driver_name)
{
- VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
- int direct_capable;
- int driver_major;
- int driver_minor;
- int driver_patch;
- Bool result = True;
-
- *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, 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, *driver_name, ctx->x11_screen);
- }
-
- return vaStatus;
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ return pDisplayContext->vaGetDriverName(pDisplayContext, driver_name);
}
-static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
+static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
{
+ VADriverContextP ctx = CTX(dpy);
VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN;
char *search_path = NULL;
char *saveptr;
@@ -345,9 +251,10 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
VAPrivFunc vaGetLibFunc(VADisplay dpy, const char *func)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
+ VADriverContextP ctx;
+ if( !vaDisplayIsValid(dpy) )
return NULL;
+ ctx = CTX(dpy);
if (NULL == ctx->handle)
return NULL;
@@ -415,20 +322,19 @@ VAStatus vaInitialize (
int *minor_version /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
char *driver_name = NULL;
VAStatus vaStatus;
- CHECK_CONTEXT(ctx);
+ CHECK_DISPLAY(dpy);
va_debug_trace = (getenv("LIBVA_DEBUG_TRACE") != NULL);
- vaStatus = va_getDriverName(ctx, &driver_name);
+ vaStatus = va_getDriverName(dpy, &driver_name);
va_infoMessage("va_getDriverName() returns %d\n", vaStatus);
if (VA_STATUS_SUCCESS == vaStatus)
{
- vaStatus = va_openDriver(ctx, driver_name);
+ vaStatus = va_openDriver(dpy, driver_name);
va_infoMessage("va_openDriver() returns %d\n", vaStatus);
*major_version = VA_MAJOR_VERSION;
@@ -436,9 +342,7 @@ VAStatus vaInitialize (
}
if (driver_name)
- {
- XFree(driver_name);
- }
+ free(driver_name);
return vaStatus;
}
@@ -451,8 +355,11 @@ VAStatus vaTerminate (
)
{
VAStatus vaStatus = VA_STATUS_SUCCESS;
- VADriverContextP old_ctx = CTX(dpy);
- CHECK_CONTEXT(old_ctx);
+ VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
+ VADriverContextP old_ctx;
+
+ CHECK_DISPLAY(dpy);
+ old_ctx = CTX(dpy);
if (old_ctx->handle)
{
@@ -462,22 +369,7 @@ VAStatus vaTerminate (
}
if (VA_STATUS_SUCCESS == vaStatus)
- {
- VADriverContextP *ctx = &pDriverContexts;
-
- /* Throw away old_ctx */
- while (*ctx)
- {
- if (*ctx == old_ctx)
- {
- *ctx = old_ctx->pNext;
- old_ctx->pNext = NULL;
- break;
- }
- ctx = &((*ctx)->pNext);
- }
- free(old_ctx);
- }
+ pDisplayContext->vaDestroy(pDisplayContext);
return vaStatus;
}
@@ -493,13 +385,10 @@ const char *vaQueryVendorString (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return NULL;
- }
- return ctx->str_vendor;
+ return CTX(dpy)->str_vendor;
}
@@ -508,13 +397,10 @@ int vaMaxNumProfiles (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return 0;
- }
- return ctx->max_profiles;
+ return CTX(dpy)->max_profiles;
}
/* Get maximum number of entrypoints supported by the implementation */
@@ -522,13 +408,10 @@ int vaMaxNumEntrypoints (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return 0;
- }
- return ctx->max_entrypoints;
+ return CTX(dpy)->max_entrypoints;
}
@@ -537,13 +420,10 @@ int vaMaxNumConfigAttributes (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return 0;
- }
- return ctx->max_attributes;
+ return CTX(dpy)->max_attributes;
}
VAStatus vaQueryConfigEntrypoints (
@@ -553,8 +433,9 @@ VAStatus vaQueryConfigEntrypoints (
int *num_entrypoints /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQueryConfigEntrypoints);
return ctx->vtable.vaQueryConfigEntrypoints ( ctx, profile, entrypoints, num_entrypoints);
@@ -568,8 +449,9 @@ VAStatus vaGetConfigAttributes (
int num_attribs
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaGetConfigAttributes);
return ctx->vtable.vaGetConfigAttributes ( ctx, profile, entrypoint, attrib_list, num_attribs );
@@ -581,8 +463,9 @@ VAStatus vaQueryConfigProfiles (
int *num_profiles /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQueryConfigProfiles);
return ctx->vtable.vaQueryConfigProfiles ( ctx, profile_list, num_profiles );
@@ -597,8 +480,9 @@ VAStatus vaCreateConfig (
VAConfigID *config_id /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaCreateConfig);
return ctx->vtable.vaCreateConfig ( ctx, profile, entrypoint, attrib_list, num_attribs, config_id );
@@ -609,8 +493,9 @@ VAStatus vaDestroyConfig (
VAConfigID config_id
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDestroyConfig);
return ctx->vtable.vaDestroyConfig ( ctx, config_id );
@@ -625,8 +510,9 @@ VAStatus vaQueryConfigAttributes (
int *num_attribs /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQueryConfigAttributes);
return ctx->vtable.vaQueryConfigAttributes( ctx, config_id, profile, entrypoint, attrib_list, num_attribs);
@@ -641,8 +527,9 @@ VAStatus vaCreateSurfaces (
VASurfaceID *surfaces /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaCreateSurfaces);
return ctx->vtable.vaCreateSurfaces( ctx, width, height, format, num_surfaces, surfaces );
@@ -654,8 +541,9 @@ VAStatus vaDestroySurfaces (
int num_surfaces
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDestroySurfaces);
return ctx->vtable.vaDestroySurfaces( ctx, surface_list, num_surfaces );
@@ -672,8 +560,9 @@ VAStatus vaCreateContext (
VAContextID *context /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaCreateContext);
return ctx->vtable.vaCreateContext( ctx, config_id, picture_width, picture_height,
@@ -685,8 +574,9 @@ VAStatus vaDestroyContext (
VAContextID context
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDestroyContext);
return ctx->vtable.vaDestroyContext( ctx, context );
@@ -702,8 +592,9 @@ VAStatus vaCreateBuffer (
VABufferID *buf_id /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaCreateBuffer);
return ctx->vtable.vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
@@ -715,8 +606,9 @@ VAStatus vaBufferSetNumElements (
unsigned int num_elements /* in */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaBufferSetNumElements);
return ctx->vtable.vaBufferSetNumElements( ctx, buf_id, num_elements );
@@ -729,8 +621,9 @@ VAStatus vaMapBuffer (
void **pbuf /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaMapBuffer);
return ctx->vtable.vaMapBuffer( ctx, buf_id, pbuf );
@@ -741,8 +634,9 @@ VAStatus vaUnmapBuffer (
VABufferID buf_id /* in */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaUnmapBuffer);
return ctx->vtable.vaUnmapBuffer( ctx, buf_id );
@@ -753,8 +647,9 @@ VAStatus vaDestroyBuffer (
VABufferID buffer_id
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDestroyBuffer);
return ctx->vtable.vaDestroyBuffer( ctx, buffer_id );
@@ -766,8 +661,9 @@ VAStatus vaBeginPicture (
VASurfaceID render_target
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaBeginPicture);
return ctx->vtable.vaBeginPicture( ctx, context, render_target );
@@ -780,8 +676,9 @@ VAStatus vaRenderPicture (
int num_buffers
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaRenderPicture);
return ctx->vtable.vaRenderPicture( ctx, context, buffers, num_buffers );
@@ -792,8 +689,9 @@ VAStatus vaEndPicture (
VAContextID context
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaEndPicture);
return ctx->vtable.vaEndPicture( ctx, context );
@@ -805,8 +703,9 @@ VAStatus vaSyncSurface (
VASurfaceID render_target
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSyncSurface);
return ctx->vtable.vaSyncSurface( ctx, context, render_target );
@@ -818,8 +717,9 @@ VAStatus vaQuerySurfaceStatus (
VASurfaceStatus *status /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQuerySurfaceStatus);
return ctx->vtable.vaQuerySurfaceStatus( ctx, render_target, status );
@@ -842,8 +742,9 @@ VAStatus vaPutSurface (
unsigned int flags /* de-interlacing flags */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaPutSurface);
return ctx->vtable.vaPutSurface( ctx, surface, draw, srcx, srcy, srcw, srch,
@@ -856,13 +757,10 @@ int vaMaxNumImageFormats (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return 0;
- }
- return ctx->max_image_formats;
+ return CTX(dpy)->max_image_formats;
}
VAStatus vaQueryImageFormats (
@@ -871,8 +769,9 @@ VAStatus vaQueryImageFormats (
int *num_formats /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQueryImageFormats);
return ctx->vtable.vaQueryImageFormats ( ctx, format_list, num_formats);
@@ -894,8 +793,9 @@ VAStatus vaCreateImage (
VAImage *image /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaCreateImage);
return ctx->vtable.vaCreateImage ( ctx, format, width, height, image);
@@ -909,8 +809,9 @@ VAStatus vaDestroyImage (
VAImageID image
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDestroyImage);
return ctx->vtable.vaDestroyImage ( ctx, image);
@@ -922,8 +823,9 @@ VAStatus vaSetImagePalette (
unsigned char *palette
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSetImagePalette);
return ctx->vtable.vaSetImagePalette ( ctx, image, palette);
@@ -943,8 +845,9 @@ VAStatus vaGetImage (
VAImageID image
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaGetImage);
return ctx->vtable.vaGetImage ( ctx, surface, x, y, width, height, image);
@@ -966,8 +869,9 @@ VAStatus vaPutImage (
int dest_y
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaPutImage);
return ctx->vtable.vaPutImage ( ctx, surface, image, src_x, src_y, width, height, dest_x, dest_y );
@@ -991,8 +895,9 @@ VAStatus vaPutImage2 (
unsigned int dest_height
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaPutImage2);
return ctx->vtable.vaPutImage2 ( ctx, surface, image, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height );
@@ -1035,8 +940,9 @@ VAStatus vaDeriveImage (
VAImage *image /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDeriveImage);
return ctx->vtable.vaDeriveImage ( ctx, surface, image );
@@ -1048,13 +954,10 @@ int vaMaxNumSubpictureFormats (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return 0;
- }
- return ctx->max_subpic_formats;
+ return CTX(dpy)->max_subpic_formats;
}
/*
@@ -1071,8 +974,9 @@ VAStatus vaQuerySubpictureFormats (
unsigned int *num_formats /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQuerySubpictureFormats);
return ctx->vtable.vaQuerySubpictureFormats ( ctx, format_list, flags, num_formats);
@@ -1087,8 +991,9 @@ VAStatus vaCreateSubpicture (
VASubpictureID *subpicture /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaCreateSubpicture);
return ctx->vtable.vaCreateSubpicture ( ctx, image, subpicture );
@@ -1102,8 +1007,9 @@ VAStatus vaDestroySubpicture (
VASubpictureID subpicture
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDestroySubpicture);
return ctx->vtable.vaDestroySubpicture ( ctx, subpicture);
@@ -1115,8 +1021,9 @@ VAStatus vaSetSubpictureImage (
VAImageID image
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSetSubpictureImage);
return ctx->vtable.vaSetSubpictureImage ( ctx, subpicture, image);
@@ -1134,8 +1041,9 @@ VAStatus vaSetSubpicturePalette (
unsigned char *palette
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSetSubpicturePalette);
return ctx->vtable.vaSetSubpicturePalette ( ctx, subpicture, palette);
@@ -1153,8 +1061,9 @@ VAStatus vaSetSubpictureChromakey (
unsigned int chromakey_mask
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSetSubpictureChromakey);
return ctx->vtable.vaSetSubpictureChromakey ( ctx, subpicture, chromakey_min, chromakey_max, chromakey_mask );
@@ -1172,8 +1081,9 @@ VAStatus vaSetSubpictureGlobalAlpha (
float global_alpha
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSetSubpictureGlobalAlpha);
return ctx->vtable.vaSetSubpictureGlobalAlpha ( ctx, subpicture, global_alpha );
@@ -1204,8 +1114,9 @@ VAStatus vaAssociateSubpicture (
unsigned int flags
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaAssociateSubpicture);
return ctx->vtable.vaAssociateSubpicture ( ctx, subpicture, target_surfaces, num_surfaces, src_x, src_y, dest_x, dest_y, width, height, flags );
@@ -1231,8 +1142,9 @@ VAStatus vaAssociateSubpicture2 (
unsigned int flags
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaAssociateSubpicture2);
return ctx->vtable.vaAssociateSubpicture2 ( ctx, subpicture, target_surfaces, num_surfaces, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height, flags );
@@ -1248,8 +1160,9 @@ VAStatus vaDeassociateSubpicture (
int num_surfaces
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDeassociateSubpicture);
return ctx->vtable.vaDeassociateSubpicture ( ctx, subpicture, target_surfaces, num_surfaces );
@@ -1261,13 +1174,10 @@ int vaMaxNumDisplayAttributes (
VADisplay dpy
)
{
- VADriverContextP ctx = CTX(dpy);
- if( !vaContextIsValid(ctx) )
- {
+ if( !vaDisplayIsValid(dpy) )
return 0;
- }
- return ctx->max_display_attributes;
+ return CTX(dpy)->max_display_attributes;
}
/*
@@ -1282,8 +1192,9 @@ VAStatus vaQueryDisplayAttributes (
int *num_attributes /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaQueryDisplayAttributes);
return ctx->vtable.vaQueryDisplayAttributes ( ctx, attr_list, num_attributes );
@@ -1301,8 +1212,9 @@ VAStatus vaGetDisplayAttributes (
int num_attributes
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaGetDisplayAttributes);
return ctx->vtable.vaGetDisplayAttributes ( ctx, attr_list, num_attributes );
@@ -1320,8 +1232,9 @@ VAStatus vaSetDisplayAttributes (
int num_attributes
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaSetDisplayAttributes);
return ctx->vtable.vaSetDisplayAttributes ( ctx, attr_list, num_attributes );
@@ -1335,8 +1248,9 @@ VAStatus vaDbgCopySurfaceToBuffer(VADisplay dpy,
unsigned int *stride /* out */
)
{
- VADriverContextP ctx = CTX(dpy);
- CHECK_CONTEXT(ctx);
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
TRACE(vaDbgCopySurfaceToBuffer);
return ctx->vtable.vaDbgCopySurfaceToBuffer( ctx, surface, buffer, stride );
diff --git a/src/va.h b/src/va.h
index 7acfeaf..c7db47b 100755
--- a/src/va.h
+++ b/src/va.h
@@ -134,10 +134,6 @@ const char *vaErrorStr(VAStatus error_status);
*/
typedef void* NativeDisplay; /* window system dependent */
-VADisplay vaGetDisplay (
- NativeDisplay native_dpy /* implementation specific */
-);
-
/*
* Initialize the library
*/
diff --git a/src/va_backend.h b/src/va_backend.h
index 45aee4a..336f6e0 100755
--- a/src/va_backend.h
+++ b/src/va_backend.h
@@ -36,6 +36,7 @@
typedef struct VADriverContext *VADriverContextP;
+typedef struct VADisplayContext *VADisplayContextP;
struct VADriverVTable
{
@@ -390,7 +391,7 @@ struct VADriverVTable
struct VADriverContext
{
- VADriverContextP pNext;
+ void *old_pNext; /* preserved for binary compatibility */
void *pDriverData;
struct VADriverVTable vtable;
@@ -411,6 +412,25 @@ struct VADriverContext
void *handle; /* dlopen handle */
};
+struct VADisplayContext
+{
+ VADisplayContextP pNext;
+ VADriverContextP pDriverContext;
+
+ int (*vaIsValid) (
+ VADisplayContextP ctx
+ );
+
+ void (*vaDestroy) (
+ VADisplayContextP ctx
+ );
+
+ VAStatus (*vaGetDriverName) (
+ VADisplayContextP ctx,
+ char **driver_name
+ );
+};
+
typedef VAStatus (*VADriverInit) (
VADriverContextP driver_context
);
diff --git a/src/x11/Makefile b/src/x11/Makefile
new file mode 100644
index 0000000..5e4c2f8
--- /dev/null
+++ b/src/x11/Makefile
@@ -0,0 +1,498 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# src/x11/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+# 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.
+
+
+
+pkgdatadir = $(datadir)/libva
+pkglibdir = $(libdir)/libva
+pkgincludedir = $(includedir)/libva
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+subdir = src/x11
+DIST_COMMON = $(libva_x11include_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libva_x11_la_LIBADD =
+am_libva_x11_la_OBJECTS = va_x11.lo va_dri.lo
+libva_x11_la_OBJECTS = $(am_libva_x11_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libva_x11_la_SOURCES)
+DIST_SOURCES = $(libva_x11_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libva_x11includedir)"
+libva_x11includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(libva_x11include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /mnt/work/mrst-gfx/libva/missing --run aclocal-1.10
+AMTAR = ${SHELL} /mnt/work/mrst-gfx/libva/missing --run tar
+AR = ar
+AUTOCONF = ${SHELL} /mnt/work/mrst-gfx/libva/missing --run autoconf
+AUTOHEADER = ${SHELL} /mnt/work/mrst-gfx/libva/missing --run autoheader
+AUTOMAKE = ${SHELL} /mnt/work/mrst-gfx/libva/missing --run automake-1.10
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+CPP = gcc -E
+CPPFLAGS =
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DRM_CFLAGS = -I/usr//include -I/usr//include/drm
+DRM_LIBS = -L/usr//lib -ldrm
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+EXEEXT =
+F77 = gfortran
+FFLAGS = -g -O2
+GREP = /bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LDFLAGS =
+LIBOBJS =
+LIBS =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /mnt/work/mrst-gfx/libva/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+OBJEXT = o
+PACKAGE = libva
+PACKAGE_BUGREPORT = waldo.bastian@intel.com
+PACKAGE_NAME = libva
+PACKAGE_STRING = libva 0.30
+PACKAGE_TARNAME = libva
+PACKAGE_VERSION = 0.30
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+RANLIB = ranlib
+SED = /bin/sed
+SET_MAKE =
+SHELL = /bin/sh
+STRIP = strip
+VERSION = 0.30
+X11_CFLAGS = -I/usr//include
+X11_LIBS = -lX11
+XDAMAGE_CFLAGS = -I/usr//include
+XDAMAGE_LIBS = -L/usr//lib -lXdamage -lXfixes
+XEXT_CFLAGS = -I/usr//include
+XEXT_LIBS = -lXext
+Xfixes_CFLAGS = -I/usr//include
+Xfixes_LIBS = -L/usr//lib -lXfixes
+abs_builddir = /mnt/work/mrst-gfx/libva/src/x11
+abs_srcdir = /mnt/work/mrst-gfx/libva/src/x11
+abs_top_builddir = /mnt/work/mrst-gfx/libva
+abs_top_srcdir = /mnt/work/mrst-gfx/libva
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_F77 = gfortran
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = i686-pc-linux-gnu
+build_alias =
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i686-pc-linux-gnu
+host_alias =
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = $(SHELL) /mnt/work/mrst-gfx/libva/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+pkgconfigdir = ${exec_prefix}/lib/pkgconfig
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias =
+top_builddir = ../..
+top_srcdir = ../..
+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
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/x11/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/x11/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libva_x11.la: $(libva_x11_la_OBJECTS) $(libva_x11_la_DEPENDENCIES)
+ $(LINK) $(libva_x11_la_OBJECTS) $(libva_x11_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/va_dri.Plo
+include ./$(DEPDIR)/va_x11.Plo
+
+.c.o:
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(COMPILE) -c $<
+
+.c.obj:
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+# source='$<' object='$@' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-libva_x11includeHEADERS: $(libva_x11include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libva_x11includedir)" || $(MKDIR_P) "$(DESTDIR)$(libva_x11includedir)"
+ @list='$(libva_x11include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(libva_x11includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libva_x11includedir)/$$f'"; \
+ $(libva_x11includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libva_x11includedir)/$$f"; \
+ done
+
+uninstall-libva_x11includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libva_x11include_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(libva_x11includedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(libva_x11includedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(libva_x11includedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libva_x11includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libva_x11includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libva_x11includeHEADERS install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-libva_x11includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/x11/Makefile.am b/src/x11/Makefile.am
new file mode 100644
index 0000000..72bfebd
--- /dev/null
+++ b/src/x11/Makefile.am
@@ -0,0 +1,28 @@
+# 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/Makefile.in b/src/x11/Makefile.in
new file mode 100644
index 0000000..5c3916a
--- /dev/null
+++ b/src/x11/Makefile.in
@@ -0,0 +1,498 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# 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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/x11
+DIST_COMMON = $(libva_x11include_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libva_x11_la_LIBADD =
+am_libva_x11_la_OBJECTS = va_x11.lo va_dri.lo
+libva_x11_la_OBJECTS = $(am_libva_x11_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libva_x11_la_SOURCES)
+DIST_SOURCES = $(libva_x11_la_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libva_x11includedir)"
+libva_x11includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(libva_x11include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DRM_CFLAGS = @DRM_CFLAGS@
+DRM_LIBS = @DRM_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X11_CFLAGS = @X11_CFLAGS@
+X11_LIBS = @X11_LIBS@
+XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
+XDAMAGE_LIBS = @XDAMAGE_LIBS@
+XEXT_CFLAGS = @XEXT_CFLAGS@
+XEXT_LIBS = @XEXT_LIBS@
+Xfixes_CFLAGS = @Xfixes_CFLAGS@
+Xfixes_LIBS = @Xfixes_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+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
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/x11/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/x11/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libva_x11.la: $(libva_x11_la_OBJECTS) $(libva_x11_la_DEPENDENCIES)
+ $(LINK) $(libva_x11_la_OBJECTS) $(libva_x11_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/va_dri.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/va_x11.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-libva_x11includeHEADERS: $(libva_x11include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libva_x11includedir)" || $(MKDIR_P) "$(DESTDIR)$(libva_x11includedir)"
+ @list='$(libva_x11include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(libva_x11includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libva_x11includedir)/$$f'"; \
+ $(libva_x11includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libva_x11includedir)/$$f"; \
+ done
+
+uninstall-libva_x11includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libva_x11include_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(libva_x11includedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(libva_x11includedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(libva_x11includedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libva_x11includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libva_x11includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libva_x11includeHEADERS install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-libva_x11includeHEADERS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/x11/libva_x11.la b/src/x11/libva_x11.la
new file mode 100644
index 0000000..4b5a632
--- /dev/null
+++ b/src/x11/libva_x11.la
@@ -0,0 +1,35 @@
+# libva_x11.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.456 2007/06/24 02:25:32)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libva_x11.a'
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for libva_x11.
+current=
+age=
+revision=
+
+# Is this an already installed library?
+installed=no
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir=''
diff --git a/src/va_dri.c b/src/x11/va_dri.c
index ce3b7cd..ce3b7cd 100644
--- a/src/va_dri.c
+++ b/src/x11/va_dri.c
diff --git a/src/va_dri.h b/src/x11/va_dri.h
index 91f87a2..91f87a2 100644
--- a/src/va_dri.h
+++ b/src/x11/va_dri.h
diff --git a/src/x11/va_dri.lo b/src/x11/va_dri.lo
new file mode 100644
index 0000000..7be1939
--- /dev/null
+++ b/src/x11/va_dri.lo
@@ -0,0 +1,12 @@
+# va_dri.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.456 2007/06/24 02:25:32)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/va_dri.o'
+
+# Name of the non-PIC object.
+non_pic_object=none
+
diff --git a/src/va_dristr.h b/src/x11/va_dristr.h
index 3e391de..3e391de 100644
--- a/src/va_dristr.h
+++ b/src/x11/va_dristr.h
diff --git a/src/x11/va_x11.c b/src/x11/va_x11.c
new file mode 100644
index 0000000..2d129a9
--- /dev/null
+++ b/src/x11/va_x11.c
@@ -0,0 +1,206 @@
+/*
+ * 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/va_x11.h b/src/x11/va_x11.h
index a316162..9ef73cd 100755
--- a/src/va_x11.h
+++ b/src/x11/va_x11.h
@@ -17,12 +17,20 @@
#ifndef _VA_X11_H_
#define _VA_X11_H_
-#include "va.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,
diff --git a/src/x11/va_x11.lo b/src/x11/va_x11.lo
new file mode 100644
index 0000000..349f7da
--- /dev/null
+++ b/src/x11/va_x11.lo
@@ -0,0 +1,12 @@
+# va_x11.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.24 (1.1220.2.456 2007/06/24 02:25:32)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/va_x11.o'
+
+# Name of the non-PIC object.
+non_pic_object=none
+
diff --git a/test/test.c b/test/test.c
index b088487..41972c7 100644
--- a/test/test.c
+++ b/test/test.c
@@ -22,8 +22,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "va.h"
-#include "X11/Xlib.h"
+#include <va_x11.h>
#include "assert.h"
#include <stdarg.h>
diff --git a/test/test_12.c b/test/test_12.c
index 070d45c..9bdc1ef 100644
--- a/test/test_12.c
+++ b/test/test_12.c
@@ -24,16 +24,13 @@
#define TEST_DESCRIPTION "Sample MPEG2 VLD Decoding"
+#include <va_x11.h>
#include "test_common.c"
-#include <X11/Xlib.h>
-
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include "va_x11.h"
-
void pre()
{
test_init();
diff --git a/test/test_common.c b/test/test_common.c
index b3b4ccb..6b63748 100644
--- a/test/test_common.c
+++ b/test/test_common.c
@@ -22,8 +22,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "va.h"
-#include "X11/Xlib.h"
+#include <va_x11.h>
#include "assert.h"
#include <stdarg.h>
diff --git a/test/vainfo.c b/test/vainfo.c
index 09d34f6..f59ea89 100644
--- a/test/vainfo.c
+++ b/test/vainfo.c
@@ -22,8 +22,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "va.h"
-#include "X11/Xlib.h"
+#include <va_x11.h>
#include <stdarg.h>
#include <stdio.h>