summaryrefslogtreecommitdiffstats
path: root/meta-emenlow/recipes-graphics/libva/libva-0.31.0/390_compat.base.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-emenlow/recipes-graphics/libva/libva-0.31.0/390_compat.base.patch')
-rw-r--r--meta-emenlow/recipes-graphics/libva/libva-0.31.0/390_compat.base.patch135
1 files changed, 135 insertions, 0 deletions
diff --git a/meta-emenlow/recipes-graphics/libva/libva-0.31.0/390_compat.base.patch b/meta-emenlow/recipes-graphics/libva/libva-0.31.0/390_compat.base.patch
new file mode 100644
index 00000000..f2e0d61b
--- /dev/null
+++ b/meta-emenlow/recipes-graphics/libva/libva-0.31.0/390_compat.base.patch
@@ -0,0 +1,135 @@
1commit 483bc9e67afa9bcd8f99f08a74a78e7dfad4651f
2Author: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>
3Date: Thu Jul 2 09:24:04 2009 +0000
4
5 Fix make dist (va_compat_template.h).
6
7commit 0e0da9ea861f14e8129767dbf6f11be5c051d85f
8Author: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>
9Date: Wed Jun 24 11:40:56 2009 +0000
10
11 Add compatibility layer with original libva 0.29.
12
13--- a/src/Makefile.am
14+++ b/src/Makefile.am
15@@ -44,7 +44,7 @@ libva_x11_la_DEPENDENCIES = $(libvacorelib)
16 libva_x11_la_DEPENDENCIES = $(libvacorelib)
17
18
19-libva_la_SOURCES = va.c
20+libva_la_SOURCES = va.c va_compat.c
21
22 libvaincludedir = ${includedir}/va
23 libvainclude_HEADERS = va.h va_backend.h va_version.h
24@@ -53,4 +53,8 @@ DISTCLEANFILES = \
25 va_version.h
26
27 EXTRA_DIST = \
28- va_version.h.in
29+ va_version.h.in \
30+ va_compat.h \
31+ va_compat_template.h
32+
33+va_compat.c: va_compat_template.h
34--- a/src/va.c
35+++ b/src/va.c
36@@ -25,6 +25,7 @@
37 #define _GNU_SOURCE 1
38 #include "va.h"
39 #include "va_backend.h"
40+#include "va_compat.h"
41
42 #include <assert.h>
43 #include <stdarg.h>
44@@ -41,6 +42,8 @@
45
46 #define DRIVER_INIT_FUNC "__vaDriverInit_0_31"
47 #define DRIVER_INIT_FUNC_SDS "__vaDriverInit_0_31_sds"
48+#define DRIVER_INIT_FUNC_0_29 "__vaDriverInit_0_29"
49+#define DRIVER_INIT_FUNC_0_30 "__vaDriverInit_0_30"
50
51 #define DRIVER_EXTENSION "_drv_video.so"
52
53@@ -168,11 +171,22 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
54 else
55 {
56 VADriverInit init_func;
57- init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC);
58+ int compat_version = 0;
59+ /* First, try SDS extensions (VDPAU and XvBA backends) */
60+ init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC_SDS);
61 if (!init_func)
62 {
63- /* Then try SDS extensions (VDPAU and XvBA backends) */
64- init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC_SDS);
65+ /* Otherwise, we need the compatibility layer for some buffers */
66+ init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC);
67+ compat_version = VA_MINOR_VERSION;
68+ if (!init_func) {
69+ init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC_0_29);
70+ compat_version = 29;
71+ }
72+ if (!init_func) {
73+ init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC_0_30);
74+ compat_version = 30;
75+ }
76 }
77 if (!init_func)
78 {
79@@ -181,7 +195,36 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
80 }
81 else
82 {
83- vaStatus = (*init_func)(ctx);
84+ struct VADriverContext_0_29 ctx_0_29;
85+ struct VADriverContext_0_30 ctx_0_30;
86+ void *compat_ctx = NULL;
87+
88+ switch (compat_version) {
89+ case 29:
90+ compat_ctx = &ctx_0_29;
91+ ctx_0_29.pDriverData = NULL;
92+ ctx_0_29.x11_dpy = ctx->x11_dpy;
93+ ctx_0_29.x11_screen = ctx->x11_screen;
94+ break;
95+ case 30:
96+ compat_ctx = &ctx_0_30;
97+ ctx_0_30.pDriverData = NULL;
98+ ctx_0_30.x11_dpy = ctx->x11_dpy;
99+ ctx_0_30.x11_screen = ctx->x11_screen;
100+ break;
101+ case VA_MINOR_VERSION:
102+ compat_ctx = ctx;
103+ break;
104+ default:
105+ ASSERT(compat_version == 0);
106+ vaStatus = VA_STATUS_ERROR_UNKNOWN;
107+ break;
108+ }
109+
110+ vaStatus = (*init_func)(compat_ctx ? compat_ctx : ctx);
111+
112+ if (VA_STATUS_SUCCESS == vaStatus)
113+ vaStatus = va_compat_init(dpy, compat_version, compat_ctx);
114
115 if (VA_STATUS_SUCCESS == vaStatus)
116 {
117@@ -377,6 +422,8 @@ VAStatus vaTerminate (
118 old_ctx->handle = NULL;
119 }
120
121+ va_compat_fini(dpy);
122+
123 if (VA_STATUS_SUCCESS == vaStatus)
124 pDisplayContext->vaDestroy(pDisplayContext);
125 return vaStatus;
126--- a/src/va_backend.h
127+++ b/src/va_backend.h
128@@ -426,6 +426,7 @@ struct VADriverContext
129
130 void *dri_state;
131 void *glx; /* opaque for GLX code */
132+ void *compat; /* opaque for compat code */
133 };
134
135 struct VADisplayContext