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 Mark some NetBSDisms ...



details:   https://anonhg.NetBSD.org/src/rev/c6da7b5df019
branches:  trunk
changeset: 366338:c6da7b5df019
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:54:32 2018 +0000

description:
Mark some NetBSDisms as such.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/ioctl.h                                 |   7 +++-
 sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/object.h                           |   8 +++++-
 sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/engine/dma.h                            |   4 ++-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c                 |  14 ++++++++-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_oproxy.c                 |  12 +++++++-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_user.c |  10 +++++-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_channv50.c |  10 +++++-
 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_chan.c     |  10 +++++-
 8 files changed, 61 insertions(+), 14 deletions(-)

diffs (265 lines):

diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/ioctl.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/ioctl.h       Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/ioctl.h       Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ioctl.h,v 1.3 2018/08/27 07:35:56 riastradh Exp $      */
+/*     $NetBSD: ioctl.h,v 1.4 2018/08/27 14:54:32 riastradh Exp $      */
 
 #ifndef __NVIF_IOCTL_H__
 #define __NVIF_IOCTL_H__
@@ -20,7 +20,10 @@
 #define NVIF_IOCTL_V0_NTFY_DEL                                             0x0a
 #define NVIF_IOCTL_V0_NTFY_GET                                             0x0b
 #define NVIF_IOCTL_V0_NTFY_PUT                                             0x0c
-#define NVIF_IOCTL_V0_MAP_NETBSD                                          0x0d
+#ifdef __NetBSD__
+/* XXX Kludge for NetBSD kernel-only use.  */
+#define NVIF_IOCTL_V0_MAP_NETBSD                                           0x0d
+#endif
        __u8  type;
        __u8  pad02[4];
 #define NVIF_IOCTL_V0_OWNER_NVIF                                           0x00
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/object.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/object.h Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/object.h Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: object.h,v 1.4 2018/08/27 07:36:07 riastradh Exp $     */
+/*     $NetBSD: object.h,v 1.5 2018/08/27 14:54:32 riastradh Exp $     */
 
 #ifndef __NVKM_OBJECT_H__
 #define __NVKM_OBJECT_H__
@@ -21,7 +21,9 @@
        u64 token;
        u64 object;
        struct rb_node node;
+#ifdef __NetBSD__
        bool on_tree;
+#endif
 };
 
 struct nvkm_object_func {
@@ -60,8 +62,12 @@
 int nvkm_object_fini(struct nvkm_object *, bool suspend);
 int nvkm_object_mthd(struct nvkm_object *, u32 mthd, void *data, u32 size);
 int nvkm_object_ntfy(struct nvkm_object *, u32 mthd, struct nvkm_event **);
+#ifdef __NetBSD__
 int nvkm_object_map(struct nvkm_object *, bus_space_tag_t *, u64 *addr,
     u32 *size);
+#else
+int nvkm_object_map(struct nvkm_object *, u64 *addr, u32 *size);
+#endif
 int nvkm_object_rd08(struct nvkm_object *, u64 addr, u8  *data);
 int nvkm_object_rd16(struct nvkm_object *, u64 addr, u16 *data);
 int nvkm_object_rd32(struct nvkm_object *, u64 addr, u32 *data);
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/engine/dma.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/engine/dma.h  Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/engine/dma.h  Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dma.h,v 1.3 2018/08/27 07:36:07 riastradh Exp $        */
+/*     $NetBSD: dma.h,v 1.4 2018/08/27 14:54:32 riastradh Exp $        */
 
 #ifndef __NVKM_DMA_H__
 #define __NVKM_DMA_H__
@@ -16,7 +16,9 @@
        u64 limit;
 
        struct rb_node rb;
+#ifdef __NetBSD__
        bool on_tree;
+#endif
        u64 handle; /*XXX HANDLE MERGE */
 };
 
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c       Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c       Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_core_object.c,v 1.5 2018/08/27 07:39:20 riastradh Exp $   */
+/*     $NetBSD: nouveau_nvkm_core_object.c,v 1.6 2018/08/27 14:54:33 riastradh Exp $   */
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_object.c,v 1.5 2018/08/27 07:39:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_object.c,v 1.6 2018/08/27 14:54:33 riastradh Exp $");
 
 #include <core/object.h>
 #include <core/client.h>
@@ -47,6 +47,7 @@
        return -ENODEV;
 }
 
+#ifdef __NetBSD__
 int
 nvkm_object_map(struct nvkm_object *object, bus_space_tag_t *tagp, u64 *addr,
     u32 *size)
@@ -55,6 +56,15 @@
                return object->func->map(object, tagp, addr, size);
        return -ENODEV;
 }
