summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/drmtest.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/drmtest.c b/tests/drmtest.c
index a685102d..022994a0 100644
--- a/tests/drmtest.c
+++ b/tests/drmtest.c
@@ -62,7 +62,7 @@ int drm_open_matching(const char *pci_glob, int flags)
struct udev_device *device, *parent;
struct udev_list_entry *entry;
const char *pci_id, *path;
- const char *usub;
+ const char *usub, *dnode;
int fd;
udev = udev_new();
@@ -86,7 +86,10 @@ int drm_open_matching(const char *pci_glob, int flags)
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (fnmatch(pci_glob, pci_id, 0) != 0)
continue;
- fd = open(udev_device_get_devnode(device), O_RDWR);
+ dnode = udev_device_get_devnode(device);
+ if (strstr(dnode, "control"))
+ continue;
+ fd = open(dnode, O_RDWR);
if (fd < 0)
continue;
if ((flags & DRM_TEST_MASTER) && !is_master(fd)) {
@@ -109,7 +112,7 @@ int drm_open_any(void)
if (fd < 0) {
fprintf(stderr, "failed to open any drm device\n");
- abort();
+ exit(0);
}
return fd;
@@ -124,7 +127,7 @@ int drm_open_any_master(void)
if (fd < 0) {
fprintf(stderr, "failed to open any drm device\n");
- abort();
+ exit(0);
}
return fd;
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Rickard E. (Rik) Faith <faith@valinux.com> * Gareth Hughes <gareth@valinux.com> * * $FreeBSD: src/sys/dev/drm/drm_lock.h,v 1.3 2003/04/25 01:18:46 anholt Exp $ */ #include "drmP.h" int DRM(lock_take)(__volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new; do { old = *lock; if (old & _DRM_LOCK_HELD) new = old | _DRM_LOCK_CONT; else new = context | _DRM_LOCK_HELD; } while (!atomic_cmpset_int(lock, old, new)); if (_DRM_LOCKING_CONTEXT(old) == context) { if (old & _DRM_LOCK_HELD) { if (context != DRM_KERNEL_CONTEXT) { DRM_ERROR("%d holds heavyweight lock\n", context); } return 0; } } if (new == (context | _DRM_LOCK_HELD)) { /* Have lock */ return 1; } return 0; } /* This takes a lock forcibly and hands it to context. Should ONLY be used inside *_unlock to give lock to kernel before calling *_dma_schedule. */ int DRM(lock_transfer)(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new; dev->lock.filp = NULL; do { old = *lock; new = context | _DRM_LOCK_HELD; } while (!atomic_cmpset_int(lock, old, new)); return 1; } int DRM(lock_free)(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new; dev->lock.filp = NULL; do { old = *lock; new = 0; } while (!atomic_cmpset_int(lock, old, new)); if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { DRM_ERROR("%d freed heavyweight lock held by %d\n", context, _DRM_LOCKING_CONTEXT(old)); return 1; } DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); return 0; }