Deleted Added
full compact
agp_i810.c (103243) agp_i810.c (103272)
1/*-
2 * Copyright (c) 2000 Doug Rabson
3 * Copyright (c) 2000 Ruslan Ermilov
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2000 Doug Rabson
3 * Copyright (c) 2000 Ruslan Ermilov
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/agp/agp_i810.c 103243 2002-09-12 04:23:18Z anholt $
27 * $FreeBSD: head/sys/dev/agp/agp_i810.c 103272 2002-09-13 04:17:28Z anholt $
28 */
29
30/*
31 * Fixes for 830/845G support: David Dawes <dawes@xfree86.org>
32 */
33
34#include "opt_bus.h"
35#include "opt_pci.h"

--- 405 unchanged lines hidden (view full) ---

441agp_i810_unbind_page(device_t dev, int offset)
442{
443 struct agp_i810_softc *sc = device_get_softc(dev);
444
445 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
446 return EINVAL;
447
448 if ( sc->chiptype == CHIP_I830 ) {
28 */
29
30/*
31 * Fixes for 830/845G support: David Dawes <dawes@xfree86.org>
32 */
33
34#include "opt_bus.h"
35#include "opt_pci.h"

--- 405 unchanged lines hidden (view full) ---

441agp_i810_unbind_page(device_t dev, int offset)
442{
443 struct agp_i810_softc *sc = device_get_softc(dev);
444
445 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
446 return EINVAL;
447
448 if ( sc->chiptype == CHIP_I830 ) {
449 if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen )
449 if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) {
450 device_printf(dev, "trying to unbind from stolen memory");
450 device_printf(dev, "trying to unbind from stolen memory");
451 return EINVAL;
451 return EINVAL;
452 }
452 }
453
454 WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, 0);
455 return 0;
456}
457
458/*
459 * Writing via memory mapped registers already flushes all TLBs.

--- 105 unchanged lines hidden (view full) ---

565 vm_offset_t offset)
566{
567 struct agp_i810_softc *sc = device_get_softc(dev);
568 vm_offset_t i;
569
570 if (mem->am_type != 1)
571 return agp_generic_bind_memory(dev, mem, offset);
572
453 }
454
455 WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, 0);
456 return 0;
457}
458
459/*
460 * Writing via memory mapped registers already flushes all TLBs.

--- 105 unchanged lines hidden (view full) ---

566 vm_offset_t offset)
567{
568 struct agp_i810_softc *sc = device_get_softc(dev);
569 vm_offset_t i;
570
571 if (mem->am_type != 1)
572 return agp_generic_bind_memory(dev, mem, offset);
573
573 if ( sc->chiptype == CHIP_I830 ) {
574 if ((offset >> AGP_PAGE_SHIFT) < sc->stolen)
575 device_printf(dev, "trying to bind into stolen memory");
574 if ( sc->chiptype == CHIP_I830 )
576 return EINVAL;
575 return EINVAL;
577 }
578
579 for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) {
580 WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4,
581 i | 3);
582 }
583
584 return 0;
585}

--- 52 unchanged lines hidden ---
576
577 for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) {
578 WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4,
579 i | 3);
580 }
581
582 return 0;
583}

--- 52 unchanged lines hidden ---