+#else
+int
+nvkm_object_map(struct nvkm_object *object, u64 *addr, u32 *size)
+{
+       if (likely(object->func->map))
+               return object->func->map(object, addr, size);
+       return -ENODEV;
+}
+#endif
 
 int
 nvkm_object_rd08(struct nvkm_object *object, u64 addr, u8 *data)
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_oproxy.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_oproxy.c       Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_oproxy.c       Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_core_oproxy.c,v 1.3 2018/08/27 07:35:56 riastradh Exp $   */
+/*     $NetBSD: nouveau_nvkm_core_oproxy.c,v 1.4 2018/08/27 14:54:33 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_core_oproxy.c,v 1.3 2018/08/27 07:35:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_oproxy.c,v 1.4 2018/08/27 14:54:33 riastradh Exp $");
 
 #include <core/oproxy.h>
 
@@ -41,12 +41,20 @@
        return nvkm_object_ntfy(nvkm_oproxy(object)->object, mthd, pevent);
 }
 
+#ifdef __NetBSD__
 static int
 nvkm_oproxy_map(struct nvkm_object *object, bus_space_tag_t *tagp, u64 *addr,
     u32 *size)
 {
        return nvkm_object_map(nvkm_oproxy(object)->object, tagp, addr, size);
 }
+#else
+static int
+nvkm_oproxy_map(struct nvkm_object *object, u64 *addr, u32 *size)
+{
+       return nvkm_object_map(nvkm_oproxy(object)->object, addr, size);
+}
+#endif
 
 static int
 nvkm_oproxy_rd08(struct nvkm_object *object, u64 addr, u8 *data)
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_user.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_user.c       Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_user.c       Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_engine_device_user.c,v 1.5 2018/08/27 14:18:04 riastradh Exp $    */
+/*     $NetBSD: nouveau_nvkm_engine_device_user.c,v 1.6 2018/08/27 14:54:33 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_user.c,v 1.5 2018/08/27 14:18:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_user.c,v 1.6 2018/08/27 14:54:33 riastradh Exp $");
 
 #define nvkm_udevice(p) container_of((p), struct nvkm_udevice, object)
 #include "priv.h"
@@ -205,12 +205,18 @@
 }
 
 static int
+#ifdef __NetBSD__
 nvkm_udevice_map(struct nvkm_object *object, bus_space_tag_t *tagp, u64 *addr,
     u32 *size)
+#else
+nvkm_udevice_map(struct nvkm_object *object, u64 *addr, u32 *size)
+#endif
 {
        struct nvkm_udevice *udev = nvkm_udevice(object);
        struct nvkm_device *device = udev->device;
+#ifdef __NetBSD__
        *tagp = device->func->resource_tag(device, 0);
+#endif
        *addr = device->func->resource_addr(device, 0);
        *size = device->func->resource_size(device, 0);
        return 0;
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_channv50.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_channv50.c       Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_channv50.c       Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_engine_disp_channv50.c,v 1.4 2018/08/27 07:38:56 riastradh Exp $  */
+/*     $NetBSD: nouveau_nvkm_engine_disp_channv50.c,v 1.5 2018/08/27 14:54:33 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_disp_channv50.c,v 1.4 2018/08/27 07:38:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_disp_channv50.c,v 1.5 2018/08/27 14:54:33 riastradh Exp $");
 
 #include "channv50.h"
 #include "rootnv50.h"
@@ -195,13 +195,19 @@
 }
 
 static int
+#ifdef __NetBSD__
 nv50_disp_chan_map(struct nvkm_object *object, bus_space_tag_t *tagp,
     u64 *addr, u32 *size)
+#else
+nv50_disp_chan_map(struct nvkm_object *object, u64 *addr, u32 *size)
+#endif
 {
        struct nv50_disp_chan *chan = nv50_disp_chan(object);
        struct nv50_disp *disp = chan->root->disp;
        struct nvkm_device *device = disp->base.engine.subdev.device;
+#ifdef __NetBSD__
        *tagp = device->func->resource_tag(device, 0);
+#endif
        *addr = device->func->resource_addr(device, 0) +
                0x640000 + (chan->chid * 0x1000);
        *size = 0x001000;
diff -r 09632d7b4699 -r c6da7b5df019 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_chan.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_chan.c   Mon Aug 27 14:54:08 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_chan.c   Mon Aug 27 14:54:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvkm_engine_fifo_chan.c,v 1.7 2018/08/27 14:51:55 riastradh Exp $      */
+/*     $NetBSD: nouveau_nvkm_engine_fifo_chan.c,v 1.8 2018/08/27 14:54:33 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_fifo_chan.c,v 1.7 2018/08/27 14:51:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_fifo_chan.c,v 1.8 2018/08/27 14:54:33 riastradh Exp $");
 
 #include "chan.h"
 
@@ -258,12 +258,18 @@
 }
 
 static int
+#ifdef __NetBSD__
 nvkm_fifo_chan_map(struct nvkm_object *object, bus_space_tag_t *tagp,
     u64 *addr, u32 *size)
+#else
+nvkm_fifo_chan_map(struct nvkm_object *object, u64 *addr, u32 *size)
+#endif
 {
        struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object);
+#ifdef __NetBSD__
        /* XXX Uh oh.  Can't map this more than once.  OK?  */
        *tagp = chan->bst;
+#endif
        *addr = chan->addr;
        *size = chan->size;
        return 0;



Home | Main Index | Thread Index | Old Index