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 nvif_object_map ...
details: https://anonhg.NetBSD.org/src/rev/f0513c69b0f8
branches: trunk
changeset: 835399:f0513c69b0f8
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 14:48:21 2018 +0000
description:
Mark nvif_object_map __must_check and fix fallout noisily.
diffstat:
sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_disp.c | 10 ++++--
sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/object.h | 4 +-
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_chan.c | 10 ++++--
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c | 15 +++++++--
4 files changed, 27 insertions(+), 12 deletions(-)
diffs (116 lines):
diff -r b6b452389f72 -r f0513c69b0f8 sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_disp.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_disp.c Mon Aug 27 14:48:07 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/dispnv04/nouveau_dispnv04_disp.c Mon Aug 27 14:48:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_dispnv04_disp.c,v 1.3 2018/08/27 04:58:29 riastradh Exp $ */
+/* $NetBSD: nouveau_dispnv04_disp.c,v 1.4 2018/08/27 14:48:21 riastradh Exp $ */
/*
* Copyright 2009 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_dispnv04_disp.c,v 1.3 2018/08/27 04:58:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_dispnv04_disp.c,v 1.4 2018/08/27 14:48:21 riastradh Exp $");
#include <linux/err.h>
@@ -54,7 +54,11 @@
if (!disp)
return -ENOMEM;
- nvif_object_map(&drm->device.object);
+ ret = nvif_object_map(&drm->device.object);
+ if (ret) {
+ NV_ERROR(drm, "nvif_object_map, %d\n", ret);
+ return ret;
+ }
nouveau_display(dev)->priv = disp;
nouveau_display(dev)->dtor = nv04_display_destroy;
diff -r b6b452389f72 -r f0513c69b0f8 sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/object.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/object.h Mon Aug 27 14:48:07 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/include/nvif/object.h Mon Aug 27 14:48:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: object.h,v 1.7 2018/08/27 14:47:53 riastradh Exp $ */
+/* $NetBSD: object.h,v 1.8 2018/08/27 14:48:21 riastradh Exp $ */
#ifndef __NVIF_OBJECT_H__
#define __NVIF_OBJECT_H__
@@ -45,7 +45,7 @@
u32 nvif_object_rd(struct nvif_object *, int, u64);
void nvif_object_wr(struct nvif_object *, int, u64, u32);
int nvif_object_mthd(struct nvif_object *, u32, void *, u32);
-int nvif_object_map(struct nvif_object *);
+int nvif_object_map(struct nvif_object *) __must_check;
void nvif_object_unmap(struct nvif_object *);
#define nvif_handle(a) (unsigned long)(void *)(a)
diff -r b6b452389f72 -r f0513c69b0f8 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_chan.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_chan.c Mon Aug 27 14:48:07 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_chan.c Mon Aug 27 14:48:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_chan.c,v 1.4 2018/08/27 07:31:51 riastradh Exp $ */
+/* $NetBSD: nouveau_chan.c,v 1.5 2018/08/27 14:48:21 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_chan.c,v 1.4 2018/08/27 07:31:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_chan.c,v 1.5 2018/08/27 14:48:21 riastradh Exp $");
#include <nvif/os.h>
#include <nvif/class.h>
@@ -305,7 +305,11 @@
struct nv_dma_v0 args = zero_args;
int ret, i;
- nvif_object_map(&chan->user);
+ ret = nvif_object_map(&chan->user);
+ if (ret) {
+ NV_PRINTK(err, cli, "nvif_object_map, %d\n", ret);
+ return ret;
+ }
/* allocate dma objects to cover all allowed vram, and gart */
if (device->info.family < NV_DEVICE_INFO_V0_FERMI) {
diff -r b6b452389f72 -r f0513c69b0f8 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c Mon Aug 27 14:48:07 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_nv50_display.c Mon Aug 27 14:48:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_nv50_display.c,v 1.9 2018/08/27 07:38:26 riastradh Exp $ */
+/* $NetBSD: nouveau_nv50_display.c,v 1.10 2018/08/27 14:48:21 riastradh Exp $ */
/*
* Copyright 2011 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nv50_display.c,v 1.9 2018/08/27 07:38:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nv50_display.c,v 1.10 2018/08/27 14:48:21 riastradh Exp $");
#include <linux/dma-mapping.h>
#include <linux/err.h>
@@ -107,8 +107,15 @@
if (sclass[i].oclass == oclass[0]) {
ret = nvif_object_init(disp, 0, oclass[0],
data, size, &chan->user);
- if (ret == 0)
- nvif_object_map(&chan->user);
+ if (ret == 0) {
+ ret = nvif_object_map(&chan->user);
+ if (ret) {
+ printk(KERN_ERR "%s:%d"
+ ": nvif_object_map, %d\n",
+ __func__, __LINE__, ret);
+ nvif_object_fini(&chan->user);
+ }
+ }
nvif_object_sclass_put(&sclass);
return ret;
}
Home |
Main Index |
Thread Index |
Old Index