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/core dtor gets called...
details: https://anonhg.NetBSD.org/src/rev/da7758fc9f0d
branches: trunk
changeset: 343519:da7758fc9f0d
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Feb 10 17:10:47 2016 +0000
description:
dtor gets called if ctor fails. Make it work in that case.
diffstat:
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c | 10 +++++++---
sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/fifo.h | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
diffs (49 lines):
diff -r 297bf783de5a -r da7758fc9f0d sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c Wed Feb 10 06:30:23 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_base.c Wed Feb 10 17:10:47 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_engine_fifo_base.c,v 1.3 2014/08/23 08:03:33 riastradh Exp $ */
+/* $NetBSD: nouveau_engine_fifo_base.c,v 1.4 2016/02/10 17:10:47 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_base.c,v 1.3 2014/08/23 08:03:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_base.c,v 1.4 2016/02/10 17:10:47 riastradh Exp $");
#include <core/client.h>
#include <core/object.h>
@@ -98,6 +98,7 @@
addr + (chan->chid * size), size, 0, &chan->bsh);
if (ret)
return ret;
+ chan->mapped = true;
#else
chan->user = ioremap(nv_device_resource_start(device, bar) + addr +
(chan->chid * size), size);
@@ -118,7 +119,10 @@
unsigned long flags;
#ifdef __NetBSD__
- bus_space_unmap(chan->bst, chan->bsh, chan->size);
+ if (chan->mapped) {
+ bus_space_unmap(chan->bst, chan->bsh, chan->size);
+ chan->mapped = false;
+ }
#else
iounmap(chan->user);
#endif
diff -r 297bf783de5a -r da7758fc9f0d sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/fifo.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/fifo.h Wed Feb 10 06:30:23 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/include/engine/fifo.h Wed Feb 10 17:10:47 2016 +0000
@@ -12,6 +12,7 @@
#ifdef __NetBSD__
bus_space_tag_t bst;
bus_space_handle_t bsh;
+ bool mapped;
#else
void __iomem *user;
#endif
Home |
Main Index |
Thread Index |
Old Index