summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Teng <rui.teng@amd.com>2019-03-04 11:15:15 +0800
committerRui Teng <rui.teng@amd.com>2019-03-04 11:16:04 +0800
commitf821c46246bb0f5340e002c8fb2ea67b8eda4784 (patch)
treebaa53c9ac96addac617bb10df7e995c6dcb540d2
parent394183f4f5fe8b9a96e7378b227e902a8680b7a5 (diff)
parent5fc9a7b102681a7cf20bf84444d275416e07a4fd (diff)
Merge amd-staging-hybrid-master20190125 into amd-mainline-hybrid-master20190125
Change-Id: Ibda352207e8d5be9f1555decadb9e7334c8695bf Signed-off-by: Rui Teng <rui.teng@amd.com>
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--freedreno/freedreno_ringbuffer.h3
-rw-r--r--xf86atomic.h2
-rw-r--r--xf86drm.c23
4 files changed, 27 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a0edfdff..ac2a9d2d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -55,7 +55,7 @@
latest-meson:
stage: build
- image: base/archlinux:latest
+ image: archlinux/base:latest
before_script:
- pacman -Syu --noconfirm --needed
base-devel
@@ -69,7 +69,7 @@ latest-meson:
latest-autotools:
stage: build
- image: base/archlinux:latest
+ image: archlinux/base:latest
artifacts: *artifacts-autotools
before_script:
- pacman -Syu --noconfirm --needed
diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h
index 1a1e8425..bc41a31c 100644
--- a/freedreno/freedreno_ringbuffer.h
+++ b/freedreno/freedreno_ringbuffer.h
@@ -29,7 +29,6 @@
#ifndef FREEDRENO_RINGBUFFER_H_
#define FREEDRENO_RINGBUFFER_H_
-#include <xf86atomic.h>
#include <freedreno_drmif.h>
/* the ringbuffer object is not opaque so that OUT_RING() type stuff
@@ -84,7 +83,9 @@ struct fd_ringbuffer {
* be inlined for performance reasons.
*/
union {
+#ifdef HAS_ATOMIC_OPS
atomic_t refcnt;
+#endif
uint64_t __pad;
};
};
diff --git a/xf86atomic.h b/xf86atomic.h
index e268d274..2d733bd5 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -101,8 +101,6 @@ typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
#error libdrm requires atomic operations, please define them for your CPU/compiler.
#endif
-#undef HAS_ATOMIC_OPS
-
static inline int atomic_add_unless(atomic_t *v, int add, int unless)
{
int c, old;
diff --git a/xf86drm.c b/xf86drm.c
index d006bb38..cbae3e28 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -586,11 +586,34 @@ static int drmOpenByBusid(const char *busid, int type)
if (base < 0)
return -1;
+ /* We need to try for 1.4 first for proper PCI domain support */
drmMsg("drmOpenByBusid: Searching for BusID %s\n", busid);
for (i = base; i < base + DRM_MAX_MINOR; i++) {
fd = drmOpenMinor(i, 1, type);
drmMsg("drmOpenByBusid: drmOpenMinor returns %d\n", fd);
if (fd >= 0) {
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 4;
+ sv.drm_dd_major = -1; /* Don't care */
+ sv.drm_dd_minor = -1; /* Don't care */
+ if (!drmSetInterfaceVersion(fd, &sv)) {
+ buf = drmGetBusid(fd);
+ drmMsg("drmOpenByBusid: drmGetBusid reports %s\n", buf);
+ if (buf && drmMatchBusID(buf, busid, 1)) {
+ drmFreeBusid(buf);
+ return fd;
+ }
+ if (buf)
+ drmFreeBusid(buf);
+ }
+ close(fd);
+ }
+ }
+
+ for (i = base; i < base + DRM_MAX_MINOR; i++) {
+ fd = drmOpenMinor(i, 1, type);
+ drmMsg("drmOpenByBusid: drmOpenMinor returns %d\n", fd);
+ if (fd >= 0) {
/* We need to try for 1.4 first for proper PCI domain support
* and if that fails, we know the kernel is busted
*/