Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/nouveau Fix up some linux mut...
details: https://anonhg.NetBSD.org/src/rev/44be5564b9f6
branches: trunk
changeset: 992736:44be5564b9f6
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 07:38:42 2018 +0000
description:
Fix up some linux mutex init/destroy.
diffstat:
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c | 13 +++++++-
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c | 14 ++++++++-
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_aux.c | 13 +++++++-
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_bus.c | 13 +++++++-
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_pad.c | 13 +++++++-
5 files changed, 56 insertions(+), 10 deletions(-)
diffs (211 lines):
diff -r 1cde8fbe9193 -r 44be5564b9f6 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c Mon Aug 27 07:38:26 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv84_fence.c Mon Aug 27 07:38:42 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nv84_fence.c,v 1.4 2018/08/27 04:58:24 riastradh Exp $ */
+/* $NetBSD: nouveau_nv84_fence.c,v 1.5 2018/08/27 07:38:42 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nv84_fence.c,v 1.4 2018/08/27 04:58:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nv84_fence.c,v 1.5 2018/08/27 07:38:42 riastradh Exp $");
#include "nouveau_drm.h"
#include "nouveau_dma.h"
@@ -217,6 +217,11 @@
nouveau_bo_unpin(priv->bo);
nouveau_bo_ref(NULL, &priv->bo);
drm->fence = NULL;
+#ifdef __NetBSD__
+ linux_mutex_destroy(&priv->mutex);
+#else
+ mutex_destroy(&priv->mutex);
+#endif
kfree(priv);
}
@@ -242,7 +247,11 @@
priv->base.context_base = fence_context_alloc(priv->base.contexts);
priv->base.uevent = true;
+#ifdef __NetBSD__
+ linux_mutex_init(&priv->mutex);
+#else
mutex_init(&priv->mutex);
+#endif
/* Use VRAM if there is any ; otherwise fallback to system memory */
domain = drm->device.info.ram_size != 0 ? TTM_PL_FLAG_VRAM :
diff -r 1cde8fbe9193 -r 44be5564b9f6 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c Mon Aug 27 07:38:26 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c Mon Aug 27 07:38:42 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_engine_device_base.c,v 1.2 2018/08/27 04:58:31 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_engine_device_base.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
* Authors: Ben Skeggs
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.2 2018/08/27 04:58:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $");
#include "priv.h"
#include "acpi.h"
@@ -2303,6 +2303,12 @@
nvkm_subdev_del(&subdev);
}
+#ifdef __NetBSD__
+ linux_mutex_destroy(&device->mutex);
+#else
+ mutex_destroy(&device->mutex);
+#endif
+
nvkm_event_fini(&device->event);
#ifdef __NetBSD__
@@ -2573,7 +2579,11 @@
#endif
}
+#ifdef __NetBSD__
+ linux_mutex_init(&device->mutex);
+#else
mutex_init(&device->mutex);
+#endif
for (i = 0; i < NVKM_SUBDEV_NR; i++) {
#define _(s,m) case s: \
diff -r 1cde8fbe9193 -r 44be5564b9f6 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_aux.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_aux.c Mon Aug 27 07:38:26 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_aux.c Mon Aug 27 07:38:42 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_subdev_i2c_aux.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_subdev_i2c_aux.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $ */
/*
* Copyright 2009 Red Hat Inc.
@@ -24,7 +24,7 @@
* Authors: Ben Skeggs
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_aux.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_aux.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $");
#include "aux.h"
#include "pad.h"
@@ -141,6 +141,11 @@
AUX_TRACE(aux, "dtor");
list_del(&aux->head);
i2c_del_adapter(&aux->i2c);
+#ifdef __NetBSD__
+ linux_mutex_destroy(&aux->mutex);
+#else
+ mutex_destroy(&aux->mutex);
+#endif
kfree(*paux);
*paux = NULL;
}
@@ -156,7 +161,11 @@
aux->func = func;
aux->pad = pad;
aux->id = id;
+#ifdef __NetBSD__
+ linux_mutex_init(&aux->mutex);
+#else
mutex_init(&aux->mutex);
+#endif
list_add_tail(&aux->head, &pad->i2c->aux);
AUX_TRACE(aux, "ctor");
diff -r 1cde8fbe9193 -r 44be5564b9f6 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_bus.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_bus.c Mon Aug 27 07:38:26 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_bus.c Mon Aug 27 07:38:42 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_subdev_i2c_bus.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_subdev_i2c_bus.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $ */
/*
* Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
* Authors: Ben Skeggs <bskeggs%redhat.com@localhost>
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_bus.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_bus.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $");
#include "bus.h"
#include "pad.h"
@@ -184,6 +184,11 @@
BUS_TRACE(bus, "dtor");
list_del(&bus->head);
i2c_del_adapter(&bus->i2c);
+#ifdef __NetBSD__
+ linux_mutex_destroy(&bus->mutex);
+#else
+ mutex_destroy(&bus->mutex);
+#endif
kfree(bus->i2c.algo_data);
kfree(*pbus);
*pbus = NULL;
@@ -207,7 +212,11 @@
bus->func = func;
bus->pad = pad;
bus->id = id;
+#ifdef __NetBSD__
+ linux_mutex_init(&bus->mutex);
+#else
mutex_init(&bus->mutex);
+#endif
list_add_tail(&bus->head, &pad->i2c->bus);
BUS_TRACE(bus, "ctor");
diff -r 1cde8fbe9193 -r 44be5564b9f6 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_pad.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_pad.c Mon Aug 27 07:38:26 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/i2c/nouveau_nvkm_subdev_i2c_pad.c Mon Aug 27 07:38:42 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_subdev_i2c_pad.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_subdev_i2c_pad.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $ */
/*
* Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
* Authors: Ben Skeggs <bskeggs%redhat.com@localhost>
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_pad.c,v 1.2 2018/08/27 04:58:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_i2c_pad.c,v 1.3 2018/08/27 07:38:42 riastradh Exp $");
#include "pad.h"
@@ -92,6 +92,11 @@
if (pad) {
PAD_TRACE(pad, "dtor");
list_del(&pad->head);
+#ifdef __NetBSD__
+ linux_mutex_destroy(&pad->mutex);
+#else
+ mutex_destroy(&pad->mutex);
+#endif
kfree(pad);
pad = NULL;
}
@@ -105,7 +110,11 @@
pad->i2c = i2c;
pad->id = id;
pad->mode = NVKM_I2C_PAD_OFF;
+#ifdef __NetBSD__
+ linux_mutex_init(&pad->mutex);
+#else
mutex_init(&pad->mutex);
+#endif
list_add_tail(&pad->head, &i2c->pad);
PAD_TRACE(pad, "ctor");
}
Home |
Main Index |
Thread Index |
Old Index