summaryrefslogtreecommitdiff
path: root/multimedia/libva/patches/patch-va_va.c
blob: 976f8ef8b2b72165ee4895312c53e2b3d204cb2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-va_va.c,v 1.1 2017/02/24 16:44:03 maya Exp $

libva can currently (201702) only use gallium, having tested
for the definition of __vaDriverInit in libraries in DRIVER_SEARCH_PATH
(see package Makefile).

however, it doesn't guess the right driver name for nouveau, so force
it to use gallium.

--- va/va.c.orig	2016-11-10 01:04:28.000000000 +0000
+++ va/va.c
@@ -557,6 +557,17 @@ VAStatus vaInitialize (
         driver_name = strdup(driver_name_env);
         vaStatus = VA_STATUS_SUCCESS;
         va_infoMessage("User requested driver '%s'\n", driver_name);
+    } else {
+	/*
+	 * XXX 201702 only gallium works (provides the required __vaDriverInit)
+	 * XXX but the correct name is not guessed, so force it.
+	 */
+	if (driver_name) /* memory is allocated in va_getDriverName */
+		free(driver_name);
+
+	driver_name = strdup("gallium");
+	vaStatus = VA_STATUS_SUCCESS;
+	va_infoMessage("Using hard-coded gallium driver\n");
     }
 
     if ((VA_STATUS_SUCCESS == vaStatus) && (driver_name != NULL)) {