[PATCH xserver] glamor: Work around GEM usage
Thomas Hellstrom
thellstrom at vmware.com
Wed May 23 09:14:02 UTC 2018
KMS drivers are not required to support GEM. In particular, vmwgfx
doesn't support flink and handles and names are identical.
Getting a bo name should really be part of a lower level API, if needed,
but in the mean time work around this by setting the name identical to
the handle if GEM isn't supported.
This fixes modesetting driver dri2 on vmwgfx.
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
---
glamor/glamor_egl.c | 14 ++++++++++++--
test-driver | 10 +++++-----
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 123e9f2..a75a9b9 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -99,8 +99,18 @@ glamor_get_flink_name(int fd, int handle, int *name)
struct drm_gem_flink flink;
flink.handle = handle;
- if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0)
- return FALSE;
+ if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) {
+
+ /*
+ * Assume non-GEM kernels have names identical to the handle
+ */
+ if (errno == ENODEV) {
+ *name = handle;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+ }
*name = flink.name;
return TRUE;
}
diff --git a/test-driver b/test-driver
index de1e61d..b8521a4 100755
--- a/test-driver
+++ b/test-driver
@@ -1,9 +1,9 @@
-#!/bin/sh
+#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -140,7 +140,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
--
2.17.0
More information about the xorg-devel
mailing list