CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvif

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

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif: nouveau_nvif_object.c

Log Message:
nouveau: Fix control flow in nvif_object_map.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.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/nvif/nouveau_nvif_object.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.7 src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.8
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.7	Sun Dec 19 11:06:03 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c	Sun Dec 19 11:07:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvif_object.c,v 1.7 2021/12/19 11:06:03 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvif_object.c,v 1.8 2021/12/19 11:07:35 riastradh Exp $	*/
 
 /*
  * Copyright 2014 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvif_object.c,v 1.7 2021/12/19 11:06:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvif_object.c,v 1.8 2021/12/19 11:07:35 riastradh Exp $");
 
 #include 
 #include 
@@ -269,11 +269,10 @@ nvif_object_map(struct nvif_object *obje
 			object->map.addr = handle;
 			ret = client->driver->map(client, tag, handle, length,
 			>map.handle, >map.ptr);
-			if (ret) {
-nvif_object_unmap(object);
-return -ENOMEM;
+			if (ret == 0) {
+object->map.size = length;
+return 0;
 			}
-			object->map.size = length;
 #else
 			object->map.ptr = client->driver->map(client,
 			  handle,



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvif

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

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif: nouveau_nvif_object.c

Log Message:
nouveau: Fix control flow in nvif_object_map.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.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/nvif

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

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif: nouveau_nvif_object.c

Log Message:
nouveau: Initialize object->map.tag/addr/size before use.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.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/nvif

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

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif: nouveau_nvif_object.c

Log Message:
nouveau: Initialize object->map.tag/addr/size before use.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.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/nvif/nouveau_nvif_object.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.6 src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.6	Sun Dec 19 10:51:57 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c	Sun Dec 19 11:06:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvif_object.c,v 1.6 2021/12/19 10:51:57 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvif_object.c,v 1.7 2021/12/19 11:06:03 riastradh Exp $	*/
 
 /*
  * Copyright 2014 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvif_object.c,v 1.6 2021/12/19 10:51:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvif_object.c,v 1.7 2021/12/19 11:06:03 riastradh Exp $");
 
 #include 
 #include 
@@ -259,13 +259,21 @@ nvif_object_map(struct nvif_object *obje
 	if (ret >= 0) {
 		if (ret) {
 #ifdef __NetBSD__
-			ret = client->driver->map(client, tag, handle,
-			object->map.size,
+			/*
+			 * Note: handle is the bus address;
+			 * object->map.handle is the
+			 * bus_space_handle_t, which is typically a
+			 * virtual address mapped in kva.
+			 */
+			object->map.tag = tag;
+			object->map.addr = handle;
+			ret = client->driver->map(client, tag, handle, length,
 			>map.handle, >map.ptr);
 			if (ret) {
 nvif_object_unmap(object);
 return -ENOMEM;
 			}
+			object->map.size = length;
 #else
 			object->map.ptr = client->driver->map(client,
 			  handle,