diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-01-02 17:44:53 +0100 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-04-03 18:26:24 +0200 |
commit | 0d1a407728804b9fc14ad850907483daec7e3e94 (patch) | |
tree | 3fd2a7460e867f76ffe7f9d50d7b04eaeb082772 /va/va.c | |
parent | 42a136508e5671eeb123d060933d4a29c5080540 (diff) | |
download | libva-0d1a407728804b9fc14ad850907483daec7e3e94.tar.gz |
Allow 0.32.x drivers.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'va/va.c')
-rw-r--r-- | va/va.c | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -205,10 +205,30 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name) } else { VADriverInit init_func = NULL; char init_func_s[256]; - if (va_getDriverInitName(init_func_s, sizeof(init_func_s), - VA_MAJOR_VERSION, VA_MINOR_VERSION)) - init_func = (VADriverInit) dlsym(handle, init_func_s); - if (!init_func) { + int i; + + static const struct { + int major; + int minor; + } compatible_versions[] = { + { VA_MAJOR_VERSION, VA_MINOR_VERSION }, + { 0, 32 }, + { -1, } + }; + + for (i = 0; compatible_versions[i].major >= 0; i++) { + if (va_getDriverInitName(init_func_s, sizeof(init_func_s), + compatible_versions[i].major, + compatible_versions[i].minor)) { + init_func = (VADriverInit)dlsym(handle, init_func_s); + if (init_func) { + va_infoMessage("Found init function %s\n", init_func_s); + break; + } + } + } + + if (compatible_versions[i].major < 0) { va_errorMessage("%s has no function %s\n", driver_path, init_func_s); dlclose(handle); |