CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem

2024-06-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun  4 21:43:39 UTC 2024

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_gk20a.c

Log Message:
nouveau_nvkm_subdev_instmem_gk20a.c: Use BUS_DMA_PREFETCHABLE.

Matches Linux's pgprot_writecombine.

Unclear where the appropriate bus_dmamap_sync happens, or is supposed
to happen -- not using it would be wrong, but asking for a
prefetchable mapping may paper over symptoms, at least!


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c:1.9 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c:1.9	Sun Dec 19 12:29:47 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c	Tue Jun  4 21:43:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_instmem_gk20a.c,v 1.9 2021/12/19 12:29:47 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_instmem_gk20a.c,v 1.10 2024/06/04 21:43:39 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
@@ -44,7 +44,7 @@
  * goes beyond a certain threshold. At the moment this limit is 1MB.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_gk20a.c,v 1.9 2021/12/19 12:29:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_gk20a.c,v 1.10 2024/06/04 21:43:39 riastradh Exp $");
 
 #include "priv.h"
 
@@ -241,7 +241,7 @@ gk20a_instobj_acquire_iommu(struct nvkm_
 #ifdef __NetBSD__
 	void *kva;
 	if (bus_dmamem_map(imem->dmat, node->segs, node->nsegs, size,
-		, BUS_DMA_WAITOK))
+		, BUS_DMA_WAITOK|BUS_DMA_PREFETCHABLE))
 		node->base.vaddr = NULL;
 	else
 		node->base.vaddr = kva;



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem

2024-06-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun  4 21:43:39 UTC 2024

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_gk20a.c

Log Message:
nouveau_nvkm_subdev_instmem_gk20a.c: Use BUS_DMA_PREFETCHABLE.

Matches Linux's pgprot_writecombine.

Unclear where the appropriate bus_dmamap_sync happens, or is supposed
to happen -- not using it would be wrong, but asking for a
prefetchable mapping may paper over symptoms, at least!


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem

2022-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  9 19:59:08 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_base.c

Log Message:
nouveau: Omit needless local patch.

This code probably once called ioread32/iowrite32 or something, but
no longer.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem

2022-04-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  9 19:59:08 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_base.c

Log Message:
nouveau: Omit needless local patch.

This code probably once called ioread32/iowrite32 or something, but
no longer.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c:1.8 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c:1.8	Sun Dec 19 11:34:45 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_base.c	Sat Apr  9 19:59:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.8 2021/12/19 11:34:45 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.9 2022/04/09 19:59:08 riastradh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.8 2021/12/19 11:34:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_base.c,v 1.9 2022/04/09 19:59:08 riastradh Exp $");
 
 #include "priv.h"
 
@@ -34,37 +34,6 @@ __KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm
 #  define	__iomem	__nvkm_memory_iomem
 #endif
 
-#ifdef __NetBSD__
-
-/*
- * XXX I think this should be done with bus_space, but the depth of
- * abstractions is dizzying and I'm not actually sure where these
- * pointers come from.
- */
-
-#  define	ioread32_native		fake_ioread32_native
-#  define	iowrite32_native	fake_iowrite32_native
-
-static inline uint32_t
-ioread32_native(const void __iomem *ptr)
-{
-	uint32_t v;
-
-	v = *(const uint32_t __iomem *)ptr;
-	membar_consumer();
-
-	return v;
-}
-
-static inline void
-iowrite32_native(uint32_t v, void __iomem *ptr)
-{
-
-	membar_producer();
-	*(uint32_t __iomem *)ptr = v;
-}
-
-#endif
 /**
  * instmem object base implementation
  */
@@ -88,12 +57,6 @@ nvkm_instobj_load(struct nvkm_instobj *i
 	iobj->suspend = NULL;
 }
 
-#ifdef __NetBSD__
-#  undef	ioread32_native
-#  undef	iowrite32_native
-#endif
-
-
 static int
 nvkm_instobj_save(struct nvkm_instobj *iobj)
 {



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 12:31:19 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_nv40.c

Log Message:
nouveau: Map write-combining in instmem/nv40 like Linux does.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c:1.10 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c:1.10	Sun Dec 19 10:51:58 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c	Sun Dec 19 12:31:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.10 2021/12/19 10:51:58 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.11 2021/12/19 12:31:19 riastradh Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.10 2021/12/19 10:51:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_instmem_nv40.c,v 1.11 2021/12/19 12:31:19 riastradh Exp $");
 
 #define nv40_instmem(p) container_of((p), struct nv40_instmem, base)
 #include "priv.h"
@@ -301,9 +301,8 @@ nv40_instmem_new(struct nvkm_device *dev
 	iomembase = device->func->resource_addr(device, bar);
 	iomemsz = device->func->resource_size(device, bar);
 	/* XXX errno NetBSD->Linux */
-	/* XXX post-merge: switch to WC */
 	ret = -bus_space_map(imem->iomemt, iomembase, iomemsz,
-	BUS_SPACE_MAP_LINEAR, >iomemh);
+	BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, >iomemh);
 	if (ret) {
 		nvkm_error(>base.subdev, "unable to map PRAMIN BAR %d"
 		": %d\n", bar, ret);



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem

2021-12-19 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 19 12:31:19 UTC 2021

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem:
nouveau_nvkm_subdev_instmem_nv40.c

Log Message:
nouveau: Map write-combining in instmem/nv40 like Linux does.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_nv40.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.