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 Snapshot of nouveau. ...
details: https://anonhg.NetBSD.org/src/rev/9d39caacec07
branches: trunk
changeset: 331239:9d39caacec07
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Aug 06 13:35:13 2014 +0000
description:
Snapshot of nouveau. Doesn't build yet, but progress.
diffstat:
sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_handle.c | 6 +-
sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_object.c | 24 ++-
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/object.h | 17 +-
sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h | 30 +++
sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h | 5 +
sys/external/bsd/drm2/dist/drm/nouveau/core/os.h | 6 +
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c | 5 +-
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c | 76 +++++++++-
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.h | 10 +
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_chan.c | 10 +-
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c | 50 ++++++-
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.h | 5 +
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c | 15 +-
13 files changed, 236 insertions(+), 23 deletions(-)
diffs (truncated from 677 to 300 lines):
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_handle.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_handle.c Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_handle.c Wed Aug 06 13:35:13 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_core_handle.c,v 1.1.1.1 2014/08/06 12:36:23 riastradh Exp $ */
+/* $NetBSD: nouveau_core_handle.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_core_handle.c,v 1.1.1.1 2014/08/06 12:36:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_core_handle.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $");
#include <core/object.h>
#include <core/handle.h>
@@ -70,7 +70,7 @@
int
nouveau_handle_fini(struct nouveau_handle *handle, bool suspend)
{
- static char *name[2] = { "fini", "suspend" };
+ static const char *name[2] = { "fini", "suspend" };
struct nouveau_handle *item;
int ret;
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_object.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_object.c Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/core/nouveau_core_object.c Wed Aug 06 13:35:13 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_core_object.c,v 1.1.1.1 2014/08/06 12:36:23 riastradh Exp $ */
+/* $NetBSD: nouveau_core_object.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_core_object.c,v 1.1.1.1 2014/08/06 12:36:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_core_object.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $");
#include <core/object.h>
#include <core/parent.h>
@@ -35,8 +35,28 @@
#ifdef NOUVEAU_OBJECT_MAGIC
static struct list_head _objlist = LIST_HEAD_INIT(_objlist);
+#ifdef __NetBSD__
+static spinlock_t _objlist_lock;
+#else
static DEFINE_SPINLOCK(_objlist_lock);
#endif
+#endif
+
+#ifdef __NetBSD__
+void
+nouveau_objects_init(void)
+{
+
+ spin_lock_init(&_objlist_lock);
+}
+
+void
+nouveau_objects_fini(void)
+{
+
+ spin_lock_destroy(&_objlist_lock);
+}
+#endif
int
nouveau_object_create_(struct nouveau_object *parent,
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/object.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/object.h Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/object.h Wed Aug 06 13:35:13 2014 +0000
@@ -40,6 +40,11 @@
return obj;
}
+#ifdef __NetBSD__
+void nouveau_objcets_init(void);
+void nouveau_objects_fini(void);
+#endif
+
#define nouveau_object_create(p,e,c,s,d) \
nouveau_object_create_((p), (e), (c), (s), sizeof(**d), (void **)d)
int nouveau_object_create_(struct nouveau_object *, struct nouveau_object *,
@@ -136,7 +141,7 @@
nv_ro08(void *obj, u64 addr)
{
u8 data = nv_ofuncs(obj)->rd08(obj, addr);
- nv_spam(obj, "nv_ro08 0x%08llx 0x%02x\n", addr, data);
+ nv_spam(obj, "nv_ro08 0x%08"PRIx64" 0x%02x\n", addr, data);
return data;
}
@@ -144,7 +149,7 @@
nv_ro16(void *obj, u64 addr)
{
u16 data = nv_ofuncs(obj)->rd16(obj, addr);
- nv_spam(obj, "nv_ro16 0x%08llx 0x%04x\n", addr, data);
+ nv_spam(obj, "nv_ro16 0x%08"PRIx64" 0x%04x\n", addr, data);
return data;
}
@@ -152,28 +157,28 @@
nv_ro32(void *obj, u64 addr)
{
u32 data = nv_ofuncs(obj)->rd32(obj, addr);
- nv_spam(obj, "nv_ro32 0x%08llx 0x%08x\n", addr, data);
+ nv_spam(obj, "nv_ro32 0x%08"PRIx64" 0x%08x\n", addr, data);
return data;
}
static inline void
nv_wo08(void *obj, u64 addr, u8 data)
{
- nv_spam(obj, "nv_wo08 0x%08llx 0x%02x\n", addr, data);
+ nv_spam(obj, "nv_wo08 0x%08"PRIx64" 0x%02x\n", addr, data);
nv_ofuncs(obj)->wr08(obj, addr, data);
}
static inline void
nv_wo16(void *obj, u64 addr, u16 data)
{
- nv_spam(obj, "nv_wo16 0x%08llx 0x%04x\n", addr, data);
+ nv_spam(obj, "nv_wo16 0x%08"PRIx64" 0x%04x\n", addr, data);
nv_ofuncs(obj)->wr16(obj, addr, data);
}
static inline void
nv_wo32(void *obj, u64 addr, u32 data)
{
- nv_spam(obj, "nv_wo32 0x%08llx 0x%08x\n", addr, data);
+ nv_spam(obj, "nv_wo32 0x%08"PRIx64" 0x%08x\n", addr, data);
nv_ofuncs(obj)->wr32(obj, addr, data);
}
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h Wed Aug 06 13:35:13 2014 +0000
@@ -10,7 +10,13 @@
struct nouveau_object base;
struct mutex mutex;
const char *name;
+#ifdef __NetBSD__
+ bus_space_tag_t mmiot;
+ bus_space_handle_t mmioh;
+ bus_size_t mmiosz;
+#else
void __iomem *mmio;
+#endif
u32 debug;
u32 unit;
@@ -60,7 +66,11 @@
nv_rd08(void *obj, u32 addr)
{
struct nouveau_subdev *subdev = nv_subdev(obj);
+#ifdef __NetBSD__
+ u8 data = bus_space_read_stream_1(subdev->mmiot, subdev->mmioh, addr);
+#else
u8 data = ioread8(subdev->mmio + addr);
+#endif
nv_spam(subdev, "nv_rd08 0x%06x 0x%02x\n", addr, data);
return data;
}
@@ -69,7 +79,11 @@
nv_rd16(void *obj, u32 addr)
{
struct nouveau_subdev *subdev = nv_subdev(obj);
+#ifdef __NetBSD__
+ u16 data = bus_space_read_stream_2(subdev->mmiot, subdev->mmioh, addr);
+#else
u16 data = ioread16_native(subdev->mmio + addr);
+#endif
nv_spam(subdev, "nv_rd16 0x%06x 0x%04x\n", addr, data);
return data;
}
@@ -78,7 +92,11 @@
nv_rd32(void *obj, u32 addr)
{
struct nouveau_subdev *subdev = nv_subdev(obj);
+#ifdef __NetBSD__
+ u32 data = bus_space_read_stream_4(subdev->mmiot, subdev->mmioh, addr);
+#else
u32 data = ioread32_native(subdev->mmio + addr);
+#endif
nv_spam(subdev, "nv_rd32 0x%06x 0x%08x\n", addr, data);
return data;
}
@@ -88,7 +106,11 @@
{
struct nouveau_subdev *subdev = nv_subdev(obj);
nv_spam(subdev, "nv_wr08 0x%06x 0x%02x\n", addr, data);
+#ifdef __NetBSD__
+ bus_space_write_stream_1(subdev->mmiot, subdev->mmioh, addr, data);
+#else
iowrite8(data, subdev->mmio + addr);
+#endif
}
static inline void
@@ -96,7 +118,11 @@
{
struct nouveau_subdev *subdev = nv_subdev(obj);
nv_spam(subdev, "nv_wr16 0x%06x 0x%04x\n", addr, data);
+#ifdef __NetBSD__
+ bus_space_write_stream_2(subdev->mmiot, subdev->mmioh, addr, data);
+#else
iowrite16_native(data, subdev->mmio + addr);
+#endif
}
static inline void
@@ -104,7 +130,11 @@
{
struct nouveau_subdev *subdev = nv_subdev(obj);
nv_spam(subdev, "nv_wr32 0x%06x 0x%08x\n", addr, data);
+#ifdef __NetBSD__
+ bus_space_write_stream_4(subdev->mmiot, subdev->mmioh, addr, data);
+#else
iowrite32_native(data, subdev->mmio + addr);
+#endif
}
static inline u32
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/include/subdev/bar.h Wed Aug 06 13:35:13 2014 +0000
@@ -12,7 +12,12 @@
int (*alloc)(struct nouveau_bar *, struct nouveau_object *,
struct nouveau_mem *, struct nouveau_object **);
+#ifdef __NetBSD__
+ bus_space_tag_t bst;
+ bus_space_handle_t bsh;
+#else
void __iomem *iomem;
+#endif
int (*kmap)(struct nouveau_bar *, struct nouveau_mem *,
u32 flags, struct nouveau_vma *);
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/core/os.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/os.h Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/os.h Wed Aug 06 13:35:13 2014 +0000
@@ -21,6 +21,12 @@
#include <linux/interrupt.h>
#include <linux/log2.h>
#include <linux/pm_runtime.h>
+#include <linux/atomic.h>
+#include <linux/bug.h>
+#include <linux/kernel.h>
+#include <linux/kref.h>
+#include <linux/list.h>
+#include <linux/spinlock.h>
#include <asm/unaligned.h>
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c Wed Aug 06 13:35:13 2014 +0000
@@ -1,9 +1,10 @@
-/* $NetBSD: nouveau_agp.c,v 1.1.1.2 2014/08/06 12:36:23 riastradh Exp $ */
+/* $NetBSD: nouveau_agp.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $ */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_agp.c,v 1.1.1.2 2014/08/06 12:36:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_agp.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $");
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <core/device.h>
diff -r 24f6554300a8 -r 9d39caacec07 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c Wed Aug 06 12:52:19 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c Wed Aug 06 13:35:13 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_bo.c,v 1.1.1.2 2014/08/06 12:36:23 riastradh Exp $ */
+/* $NetBSD: nouveau_bo.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $ */
/*
* Copyright 2007 Dave Airlied
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.1.1.2 2014/08/06 12:36:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.2 2014/08/06 13:35:13 riastradh Exp $");
#include <core/engine.h>
#include <linux/swiotlb.h>
@@ -420,6 +420,58 @@
return 0;
}
+#ifdef __NetBSD__
Home |
Main Index |
Thread Index |
Old Index