From c1a051eb4ba033669ea2e369337d667640d400e4 Mon Sep 17 00:00:00 2001 From: anholt Date: Fri, 13 Sep 2002 04:17:28 +0000 Subject: [PATCH] Fix an i830/i845 test that shouldn't get hit in normal use and remove a printf. Submitted by: David Dawes --- sys/dev/agp/agp_i810.c | 10 ++++------ sys/pci/agp_i810.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index a8ac38e2d0b1..4353f80a3f2a 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -446,9 +446,10 @@ agp_i810_unbind_page(device_t dev, int offset) return EINVAL; if ( sc->chiptype == CHIP_I830 ) { - if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) + if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) { device_printf(dev, "trying to unbind from stolen memory"); - return EINVAL; + return EINVAL; + } } WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, 0); @@ -570,11 +571,8 @@ agp_i810_bind_memory(device_t dev, struct agp_memory *mem, if (mem->am_type != 1) return agp_generic_bind_memory(dev, mem, offset); - if ( sc->chiptype == CHIP_I830 ) { - if ((offset >> AGP_PAGE_SHIFT) < sc->stolen) - device_printf(dev, "trying to bind into stolen memory"); + if ( sc->chiptype == CHIP_I830 ) return EINVAL; - } for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) { WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, diff --git a/sys/pci/agp_i810.c b/sys/pci/agp_i810.c index a8ac38e2d0b1..4353f80a3f2a 100644 --- a/sys/pci/agp_i810.c +++ b/sys/pci/agp_i810.c @@ -446,9 +446,10 @@ agp_i810_unbind_page(device_t dev, int offset) return EINVAL; if ( sc->chiptype == CHIP_I830 ) { - if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) + if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) { device_printf(dev, "trying to unbind from stolen memory"); - return EINVAL; + return EINVAL; + } } WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, 0); @@ -570,11 +571,8 @@ agp_i810_bind_memory(device_t dev, struct agp_memory *mem, if (mem->am_type != 1) return agp_generic_bind_memory(dev, mem, offset); - if ( sc->chiptype == CHIP_I830 ) { - if ((offset >> AGP_PAGE_SHIFT) < sc->stolen) - device_printf(dev, "trying to bind into stolen memory"); + if ( sc->chiptype == CHIP_I830 ) return EINVAL; - } for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) { WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4,