summaryrefslogtreecommitdiff
path: root/src/va.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/va.c')
-rw-r--r--src/va.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/va.c b/src/va.c
index de2d2d8..b409c7c 100644
--- a/src/va.c
+++ b/src/va.c
@@ -22,11 +22,10 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#define _GNU_SOURCE 1
#include "va.h"
#include "va_backend.h"
-#include "va_version.h"
-
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
@@ -40,13 +39,9 @@
#include "va_dricommon.h"
-#define VA_STR_VERSION VA_BUILD_DATE VA_BUILD_GIT
-
-#define VA_MAJOR_VERSION 0
-#define VA_MINOR_VERSION 30
#define DRIVER_INIT_FUNC "__vaDriverInit_0_30"
+#define DRIVER_INIT_FUNC_SDS "__vaDriverInit_0_30_sds"
-#define DEFAULT_DRIVER_DIR "/usr/lib/dri/"
#define DRIVER_EXTENSION "_drv_video.so"
#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
@@ -116,21 +111,8 @@ static Bool va_checkString(const char* value, char *variable)
static VAStatus va_getDriverName(VADisplay dpy, char **driver_name)
{
VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
- VADriverContextP ctx = CTX(dpy);
- VAStatus ret;
- ret = pDisplayContext->vaGetDriverName(pDisplayContext, driver_name);
- if (ret == VA_STATUS_SUCCESS)
- {
- if (isDRI2Connected(ctx, driver_name))
- {
- ret = VA_STATUS_SUCCESS;
- } else if (isDRI1Connected(ctx, driver_name))
- {
- ret = VA_STATUS_SUCCESS;
- }
- }
- return ret;
+ return pDisplayContext->vaGetDriverName(pDisplayContext, driver_name);
}
static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
@@ -152,7 +134,7 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
}
if (!search_path)
{
- search_path = DEFAULT_DRIVER_DIR;
+ search_path = VA_DRIVERS_PATH;
}
search_path = strdup((const char *)search_path);
@@ -185,6 +167,11 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC);
if (!init_func)
{
+ /* Then try SDS extensions (VDPAU and XvBA backends) */
+ init_func = (VADriverInit) dlsym(handle, DRIVER_INIT_FUNC_SDS);
+ }
+ if (!init_func)
+ {
va_errorMessage("%s has no function %s\n", driver_path, DRIVER_INIT_FUNC);
dlclose(handle);
}
@@ -347,7 +334,7 @@ VAStatus vaInitialize (
va_debug_trace = (getenv("LIBVA_DEBUG_TRACE") != NULL);
- va_infoMessage("libva build on %s\n", VA_STR_VERSION);
+ va_infoMessage("libva version %s\n", VA_VERSION_S);
vaStatus = va_getDriverName(dpy, &driver_name);
va_infoMessage("va_getDriverName() returns %d\n", vaStatus);