CVS commit: src/sys/external/bsd/drm2/i915drm
Module Name:src Committed By: riastradh Date: Thu May 1 14:37:36 UTC 2014 Modified Files: src/sys/external/bsd/drm2/i915drm: i915_gem_gtt.c Log Message: Clear only the requested range in gen6_ggtt_clear_range. Sprinkle kasserts throughout i915_gem_gtt.c. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.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/i915drm/i915_gem_gtt.c diff -u src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.3 src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.4 --- src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c:1.3 Thu Apr 3 19:18:29 2014 +++ src/sys/external/bsd/drm2/i915drm/i915_gem_gtt.c Thu May 1 14:37:36 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_gtt.c,v 1.3 2014/04/03 19:18:29 riastradh Exp $ */ +/* $NetBSD: i915_gem_gtt.c,v 1.4 2014/05/01 14:37:36 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.3 2014/04/03 19:18:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.4 2014/05/01 14:37:36 riastradh Exp $"); #include #include @@ -518,6 +518,7 @@ gen6_pte_addr_encode(bus_addr_t addr) #if __x86_64__ KASSERT(addr <= __BITS(39, 0)); #endif + KASSERT((addr & 0xfff) == 0); return (addr | ((addr >> 28) & 0xff0)); } @@ -550,6 +551,14 @@ gen6_pte_encode(struct drm_device *dev, return (gen6_pte_addr_encode(addr) | flags); } +static bus_addr_t __diagused +gen6_pte_decode(gtt_pte_t pte) +{ + const uint32_t addr = (pte & ~(uint32_t)0xf); + + return ((addr & 0xff0) << 28) | (addr & ~(uint32_t)0xff0); +} + static int gen6_gtt_init(struct drm_device *dev) { @@ -653,6 +662,9 @@ gen6_ggtt_bind_object(struct drm_i915_ge do { KASSERT(PAGE_SIZE <= len); KASSERT(0 == (len % PAGE_SIZE)); + KASSERT(addr == + gen6_pte_decode(gen6_pte_encode(dev, addr, +cache_level))); bus_space_write_4(bst, bsh, 4*(first_entry + i), gen6_pte_encode(dev, addr, cache_level)); addr += PAGE_SIZE; @@ -677,6 +689,8 @@ gen6_ggtt_bind_object(struct drm_i915_ge aprint_error_dev(dev->dev, "mismatched PTE" ": 0x%"PRIxMAX" != 0x%"PRIxMAX"\n", (uintmax_t)actual, (uintmax_t)expected); + KASSERTMSG((seg == obj->igo_dmamap->dm_nsegs), + "seg = %u, nsegs = %u", seg, obj->igo_dmamap->dm_nsegs); } I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN); @@ -690,13 +704,17 @@ gen6_ggtt_clear_range(struct drm_device struct drm_i915_private *const dev_priv = dev->dev_private; const bus_space_tag_t bst = dev->bst; const bus_space_handle_t bsh = dev_priv->mm.gtt->gtt_bsh; - const unsigned n = (dev_priv->mm.gtt->gtt_total_entries - start_page); const gtt_pte_t scratch_pte = gen6_pte_encode(dev, dev_priv->mm.gtt->gtt_scratch_map->dm_segs[0].ds_addr, I915_CACHE_LLC); unsigned int i; - for (i = 0; i < n; i++) + KASSERT(start_page < dev_priv->mm.gtt->gtt_total_entries); + KASSERT(npages <= (dev_priv->mm.gtt->gtt_total_entries - start_page)); + KASSERT(dev_priv->mm.gtt->gtt_scratch_map->dm_segs[0].ds_addr == + gen6_pte_decode(scratch_pte)); + + for (i = 0; i < npages; i++) bus_space_write_4(bst, bsh, 4*(start_page + i), scratch_pte); bus_space_read_4(bst, bsh, 4*start_page); }
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Thu May 1 15:19:16 UTC 2014 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c src/sys/external/bsd/drm2/dist/include/drm: drmP.h src/sys/external/bsd/drm2/drm: drm_drv.c drm_gem_vm.c drm_vm.c Log Message: Tweak some DRM GEM page indexing crap. - Fix order of subtraction in drm_mmap_paddr_locked. - Address GEM objects' pages from 0, not from the mmap cookie. - Check page alignment earlier in mmap code paths. - Sprinkle kasserts throughout. Still doesn't fix the garbage that is sometimes being scribbled all over kernel memory! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/include/drm/drmP.h cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/drm/drm_drv.c cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/drm/drm_gem_vm.c \ src/sys/external/bsd/drm2/drm/drm_vm.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/i915/i915_gem.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.3 Sat Apr 26 20:26:26 2014 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Thu May 1 15:19:16 2014 @@ -1521,12 +1521,14 @@ i915_gem_fault(struct uvm_faultinfo *ufi struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); struct drm_device *dev = obj->base.dev; struct drm_i915_private *dev_priv = dev->dev_private; + voff_t byte_offset; pgoff_t page_offset; int ret = 0; bool write = ISSET(access_type, VM_PROT_WRITE)? 1 : 0; - page_offset = (ufi->entry->offset + (vaddr - ufi->entry->start)) >> - PAGE_SHIFT; + byte_offset = (ufi->entry->offset + (vaddr - ufi->entry->start)); + KASSERT(byte_offset <= obj->base.size); + page_offset = (byte_offset >> PAGE_SHIFT); ret = i915_mutex_lock_interruptible(dev); if (ret) Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.3 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.4 --- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.3 Thu Apr 3 19:18:29 2014 +++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h Thu May 1 15:19:16 2014 @@ -1495,7 +1495,7 @@ extern int drm_release(struct inode *ino /* Mapping support (drm_vm.h) */ #ifdef __NetBSD__ extern int drm_mmap_object(struct drm_device *, off_t, size_t, int, -struct uvm_object **); +struct uvm_object **, voff_t *); extern paddr_t drm_mmap_paddr(struct drm_device *, off_t, int); #else extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); @@ -1868,7 +1868,7 @@ void drm_gem_object_handle_free(struct d void drm_gem_pager_reference(struct uvm_object *); void drm_gem_pager_detach(struct uvm_object *); int drm_gem_mmap_object(struct drm_device *, off_t, size_t, int, -struct uvm_object **); +struct uvm_object **, voff_t *); #else void drm_gem_vm_open(struct vm_area_struct *vma); void drm_gem_vm_close(struct vm_area_struct *vma); Index: src/sys/external/bsd/drm2/drm/drm_drv.c diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.3 src/sys/external/bsd/drm2/drm/drm_drv.c:1.4 --- src/sys/external/bsd/drm2/drm/drm_drv.c:1.3 Fri Apr 4 15:16:59 2014 +++ src/sys/external/bsd/drm2/drm/drm_drv.c Thu May 1 15:19:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_drv.c,v 1.3 2014/04/04 15:16:59 riastradh Exp $ */ +/* $NetBSD: drm_drv.c,v 1.4 2014/05/01 15:19:16 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.3 2014/04/04 15:16:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.4 2014/05/01 15:19:16 riastradh Exp $"); #include #include @@ -977,6 +977,7 @@ drm_mmap_ioctl(struct drm_device *dev, v const int flags = args->dnm_flags; const off_t offset = args->dnm_offset; struct uvm_object *uobj; + voff_t uoffset; const vm_prot_t vm_maxprot = (VM_PROT_READ | VM_PROT_WRITE); vm_prot_t vm_prot; int uvmflag; @@ -991,17 +992,19 @@ drm_mmap_ioctl(struct drm_device *dev, v return -EACCES; if (flags != MAP_SHARED) return -EINVAL; + if (offset != (offset & ~(PAGE_SIZE-1))) + return -EINVAL; (void)addr; /* XXX ignore -- no MAP_FIXED for now */ /* Try a GEM object mapping first. */ - ret = drm_gem_mmap_object(dev, offset, size, prot, &uobj); + ret = drm_gem_mmap_object(dev, offset, size, prot, &uobj, &uoffset); if (ret) return ret; if (uobj != NULL) goto map; /* Try a traditional DRM mapping second. */ - ret = drm_mmap_object(dev, offset, size, prot, &uobj); + ret = drm_mmap_object(dev, offset, size, prot, &uobj, &uoffset); if (ret) return ret; if (uobj != NULL) @@ -1020,8 +1023,8 @@ map: vm_prot = ((
CVS commit: src/sys/arch/hp300/stand/common
Module Name:src Committed By: tsutsui Date: Thu May 1 18:08:47 UTC 2014 Modified Files: src/sys/arch/hp300/stand/common: if_le.c Log Message: Reduce a number of getsecs() calls in le_get() to make netboot a bit faster. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/if_le.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/arch/hp300/stand/common/if_le.c diff -u src/sys/arch/hp300/stand/common/if_le.c:1.11 src/sys/arch/hp300/stand/common/if_le.c:1.12 --- src/sys/arch/hp300/stand/common/if_le.c:1.11 Mon Jan 12 11:32:43 2009 +++ src/sys/arch/hp300/stand/common/if_le.c Thu May 1 18:08:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le.c,v 1.11 2009/01/12 11:32:43 tsutsui Exp $ */ +/* $NetBSD: if_le.c,v 1.12 2014/05/01 18:08:47 tsutsui Exp $ */ /* * Copyright (c) 1993 Adam Glass @@ -631,10 +631,9 @@ le_get(struct iodesc *desc, void *pkt, s int cc; t = getsecs(); - cc = 0; - while (((getsecs() - t) < timeout) && !cc) { + do { cc = le_poll(desc, pkt, len); - } + } while (cc == 0 && (getsecs() - t) < timeout); return cc; }
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: dsl Date: Thu May 1 18:37:26 UTC 2014 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: Add -fno-asynchronous-unwind-tables -fno-exceptions to gcc builds. One of these (probably the first) is needed to stop the eh-frame section being created. The eh_frame section is loadable and bloats the boot images. This might be enough to make pxeboot work. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/Makefile.inc diff -u src/sys/arch/i386/stand/Makefile.inc:1.11 src/sys/arch/i386/stand/Makefile.inc:1.12 --- src/sys/arch/i386/stand/Makefile.inc:1.11 Mon Jul 1 12:48:03 2013 +++ src/sys/arch/i386/stand/Makefile.inc Thu May 1 18:37:26 2014 @@ -1,10 +1,11 @@ -# $NetBSD: Makefile.inc,v 1.11 2013/07/01 12:48:03 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.12 2014/05/01 18:37:26 dsl Exp $ .include BINDIR= /usr/mdec -OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables +OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables \ + -fno-asynchronous-unwind-tables -fno-exceptions OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \ -fno-stack-protector -mno-sse \ -mstack-alignment=4 \
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: martin Date: Thu May 1 18:43:45 UTC 2014 Modified Files: src/sys/arch/evbarm/conf: ARMADAXP_INSTALL BCM5301X_INSTALL BCM56340_INSTALL BEAGLEBOARDXM_INSTALL BEAGLEBOARD_INSTALL BEAGLEBONE_INSTALL CUBIEBOARD_INSTALL GEMINI_INSTALL GOLDENGATE_INSTALL GUMSTIX_INSTALL IMX23_OLINUXINO_INSTALL KUROBOX_PRO_INSTALL MV2120_INSTALL NETWALKER_INSTALL ODROID_INSTALL OMAP5EVM_INSTALL PANDABOARD_INSTALL RPI_INSTALL SHEEVAPLUG_INSTALL TISDP2420_INSTALL TWINTAIL_INSTALL Log Message: Do not create debug info for *_INSTALL kernels. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/ARMADAXP_INSTALL \ src/sys/arch/evbarm/conf/BCM5301X_INSTALL \ src/sys/arch/evbarm/conf/BCM56340_INSTALL \ src/sys/arch/evbarm/conf/BEAGLEBOARDXM_INSTALL \ src/sys/arch/evbarm/conf/BEAGLEBOARD_INSTALL \ src/sys/arch/evbarm/conf/BEAGLEBONE_INSTALL \ src/sys/arch/evbarm/conf/CUBIEBOARD_INSTALL \ src/sys/arch/evbarm/conf/GEMINI_INSTALL \ src/sys/arch/evbarm/conf/GOLDENGATE_INSTALL \ src/sys/arch/evbarm/conf/IMX23_OLINUXINO_INSTALL \ src/sys/arch/evbarm/conf/KUROBOX_PRO_INSTALL \ src/sys/arch/evbarm/conf/MV2120_INSTALL \ src/sys/arch/evbarm/conf/NETWALKER_INSTALL \ src/sys/arch/evbarm/conf/ODROID_INSTALL \ src/sys/arch/evbarm/conf/OMAP5EVM_INSTALL \ src/sys/arch/evbarm/conf/PANDABOARD_INSTALL \ src/sys/arch/evbarm/conf/SHEEVAPLUG_INSTALL \ src/sys/arch/evbarm/conf/TISDP2420_INSTALL cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/GUMSTIX_INSTALL cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/RPI_INSTALL \ src/sys/arch/evbarm/conf/TWINTAIL_INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/ARMADAXP_INSTALL diff -u src/sys/arch/evbarm/conf/ARMADAXP_INSTALL:1.1 src/sys/arch/evbarm/conf/ARMADAXP_INSTALL:1.2 --- src/sys/arch/evbarm/conf/ARMADAXP_INSTALL:1.1 Fri Aug 9 05:57:13 2013 +++ src/sys/arch/evbarm/conf/ARMADAXP_INSTALL Thu May 1 18:43:45 2014 @@ -1,4 +1,4 @@ -# $NetBSD: ARMADAXP_INSTALL,v 1.1 2013/08/09 05:57:13 matt Exp $ +# $NetBSD: ARMADAXP_INSTALL,v 1.2 2014/05/01 18:43:45 martin Exp $ # # ARMADAXP_INSTALL -- ARMADAXP kernel with installation-sized # ramdisk @@ -8,3 +8,4 @@ include "arch/evbarm/conf/ARMADAXP" include "arch/evbarm/conf/INSTALL" options BOOTHOWTO=RB_SINGLE +no makeoptions DEBUG Index: src/sys/arch/evbarm/conf/BCM5301X_INSTALL diff -u src/sys/arch/evbarm/conf/BCM5301X_INSTALL:1.1 src/sys/arch/evbarm/conf/BCM5301X_INSTALL:1.2 --- src/sys/arch/evbarm/conf/BCM5301X_INSTALL:1.1 Sat Sep 1 00:21:39 2012 +++ src/sys/arch/evbarm/conf/BCM5301X_INSTALL Thu May 1 18:43:45 2014 @@ -1,4 +1,4 @@ -# $NetBSD: BCM5301X_INSTALL,v 1.1 2012/09/01 00:21:39 matt Exp $ +# $NetBSD: BCM5301X_INSTALL,v 1.2 2014/05/01 18:43:45 martin Exp $ # # BCM5301X_INSTALL -- BCM5301X kernel with installation-sized # ramdisk @@ -8,3 +8,4 @@ include "arch/evbarm/conf/BCM5301X" include "arch/evbarm/conf/INSTALL" options BOOTHOWTO=RB_SINGLE +no makeoptions DEBUG Index: src/sys/arch/evbarm/conf/BCM56340_INSTALL diff -u src/sys/arch/evbarm/conf/BCM56340_INSTALL:1.1 src/sys/arch/evbarm/conf/BCM56340_INSTALL:1.2 --- src/sys/arch/evbarm/conf/BCM56340_INSTALL:1.1 Mon Oct 28 22:35:07 2013 +++ src/sys/arch/evbarm/conf/BCM56340_INSTALL Thu May 1 18:43:45 2014 @@ -1,4 +1,4 @@ -# $NetBSD: BCM56340_INSTALL,v 1.1 2013/10/28 22:35:07 matt Exp $ +# $NetBSD: BCM56340_INSTALL,v 1.2 2014/05/01 18:43:45 martin Exp $ # # BCM56340_INSTALL -- BCM56340 kernel with installation-sized # ramdisk @@ -8,3 +8,4 @@ include "arch/evbarm/conf/BCM56340" include "arch/evbarm/conf/INSTALL" options BOOTHOWTO=RB_SINGLE +no makeoptions DEBUG Index: src/sys/arch/evbarm/conf/BEAGLEBOARDXM_INSTALL diff -u src/sys/arch/evbarm/conf/BEAGLEBOARDXM_INSTALL:1.1 src/sys/arch/evbarm/conf/BEAGLEBOARDXM_INSTALL:1.2 --- src/sys/arch/evbarm/conf/BEAGLEBOARDXM_INSTALL:1.1 Thu Aug 23 01:27:24 2012 +++ src/sys/arch/evbarm/conf/BEAGLEBOARDXM_INSTALL Thu May 1 18:43:45 2014 @@ -1,4 +1,4 @@ -# $NetBSD: BEAGLEBOARDXM_INSTALL,v 1.1 2012/08/23 01:27:24 matt Exp $ +# $NetBSD: BEAGLEBOARDXM_INSTALL,v 1.2 2014/05/01 18:43:45 martin Exp $ # # BEAGLEBOARDXM_INSTALL -- BEAGLEBOARDXM kernel with installation-sized # ramdisk @@ -8,3 +8,4 @@ include "arch/evbarm/conf/BEAGLEBOARDXM" include "arch/evbarm/conf/INSTALL" options BOOTHOWTO=RB_SINGLE +no makeoptions DEBUG Index: src/sys/arch/evbarm/conf/BEAGLEBOARD_INSTALL diff -u src/sys/arch/evbarm/conf/BEAGLEBOARD_INSTALL:1.1 src/sys/arch/evbarm/conf/BEAGLEBOARD_INSTALL:1.2 --- src/sys/arch/evbarm/conf/BEAGLEBOARD_INSTALL:1.1 Wed Aug 29 03:54:03 2012 +++ src/sys/arch/evbarm/conf/BEAGLEBOARD_INSTALL Thu May 1 18:43:45 2014 @@ -1,4 +1,4 @@ -# $NetBSD: BEAGLEBOARD_INSTALL,v 1.1 2012/08/29 03:54:03 matt Exp $ +# $
CVS commit: src/sys/arch/arm/imx
Module Name:src Committed By: hkenken Date: Fri May 2 03:05:41 UTC 2014 Modified Files: src/sys/arch/arm/imx: imxwdog.c Log Message: struct device * -> device_t To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imxwdog.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/arch/arm/imx/imxwdog.c diff -u src/sys/arch/arm/imx/imxwdog.c:1.1 src/sys/arch/arm/imx/imxwdog.c:1.2 --- src/sys/arch/arm/imx/imxwdog.c:1.1 Sat Mar 22 04:55:00 2014 +++ src/sys/arch/arm/imx/imxwdog.c Fri May 2 03:05:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: imxwdog.c,v 1.1 2014/03/22 04:55:00 hkenken Exp $ */ +/* $NetBSD: imxwdog.c,v 1.2 2014/05/02 03:05:41 hkenken Exp $ */ /* * Copyright (c) 2010 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imxwdog.c,v 1.1 2014/03/22 04:55:00 hkenken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imxwdog.c,v 1.2 2014/05/02 03:05:41 hkenken Exp $"); #include "opt_imx.h" @@ -131,7 +131,7 @@ wdog_setmode(struct sysmon_wdog *smw) } void -wdog_attach_common(struct device *parent, struct device *self, +wdog_attach_common(device_t parent, device_t self, bus_space_tag_t iot, paddr_t addr, size_t size, int irq) { struct wdog_softc *sc = device_private(self);