summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2021-04-02 15:43:45 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2021-04-08 09:38:17 +0800
commit0193751ce844776ef1823f99aff053ee423f7004 (patch)
tree267d8183296819f775ed3ba9285ebefd4b03e0ea
parent993d46bb2ff28169b269e4a9f951539cc2da6f24 (diff)
libs: display: drm: don't fallback to default device if explicitly specified device can't load/init
Otherwise user will be misled that the specified device is using This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/issues/305 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/422>
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay_drm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_drm.c b/gst-libs/gst/vaapi/gstvaapidisplay_drm.c
index c4e5001d..1fc376a5 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay_drm.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay_drm.c
@@ -350,15 +350,15 @@ gst_vaapi_display_drm_new (const gchar * device_path)
} else {
const gchar *user_choice = g_getenv ("GST_VAAPI_DRM_DEVICE");
- if (user_choice && g_str_has_prefix (user_choice, "/dev/dri/")) {
+ if (user_choice) {
device_paths[num_types] = (gpointer) user_choice;
types[num_types++] = 0;
+ } else {
+ device_paths[num_types] = (gpointer) device_path;
+ types[num_types++] = DRM_DEVICE_RENDERNODES;
+ device_paths[num_types] = (gpointer) device_path;
+ types[num_types++] = DRM_DEVICE_LEGACY;
}
-
- device_paths[num_types] = (gpointer) device_path;
- types[num_types++] = DRM_DEVICE_RENDERNODES;
- device_paths[num_types] = (gpointer) device_path;
- types[num_types++] = DRM_DEVICE_LEGACY;
}
for (i = 0; i < num_types; i++) {