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 Be consistent about I/O byte ...
details: https://anonhg.NetBSD.org/src/rev/b08004f27e97
branches: trunk
changeset: 366329:b08004f27e97
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 14:51:33 2018 +0000
description:
Be consistent about I/O byte ordering.
Leave XXX comments where it's not clear what we should do.
diffstat:
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c | 12 +++---
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_gpuobj.c | 8 ++--
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c | 18 +++++-----
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_chan.c | 6 +-
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h | 10 ++--
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c | 8 ++--
sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c | 10 +++--
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c | 14 +++---
8 files changed, 44 insertions(+), 42 deletions(-)
diffs (truncated from 317 to 300 lines):
diff -r 0bc53f1e052d -r b08004f27e97 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c Mon Aug 27 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_bo.c,v 1.10 2018/08/27 07:32:40 riastradh Exp $ */
+/* $NetBSD: nouveau_bo.c,v 1.11 2018/08/27 14:51:33 riastradh Exp $ */
/*
* Copyright 2007 Dave Airlied
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.10 2018/08/27 07:32:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.11 2018/08/27 14:51:33 riastradh Exp $");
#include <linux/dma-mapping.h>
#include <linux/swiotlb.h>
@@ -551,7 +551,7 @@
v = *(const uint16_t __iomem *)ptr;
membar_consumer();
- return htole16(v);
+ return v;
}
static inline uint32_t
@@ -562,7 +562,7 @@
v = *(const uint32_t __iomem *)ptr;
membar_consumer();
- return htole32(v);
+ return v;
}
static inline void
@@ -570,7 +570,7 @@
{
membar_producer();
- *(uint16_t __iomem *)ptr = le16toh(v);
+ *(uint16_t __iomem *)ptr = v;
}
static inline void
@@ -578,7 +578,7 @@
{
membar_producer();
- *(uint32_t __iomem *)ptr = le32toh(v);
+ *(uint32_t __iomem *)ptr = v;
}
#endif
diff -r 0bc53f1e052d -r b08004f27e97 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_gpuobj.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_gpuobj.c Mon Aug 27 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_gpuobj.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_core_gpuobj.c,v 1.3 2018/08/27 07:36:18 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_core_gpuobj.c,v 1.4 2018/08/27 14:51: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_gpuobj.c,v 1.3 2018/08/27 07:36:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_gpuobj.c,v 1.4 2018/08/27 14:51:33 riastradh Exp $");
#include <core/gpuobj.h>
#include <core/engine.h>
@@ -46,7 +46,7 @@
# define iowrite32_native fake_iowrite32_native
static inline uint32_t
-fake_ioread32_native(const void __iomem *ptr)
+ioread32_native(const void __iomem *ptr)
{
uint32_t v;
@@ -57,7 +57,7 @@
}
static inline void
-fake_iowrite32_native(uint32_t v, void __iomem *ptr)
+iowrite32_native(uint32_t v, void __iomem *ptr)
{
membar_producer();
diff -r 0bc53f1e052d -r b08004f27e97 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 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_engine_device_base.c,v 1.7 2018/08/27 14:47:53 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_engine_device_base.c,v 1.8 2018/08/27 14:51: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_base.c,v 1.7 2018/08/27 14:47:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_base.c,v 1.8 2018/08/27 14:51:33 riastradh Exp $");
#include "priv.h"
#include "acpi.h"
@@ -2386,19 +2386,19 @@
ret = -bus_space_map(mmiot, mmio_base, 0x102000, 0, &mmioh);
if (ret)
goto done;
-#ifndef __BIG_ENDIAN /* XXX bus_space_read/write_4_stream? */
- if (bus_space_read_4(mmiot, mmioh, 4) != 0)
+#ifndef __BIG_ENDIAN
+ if (bus_space_read_stream_4(mmiot, mmioh, 4) != 0)
#else
- if (bus_space_read_4(mmiot, mmioh, 4) != 1)
+ if (bus_space_read_stream_4(mmiot, mmioh, 4) != 1)
#endif
{
- bus_space_write_4(mmiot, mmioh, 4, 0x01000001);
- bus_space_read_4(mmiot, mmioh, 0);
+ bus_space_write_stream_4(mmiot, mmioh, 4, 0x01000001);
+ bus_space_read_stream_4(mmiot, mmioh, 0);
}
/* read boot0 and strapping information */
- boot0 = bus_space_read_4(mmiot, mmioh, 0x000000);
- strap = bus_space_read_4(mmiot, mmioh, 0x101000);
+ boot0 = bus_space_read_stream_4(mmiot, mmioh, 0x000000);
+ strap = bus_space_read_stream_4(mmiot, mmioh, 0x101000);
bus_space_unmap(mmiot, mmioh, 0x102000);
#else
map = ioremap(mmio_base, 0x102000);
diff -r 0bc53f1e052d -r b08004f27e97 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:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/nouveau_nvkm_engine_fifo_chan.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_engine_fifo_chan.c,v 1.5 2018/08/27 14:18:43 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_engine_fifo_chan.c,v 1.6 2018/08/27 14:51: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.5 2018/08/27 14:18:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_fifo_chan.c,v 1.6 2018/08/27 14:51:33 riastradh Exp $");
#include "chan.h"
@@ -308,7 +308,7 @@
if (unlikely(addr + 4 > chan->size))
return -EINVAL;
#ifdef __NetBSD__
- *data = bus_space_read_4(chan->bst, chan->bsh, addr);
+ *data = bus_space_read_stream_4(chan->bst, chan->bsh, addr);
#else
*data = ioread32_native(chan->user + addr);
#endif
diff -r 0bc53f1e052d -r b08004f27e97 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h Mon Aug 27 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/devinit/fbmem.h Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fbmem.h,v 1.2 2018/08/27 04:58:33 riastradh Exp $ */
+/* $NetBSD: fbmem.h,v 1.3 2018/08/27 14:51:33 riastradh Exp $ */
/*
* Copyright (C) 2010 Francisco Jerez.
@@ -76,21 +76,21 @@
# define iowrite32 fake_iowrite32
static inline uint32_t
-fake_ioread32(const void __iomem *p)
+ioread32(const void __iomem *p)
{
const uint32_t v = *(const uint32_t __iomem *)p;
membar_consumer();
- return v;
+ return v; /* XXX nouveau byte order */
}
static inline void
-fake_iowrite32(uint32_t v, void __iomem *p)
+iowrite32(uint32_t v, void __iomem *p)
{
membar_producer();
- *(uint32_t __iomem *)p = v;
+ *(uint32_t __iomem *)p = v; /* XXX nouveau byte order */
}
#endif
diff -r 0bc53f1e052d -r b08004f27e97 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c Mon Aug 27 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.3 2018/08/27 07:36:28 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.4 2018/08/27 14:51: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_subdev_instmem_base.c,v 1.3 2018/08/27 07:36:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.4 2018/08/27 14:51:33 riastradh Exp $");
#include "priv.h"
@@ -95,7 +95,7 @@
# define iowrite32_native fake_iowrite32_native
static inline uint32_t
-fake_ioread32_native(const void __iomem *ptr)
+ioread32_native(const void __iomem *ptr)
{
uint32_t v;
@@ -106,7 +106,7 @@
}
static inline void
-fake_iowrite32_native(uint32_t v, void __iomem *ptr)
+iowrite32_native(uint32_t v, void __iomem *ptr)
{
membar_producer();
diff -r 0bc53f1e052d -r b08004f27e97 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c Mon Aug 27 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.3 2018/08/27 07:36:28 riastradh Exp $ */
+/* $NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.4 2018/08/27 14:51: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_subdev_instmem_nv40.c,v 1.3 2018/08/27 07:36:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.4 2018/08/27 14:51:33 riastradh Exp $");
#define nv40_instmem(p) container_of((p), struct nv40_instmem, base)
#include "priv.h"
@@ -95,7 +95,8 @@
struct nv40_instobj *iobj = nv40_instobj(memory);
#ifdef __NetBSD__
offset += iobj->node->offset;
- return bus_space_read_4(iobj->imem->iomemt, iobj->imem->iomemh, offset);
+ return bus_space_read_stream_4(iobj->imem->iomemt, iobj->imem->iomemh,
+ offset);
#else
return ioread32_native(iobj->imem->iomem + iobj->node->offset + offset);
#endif
@@ -107,7 +108,8 @@
struct nv40_instobj *iobj = nv40_instobj(memory);
#ifdef __NetBSD__
offset += iobj->node->offset;
- bus_space_write_4(iobj->imem->iomemt, iobj->imem->iomemh, offset, data);
+ bus_space_write_stream_4(iobj->imem->iomemt, iobj->imem->iomemh,
+ offset, data);
#else
iowrite32_native(data, iobj->imem->iomem + iobj->node->offset + offset);
#endif
diff -r 0bc53f1e052d -r b08004f27e97 sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
--- a/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c Mon Aug 27 14:51:05 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c Mon Aug 27 14:51:33 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttm_bo_util.c,v 1.11 2018/08/27 07:45:33 riastradh Exp $ */
+/* $NetBSD: ttm_bo_util.c,v 1.12 2018/08/27 14:51:33 riastradh Exp $ */
/**************************************************************************
*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.11 2018/08/27 07:45:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.12 2018/08/27 14:51:33 riastradh Exp $");
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
@@ -273,22 +273,22 @@
# define iowrite32 fake_iowrite32
static inline uint32_t
-fake_ioread32(const volatile uint32_t *p)
+ioread32(const volatile uint32_t *p)
{
uint32_t v;
v = *p;
- __insn_barrier(); /* XXX */
Home |
Main Index |
Thread Index |
Old Index