summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-04-06 14:31:42 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-07-27 15:15:40 +0200
commit841f2c468f8c4bbd4009855abdde958c399a538b (patch)
tree3d87149f07efeadbaad01519ce9d80ad12d90684
parent94514afa432a5d03893cca6c5eafd3dea483feaa (diff)
API: backend: add VA display types.{merged}/staging.10.drm_base
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--va/android/va_android.cpp1
-rw-r--r--va/glx/va_glx.c1
-rw-r--r--va/va_backend.h18
-rw-r--r--va/x11/va_x11.c1
4 files changed, 20 insertions, 1 deletions
diff --git a/va/android/va_android.cpp b/va/android/va_android.cpp
index b811afc..5612c3c 100644
--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -223,6 +223,7 @@ VADisplay vaGetDisplay (
pDisplayContext->vadpy_magic = VA_DISPLAY_MAGIC;
pDriverContext->native_dpy = (void *)native_dpy;
+ pDriverContext->display_type = VA_DISPLAY_ANDROID;
pDisplayContext->pDriverContext = pDriverContext;
pDisplayContext->vaIsValid = va_DisplayContextIsValid;
pDisplayContext->vaDestroy = va_DisplayContextDestroy;
diff --git a/va/glx/va_glx.c b/va/glx/va_glx.c
index 1812ef5..e03847e 100644
--- a/va/glx/va_glx.c
+++ b/va/glx/va_glx.c
@@ -98,6 +98,7 @@ VADisplay vaGetDisplayGLX(Display *native_dpy)
if (!pDriverContextGLX)
goto error;
+ pDriverContext->display_type = VA_DISPLAY_GLX;
pDisplayContextGLX->vaDestroy = pDisplayContext->vaDestroy;
pDisplayContext->vaDestroy = va_DisplayContextDestroy;
pDisplayContext->opaque = pDisplayContextGLX;
diff --git a/va/va_backend.h b/va/va_backend.h
index 1e04a9c..72e8d7d 100644
--- a/va/va_backend.h
+++ b/va/va_backend.h
@@ -38,6 +38,19 @@
typedef struct VADriverContext *VADriverContextP;
typedef struct VADisplayContext *VADisplayContextP;
+/** \brief VA display types. */
+enum {
+ /** \brief Mask to major identifier for VA display type. */
+ VA_DISPLAY_MAJOR_MASK = 0xf0,
+
+ /** \brief VA/X11 API is used, through vaGetDisplay() entry-point. */
+ VA_DISPLAY_X11 = 0x10,
+ /** \brief VA/GLX API is used, through vaGetDisplayGLX() entry-point. */
+ VA_DISPLAY_GLX = (VA_DISPLAY_X11 | (1 << 0)),
+ /** \brief VA/Android API is used, through vaGetDisplay() entry-point. */
+ VA_DISPLAY_ANDROID = 0x20,
+};
+
struct VADriverVTable
{
VAStatus (*vaTerminate) ( VADriverContextP ctx );
@@ -474,7 +487,10 @@ struct VADriverContext
*/
struct VADriverVTableVPP *vtable_vpp;
- unsigned long reserved[44]; /* reserve for future add-ins, decrease the subscript accordingly */
+ /** \brief VA display type. */
+ unsigned long display_type;
+
+ unsigned long reserved[43]; /* reserve for future add-ins, decrease the subscript accordingly */
};
#define VA_DISPLAY_MAGIC 0x56414430 /* VAD0 */
diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c
index f81e30a..2aa579b 100644
--- a/va/x11/va_x11.c
+++ b/va/x11/va_x11.c
@@ -185,6 +185,7 @@ VADisplay vaGetDisplay (
pDisplayContext->vadpy_magic = VA_DISPLAY_MAGIC;
pDriverContext->native_dpy = (void *)native_dpy;
+ pDriverContext->display_type = VA_DISPLAY_X11;
pDisplayContext->pDriverContext = pDriverContext;
pDisplayContext->vaIsValid = va_DisplayContextIsValid;
pDisplayContext->vaDestroy = va_DisplayContextDestroy;