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/i915drm Sprinkle some kassert...



details:   https://anonhg.NetBSD.org/src/rev/e4ac33acf361
branches:  riastradh-drm2
changeset: 788553:e4ac33acf361
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 16:13:10 2013 +0000

description:
Sprinkle some kasserts into i915_gem_gtt.c.

diffstat:

 sys/external/bsd/drm2/i915drm/i915_gem_gtt.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 120c9cbb49b1 -r e4ac33acf361 sys/external/bsd/drm2/i915drm/i915_gem_gtt.c
--- a/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c      Sun Sep 08 16:12:26 2013 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c      Sun Sep 08 16:13:10 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.c,v 1.1.2.3 2013/09/08 16:00:22 riastradh Exp $   */
+/*     $NetBSD: i915_gem_gtt.c,v 1.1.2.4 2013/09/08 16:13:10 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.1.2.3 2013/09/08 16:00:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.1.2.4 2013/09/08 16:13:10 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -66,7 +66,7 @@
 static uint32_t
 gen6_pte_addr_encode(bus_addr_t addr)
 {
-       /* XXX KASSERT bounds?  Must be at most 36-bit, it seems.  */
+       KASSERT(addr <= __BITS(39, 0));
        return (addr | ((addr >> 28) & 0xff0));
 }
 
@@ -392,6 +392,7 @@
                len = obj->igo_dmamap->dm_segs[seg].ds_len;
                do {
                        KASSERT(PAGE_SIZE <= len);
+                       KASSERT(0 == (len % PAGE_SIZE));
                        bus_space_write_4(bst, bsh, 4*(first_entry + i),
                            pte_encode(dev, addr, cache_level));
                        addr += PAGE_SIZE;



Home | Main Index | Thread Index | Old Index