Deleted Added
full compact
agp_i810.c (186434) agp_i810.c (189578)
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:

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

26 */
27
28/*
29 * Fixes for 830/845G support: David Dawes <dawes@xfree86.org>
30 * 852GM/855GM/865G support added by David Dawes <dawes@xfree86.org>
31 */
32
33#include <sys/cdefs.h>
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:

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

26 */
27
28/*
29 * Fixes for 830/845G support: David Dawes <dawes@xfree86.org>
30 * 852GM/855GM/865G support added by David Dawes <dawes@xfree86.org>
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/agp/agp_i810.c 186434 2008-12-23 16:16:30Z rnoland $");
34__FBSDID("$FreeBSD: head/sys/dev/agp/agp_i810.c 189578 2009-03-09 13:27:33Z imp $");
35
36#include "opt_bus.h"
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

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

831 case CHIP_G4X:
832 bus_write_4(sc->sc_res[0],
833 (offset >> AGP_PAGE_SHIFT) * 4 + (2 * 1024 * 1024), pte);
834 break;
835 }
836}
837
838static int
35
36#include "opt_bus.h"
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

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

831 case CHIP_G4X:
832 bus_write_4(sc->sc_res[0],
833 (offset >> AGP_PAGE_SHIFT) * 4 + (2 * 1024 * 1024), pte);
834 break;
835 }
836}
837
838static int
839agp_i810_bind_page(device_t dev, int offset, vm_offset_t physical)
839agp_i810_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
840{
841 struct agp_i810_softc *sc = device_get_softc(dev);
842
843 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) {
840{
841 struct agp_i810_softc *sc = device_get_softc(dev);
842
843 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) {
844 device_printf(dev, "failed: offset is 0x%08x, shift is %d, entries is %d\n", offset, AGP_PAGE_SHIFT, sc->gatt->ag_entries);
844 device_printf(dev, "failed: offset is 0x%08jx, shift is %d, entries is %d\n", (intmax_t)offset, AGP_PAGE_SHIFT, sc->gatt->ag_entries);
845 return EINVAL;
846 }
847
848 if ( sc->chiptype != CHIP_I810 ) {
849 if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) {
850 device_printf(dev, "trying to bind into stolen memory");
851 return EINVAL;
852 }
853 }
854
855 agp_i810_write_gtt_entry(dev, offset, physical, 1);
856
857 return 0;
858}
859
860static int
845 return EINVAL;
846 }
847
848 if ( sc->chiptype != CHIP_I810 ) {
849 if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) {
850 device_printf(dev, "trying to bind into stolen memory");
851 return EINVAL;
852 }
853 }
854
855 agp_i810_write_gtt_entry(dev, offset, physical, 1);
856
857 return 0;
858}
859
860static int
861agp_i810_unbind_page(device_t dev, int offset)
861agp_i810_unbind_page(device_t dev, vm_offset_t offset)
862{
863 struct agp_i810_softc *sc = device_get_softc(dev);
864
865 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
866 return EINVAL;
867
868 if ( sc->chiptype != CHIP_I810 ) {
869 if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) {

--- 260 unchanged lines hidden ---
862{
863 struct agp_i810_softc *sc = device_get_softc(dev);
864
865 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
866 return EINVAL;
867
868 if ( sc->chiptype != CHIP_I810 ) {
869 if ( (offset >> AGP_PAGE_SHIFT) < sc->stolen ) {

--- 260 unchanged lines hidden ---