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/ttm drm/ttm: More careful diagnostics ...
details: https://anonhg.NetBSD.org/src/rev/b095fc247dbf
branches: trunk
changeset: 1028641:b095fc247dbf
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 11:34:14 2021 +0000
description:
drm/ttm: More careful diagnostics earlier on.
diffstat:
sys/external/bsd/drm2/ttm/ttm_bo_vm.c | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)
diffs (49 lines):
diff -r 9e9f1a0f0604 -r b095fc247dbf sys/external/bsd/drm2/ttm/ttm_bo_vm.c
--- a/sys/external/bsd/drm2/ttm/ttm_bo_vm.c Sun Dec 19 11:34:06 2021 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_bo_vm.c Sun Dec 19 11:34:14 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ttm_bo_vm.c,v 1.19 2021/12/19 11:34:06 riastradh Exp $ */
+/* $NetBSD: ttm_bo_vm.c,v 1.20 2021/12/19 11:34:14 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.19 2021/12/19 11:34:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_bo_vm.c,v 1.20 2021/12/19 11:34:14 riastradh Exp $");
#include <sys/types.h>
@@ -254,7 +254,29 @@
ret = ttm_bo_uvm_lookup(bdev, startpage, npages, &bo);
if (ret)
goto fail0;
- KASSERT(drm_vma_node_start(&bo->base.vma_node) <= offset);
+ KASSERTMSG((drm_vma_node_start(&bo->base.vma_node) <= startpage),
+ "mapping npages=0x%jx @ pfn=0x%jx"
+ " from vma npages=0x%jx @ pfn=0x%jx",
+ (uintmax_t)npages,
+ (uintmax_t)startpage,
+ (uintmax_t)drm_vma_node_size(&bo->base.vma_node),
+ (uintmax_t)drm_vma_node_start(&bo->base.vma_node));
+ KASSERTMSG((npages <= drm_vma_node_size(&bo->base.vma_node)),
+ "mapping npages=0x%jx @ pfn=0x%jx"
+ " from vma npages=0x%jx @ pfn=0x%jx",
+ (uintmax_t)npages,
+ (uintmax_t)startpage,
+ (uintmax_t)drm_vma_node_size(&bo->base.vma_node),
+ (uintmax_t)drm_vma_node_start(&bo->base.vma_node));
+ KASSERTMSG(((startpage - drm_vma_node_start(&bo->base.vma_node))
+ <= (drm_vma_node_size(&bo->base.vma_node) - npages)),
+ "mapping npages=0x%jx @ pfn=0x%jx"
+ " from vma npages=0x%jx @ pfn=0x%jx",
+ (uintmax_t)npages,
+ (uintmax_t)startpage,
+ (uintmax_t)drm_vma_node_size(&bo->base.vma_node),
+ (uintmax_t)drm_vma_node_start(&bo->base.vma_node));
+
/* XXX Just assert this? */
if (__predict_false(bdev->driver->verify_access == NULL)) {
ret = -EPERM;
Home |
Main Index |
Thread Index |
Old Index