summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-03-14 23:42:42 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-03-14 23:42:42 +0000
commit6269b72af6891dcd8519ea9ca6048764d03f353e (patch)
tree277b80984face488e3a24f206f3667bbaf6ee501 /sys
parentcbe3de21ea36ce1abe4abeea1c5a6205f0f3541e (diff)
Remove the userland AGP interface. Now that we have KMS, it is no longer
used by any of the remaining xenocara drivers. Except perhaps for the legacy i810 support in the xf86-video-intel driver. But i810 support has almost certainly been broken for more than a year now, and any remaining users are probably better off using the xf86-video-vesa driver ever since XAA support was removed from the X server. ok deraadt@, jsg@, mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/conf.c6
-rw-r--r--sys/arch/i386/i386/conf.c6
-rw-r--r--sys/arch/macppc/macppc/conf.c6
-rw-r--r--sys/dev/pci/agp.c194
-rw-r--r--sys/sys/conf.h9
5 files changed, 8 insertions, 213 deletions
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c
index feb2abf1312..59d4c9b0bdc 100644
--- a/sys/arch/amd64/amd64/conf.c
+++ b/sys/arch/amd64/amd64/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.44 2013/11/04 17:14:26 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.45 2014/03/14 23:42:40 kettenis Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -156,8 +156,6 @@ cdev_decl(cztty);
#include "radio.h"
#include "nvram.h"
cdev_decl(nvram);
-#include "agp.h"
-cdev_decl(agp);
#include "drm.h"
cdev_decl(drm);
@@ -278,7 +276,7 @@ struct cdevsw cdevsw[] =
cdev_acpi_init(NACPI,acpi), /* 83: ACPI */
cdev_notdef(),
cdev_nvram_init(NNVRAM,nvram), /* 85: NVRAM interface */
- cdev_agp_init(NAGP,agp), /* 86: agp */
+ cdev_notdef(), /* 86 */
cdev_drm_init(NDRM,drm), /* 87: drm */
cdev_gpio_init(NGPIO,gpio), /* 88: gpio */
cdev_vscsi_init(NVSCSI,vscsi), /* 89: vscsi */
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index 4d5873816f4..a0e406e2637 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.145 2013/11/04 14:11:29 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.146 2014/03/14 23:42:40 kettenis Exp $ */
/* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */
/*
@@ -159,8 +159,6 @@ cdev_decl(cztty);
#include "gpr.h"
#include "nvram.h"
cdev_decl(nvram);
-#include "agp.h"
-cdev_decl(agp);
#include "drm.h"
cdev_decl(drm);
@@ -283,7 +281,7 @@ struct cdevsw cdevsw[] =
cdev_nvram_init(NNVRAM,nvram), /* 84: NVRAM interface */
cdev_notdef(), /* 85: ACPI (deprecated) */
cdev_notdef(),
- cdev_agp_init(NAGP,agp), /* 87: agp */
+ cdev_notdef(), /* 87 */
cdev_drm_init(NDRM,drm), /* 88: drm */
cdev_amdmsr_init(NAMDMSR,amdmsr), /* 89: amdmsr */
cdev_vscsi_init(NVSCSI,vscsi), /* 90: vscsi */
diff --git a/sys/arch/macppc/macppc/conf.c b/sys/arch/macppc/macppc/conf.c
index 0b27c4805fa..468796b18cc 100644
--- a/sys/arch/macppc/macppc/conf.c
+++ b/sys/arch/macppc/macppc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.56 2013/11/04 17:14:26 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.57 2014/03/14 23:42:40 kettenis Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -110,8 +110,6 @@ cdev_decl(com);
#include "inet.h"
#include "apm.h"
-#include "agp.h"
-cdev_decl(agp);
#include "drm.h"
cdev_decl(drm);
@@ -234,7 +232,7 @@ struct cdevsw cdevsw[] = {
cdev_vscsi_init(NVSCSI,vscsi), /* 83: vscsi */
cdev_disk_init(1,diskmap), /* 84: disk mapper */
cdev_pppx_init(NPPPX,pppx), /* 85: pppx */
- cdev_agp_init(NAGP,agp), /* 86: agp */
+ cdev_notdef, /* 86 */
cdev_drm_init(NDRM,drm), /* 87: drm */
cdev_fuse_init(NFUSE,fuse), /* 88: fuse */
};
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c
index 8fc3869d720..4bd3b849eed 100644
--- a/sys/dev/pci/agp.c
+++ b/sys/dev/pci/agp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agp.c,v 1.38 2013/08/06 09:45:32 jsg Exp $ */
+/* $OpenBSD: agp.c,v 1.39 2014/03/14 23:42:41 kettenis Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
* All rights reserved.
@@ -68,14 +68,7 @@ int agpclose(dev_t, int, int , struct proc *);
struct agp_memory *agp_find_memory(struct agp_softc *, int);
struct agp_memory *agp_lookup_memory(struct agp_softc *, off_t);
-/* userland ioctl functions */
int agpvga_match(struct pci_attach_args *);
-int agp_info_user(void *, agp_info *);
-int agp_setup_user(void *, agp_setup *);
-int agp_allocate_user(void *, agp_allocate *);
-int agp_deallocate_user(void *, int);
-int agp_bind_user(void *, agp_bind *);
-int agp_unbind_user(void *, agp_unbind *);
int agp_acquire_helper(void *dev, enum agp_acquire_state state);
int agp_release_helper(void *dev, enum agp_acquire_state state);
@@ -208,101 +201,6 @@ struct cfdriver agp_cd = {
NULL, "agp", DV_DULL
};
-paddr_t
-agpmmap(dev_t dev, off_t off, int prot)
-{
- struct agp_softc *sc = agp_find_device(AGPUNIT(dev));
-
- if (sc == NULL)
- return (-1);
-
- return agp_mmap(sc, off, prot);
-}
-int
-agpopen(dev_t dev, int oflags, int devtype, struct proc *p)
-{
- struct agp_softc *sc = agp_find_device(AGPUNIT(dev));
-
- if (sc == NULL || sc->sc_chipc == NULL)
- return (ENXIO);
-
- if (!sc->sc_opened)
- sc->sc_opened = 1;
- else
- return (EBUSY);
-
- return (0);
-}
-
-
-int
-agpioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *pb)
-{
- struct agp_softc *sc = agp_find_device(AGPUNIT(dev));
-
- if (sc == NULL)
- return (ENODEV);
-
- if (sc->sc_methods == NULL || sc->sc_chipc == NULL)
- return (ENXIO);
-
- if (cmd != AGPIOC_INFO && !(flag & FWRITE))
- return (EPERM);
-
- switch(cmd) {
- case AGPIOC_INFO:
- return (agp_info_user(sc, (agp_info *)addr));
-
- case AGPIOC_ACQUIRE:
- return (agp_acquire_helper(sc, AGP_ACQUIRE_USER));
-
- case AGPIOC_RELEASE:
- return (agp_release_helper(sc, AGP_ACQUIRE_USER));
-
- case AGPIOC_SETUP:
- return (agp_setup_user(sc, (agp_setup *)addr));
-
- case AGPIOC_ALLOCATE:
- return (agp_allocate_user(sc, (agp_allocate *)addr));
-
- case AGPIOC_DEALLOCATE:
- return (agp_deallocate_user(sc, *(int *)addr));
-
- case AGPIOC_BIND:
- return (agp_bind_user(sc, (agp_bind *)addr));
-
- case AGPIOC_UNBIND:
- return (agp_unbind_user(sc, (agp_unbind *)addr));
-
- default:
- return (ENOTTY);
- }
-
-}
-
-int
-agpclose(dev_t dev, int flags, int devtype, struct proc *p)
-{
- struct agp_softc *sc = agp_find_device(AGPUNIT(dev));
- struct agp_memory *mem;
-
- /*
- * Clear the GATT and force release on last close
- */
- if (sc->sc_state == AGP_ACQUIRE_USER) {
- while ((mem = TAILQ_FIRST(&sc->sc_memory)) != 0) {
- if (mem->am_is_bound) {
- agp_unbind_memory(sc, mem);
- }
- agp_free_memory(sc, mem);
- }
- agp_release_helper(sc, AGP_ACQUIRE_USER);
- }
- sc->sc_opened = 0;
-
- return (0);
-}
-
struct agp_memory *
agp_find_memory(struct agp_softc *sc, int id)
{
@@ -697,96 +595,6 @@ agp_release_helper(void *dev, enum agp_acquire_state state)
return (0);
}
-/* Implementation of the userland ioctl API */
-
-int
-agp_info_user(void *dev, agp_info *info)
-{
- struct agp_softc *sc = (struct agp_softc *) dev;
-
- if (!sc->sc_chipc)
- return (ENXIO);
-
- bzero(info, sizeof *info);
- info->bridge_id = sc->sc_id;
- if (sc->sc_capoff != 0)
- info->agp_mode = pci_conf_read(sc->sc_pc, sc->sc_pcitag,
- AGP_STATUS + sc->sc_capoff);
- else
- info->agp_mode = 0; /* i810 doesn't have real AGP */
- info->aper_base = sc->sc_apaddr;
- info->aper_size = sc->sc_apsize >> 20;
- info->pg_total =
- info->pg_system = sc->sc_maxmem >> AGP_PAGE_SHIFT;
- info->pg_used = sc->sc_allocated >> AGP_PAGE_SHIFT;
-
- return (0);
-}
-
-int
-agp_setup_user(void *dev, agp_setup *setup)
-{
- struct agp_softc *sc = dev;
-
- return (agp_enable(sc, setup->agp_mode));
-}
-
-int
-agp_allocate_user(void *dev, agp_allocate *alloc)
-{
- struct agp_softc *sc = dev;
- struct agp_memory *mem;
- size_t size = alloc->pg_count << AGP_PAGE_SHIFT;
-
- if (sc->sc_allocated + size > sc->sc_maxmem)
- return (EINVAL);
-
- mem = agp_alloc_memory(sc, alloc->type, size);
- if (mem) {
- alloc->key = mem->am_id;
- alloc->physical = mem->am_physical;
- return (0);
- } else
- return (ENOMEM);
-}
-
-int
-agp_deallocate_user(void *dev, int id)
-{
- struct agp_softc *sc = dev;
- struct agp_memory *mem;
-
- if ((mem = agp_find_memory(sc, id)) != NULL) {
- agp_free_memory(sc, mem);
- return (0);
- } else
- return (ENOENT);
-}
-
-int
-agp_bind_user(void *dev, agp_bind *bind)
-{
- struct agp_softc *sc = dev;
- struct agp_memory *mem;
-
- if ((mem = agp_find_memory(sc, bind->key)) == NULL)
- return (ENOENT);
- return (agp_bind_memory(sc, mem, bind->pg_start << AGP_PAGE_SHIFT));
-}
-
-
-int
-agp_unbind_user(void *dev, agp_unbind *unbind)
-{
- struct agp_softc *sc = dev;
- struct agp_memory *mem;
-
- if ((mem = agp_find_memory(sc, unbind->key)) == NULL)
- return (ENOENT);
-
- return (agp_unbind_memory(sc, mem));
-}
-
/* Implementation of the kernel api */
void *
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 4ee9cd73529..661a8093995 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.126 2013/11/04 14:07:15 deraadt Exp $ */
+/* $OpenBSD: conf.h,v 1.127 2014/03/14 23:42:41 kettenis Exp $ */
/* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */
/*-
@@ -474,13 +474,6 @@ extern struct cdevsw cdevsw[];
(dev_type_stop((*))) enodev, 0, selfalse, \
(dev_type_mmap((*))) enodev }
-/* open, close, ioctl, mmap */
-#define cdev_agp_init(c,n) { \
- dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
- (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
- (dev_type_stop((*))) enodev, 0, selfalse, \
- dev_init(c,n,mmap) }
-
/* open, close, read, ioctl, poll, mmap, nokqfilter */
#define cdev_drm_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), dev_init(c, n, read), \