[Libva] [PATCH 1/3] bugfix: do not skip drm calls in vaInitialize()

Lukasz Anaczkowski lukasz.anaczkowski at intel.com
Mon Feb 11 06:47:13 PST 2013


Some drm calls from va_getDriverName() are required even when
using shell variable to set video driver name.
Otherwise, drm errors occur.

Change-Id: Iaf3d06d1b36af27de4ec5befc7d6600173aa1264
Signed-off-by: Lukasz Anaczkowski <lukasz.anaczkowski at intel.com>
---
 va/va.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/va/va.c b/va/va.c
index ddd105e..03f86e7 100644
--- a/va/va.c
+++ b/va/va.c
@@ -431,15 +431,15 @@ VAStatus vaInitialize (
 
     va_infoMessage("VA-API version %s\n", VA_VERSION_S);
 
+    vaStatus = va_getDriverName(dpy, &driver_name);
+    va_infoMessage("va_getDriverName() returns %d\n", vaStatus);
+    /* Look for env variable */
     driver_name_env = getenv("LIBVA_DRIVER_NAME");
     if (driver_name_env && geteuid() == getuid()) {
         /* Don't allow setuid apps to use LIBVA_DRIVER_NAME */
+        free(driver_name); // drop name from DRM
         driver_name = strdup(driver_name_env);
-        vaStatus = VA_STATUS_SUCCESS;
         va_infoMessage("User requested driver '%s'\n", driver_name);
-    } else {
-        vaStatus = va_getDriverName(dpy, &driver_name);
-        va_infoMessage("va_getDriverName() returns %d\n", vaStatus);
     }
 
     if (VA_STATUS_SUCCESS == vaStatus) {
-- 
1.7.9.5

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk

Sad Rejonowy Gdansk Polnoc w Gdansku, 
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
numer KRS 101882

NIP 957-07-52-316
Kapital zakladowy 200.000 zl

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the Libva mailing list