• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revision3741b212147709a6127266de69a8b73dc1fd3409 (tree)
Zeit2013-06-19 15:34:12
AutorFei Jiang <fei.jiang@inte...>
CommiterXiang, Haihao

Log Message

LIBVA_DRIVER_NAME still needs va_getDriverName to open DRM device

va_getDriverName is bypassed when LIBVA_DRIVER_NAME is set, but driver
needs DRM device fd which is only opened in va_getDriverName

Change-Id: I4fe11edf9d8c328806255d4c93313cf99655a91d
Signed-off-by: Fei Jiang <fei.jiang@intel.com>
(cherry picked from commit 04706eb13ae410b53b6b38150413d544b7fdb524)

Ändern Zusammenfassung

Diff

--- a/va/va.c
+++ b/va/va.c
@@ -449,24 +449,30 @@ VAStatus vaInitialize (
449449
450450 va_infoMessage("VA-API version %s\n", VA_VERSION_S);
451451
452+ vaStatus = va_getDriverName(dpy, &driver_name);
453+ va_infoMessage("va_getDriverName() returns %d\n", vaStatus);
454+
452455 driver_name_env = getenv("LIBVA_DRIVER_NAME");
453- if (driver_name_env && geteuid() == getuid()) {
456+ if ((VA_STATUS_SUCCESS == vaStatus) &&
457+ driver_name_env && (geteuid() == getuid())) {
454458 /* Don't allow setuid apps to use LIBVA_DRIVER_NAME */
459+ if (driver_name) /* memory is allocated in va_getDriverName */
460+ free(driver_name);
461+
455462 driver_name = strdup(driver_name_env);
456463 vaStatus = VA_STATUS_SUCCESS;
457464 va_infoMessage("User requested driver '%s'\n", driver_name);
458- } else {
459- vaStatus = va_getDriverName(dpy, &driver_name);
460- va_infoMessage("va_getDriverName() returns %d\n", vaStatus);
461465 }
462466
463- if (VA_STATUS_SUCCESS == vaStatus) {
467+ if ((VA_STATUS_SUCCESS == vaStatus) && (driver_name != NULL)) {
464468 vaStatus = va_openDriver(dpy, driver_name);
465469 va_infoMessage("va_openDriver() returns %d\n", vaStatus);
466470
467471 *major_version = VA_MAJOR_VERSION;
468472 *minor_version = VA_MINOR_VERSION;
469- }
473+ } else
474+ va_errorMessage("va_getDriverName() failed with %s,driver_name=%s\n",
475+ vaErrorStr(vaStatus), driver_name);
470476
471477 if (driver_name)
472478 free(driver_name);