Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/drm Avoid the PAGE_MASK mess ...
details: https://anonhg.NetBSD.org/src/rev/c959144fa825
branches: riastradh-drm2
changeset: 788523:c959144fa825
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Sep 08 15:44:14 2013 +0000
description:
Avoid the PAGE_MASK mess in drm_gem_vm.c, drm_scatter.c, & drm_vm.c.
diffstat:
sys/external/bsd/drm2/drm/drm_gem_vm.c | 6 +++---
sys/external/bsd/drm2/drm/drm_scatter.c | 6 +++---
sys/external/bsd/drm2/drm/drm_vm.c | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diffs (81 lines):
diff -r 52230c6d94d1 -r c959144fa825 sys/external/bsd/drm2/drm/drm_gem_vm.c
--- a/sys/external/bsd/drm2/drm/drm_gem_vm.c Sun Sep 08 15:42:48 2013 +0000
+++ b/sys/external/bsd/drm2/drm/drm_gem_vm.c Sun Sep 08 15:44:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_gem_vm.c,v 1.1.2.1 2013/07/24 02:54:09 riastradh Exp $ */
+/* $NetBSD: drm_gem_vm.c,v 1.1.2.2 2013/09/08 15:44:14 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_gem_vm.c,v 1.1.2.1 2013/07/24 02:54:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_vm.c,v 1.1.2.2 2013/09/08 15:44:14 riastradh Exp $");
#include <sys/types.h>
@@ -85,7 +85,7 @@
KASSERT(drm_core_check_feature(dev, DRIVER_GEM));
KASSERT(dev->driver->gem_uvm_ops != NULL);
- if (byte_offset != trunc_page(byte_offset)) /* XXX kassert? */
+ if (byte_offset != (byte_offset & ~(PAGE_SIZE-1))) /* XXX kassert? */
return -EINVAL;
if (drm_ht_find_item(&mm->offset_hash, page_offset, &hash) != 0) {
diff -r 52230c6d94d1 -r c959144fa825 sys/external/bsd/drm2/drm/drm_scatter.c
--- a/sys/external/bsd/drm2/drm/drm_scatter.c Sun Sep 08 15:42:48 2013 +0000
+++ b/sys/external/bsd/drm2/drm/drm_scatter.c Sun Sep 08 15:44:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_scatter.c,v 1.1.2.2 2013/07/24 03:27:52 riastradh Exp $ */
+/* $NetBSD: drm_scatter.c,v 1.1.2.3 2013/09/08 15:44:14 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_scatter.c,v 1.1.2.2 2013/07/24 03:27:52 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_scatter.c,v 1.1.2.3 2013/09/08 15:44:14 riastradh Exp $");
#include <sys/types.h>
#include <sys/bus.h>
@@ -123,7 +123,7 @@
KASSERT(drm_core_check_feature(dev, DRIVER_SG));
KASSERT(size <= (size_t)0xffffffffUL); /* XXX 32-bit sizes only? */
- const size_t nbytes = round_page(size);
+ const size_t nbytes = PAGE_ALIGN(size);
const size_t npages = nbytes >> PAGE_SHIFT;
KASSERT(npages <= (size_t)INT_MAX);
diff -r 52230c6d94d1 -r c959144fa825 sys/external/bsd/drm2/drm/drm_vm.c
--- a/sys/external/bsd/drm2/drm/drm_vm.c Sun Sep 08 15:42:48 2013 +0000
+++ b/sys/external/bsd/drm2/drm/drm_vm.c Sun Sep 08 15:44:14 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_vm.c,v 1.1.2.1 2013/07/24 02:53:31 riastradh Exp $ */
+/* $NetBSD: drm_vm.c,v 1.1.2.2 2013/09/08 15:44:14 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vm.c,v 1.1.2.1 2013/07/24 02:53:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vm.c,v 1.1.2.2 2013/09/08 15:44:14 riastradh Exp $");
#include <sys/types.h>
@@ -50,7 +50,7 @@
paddr_t paddr = (paddr_t)-1;
int error;
- if (byte_offset != trunc_page(byte_offset))
+ if (byte_offset != (byte_offset & ~(PAGE_SIZE-1)))
return (paddr_t)-1;
mutex_lock(&dev->struct_mutex);
Home |
Main Index |
Thread Index |
Old Index