diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-11-08 20:25:00 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-11-08 20:25:00 +0000 |
commit | a10d8178e32528e0fd8a7afa24e71a35b1c0582d (patch) | |
tree | fdf902a22d38ed246b7f0bdc9943359e33e9ca8a /bsd-core | |
parent | 2c6308fe54c10075379cb00506d5519e0ced1076 (diff) |
Initial port of savage to FreeBSD for the AGP and !ShadowStatus case. Adds
drm_mtrr_{add,del} for handling the MTRR setup. Still has a LOR issue
with DRM_VERIFYAREA_READ/DRM_COPY_FROM_USER_UNCHECKED in savage_bci.c
-- this won't work with the fine-grained locking in use, and just doing
a single copyin to a temporary will probably work fine. Also note that
the module leaks approximately 4 kb on unload.
Diffstat (limited to 'bsd-core')
-rw-r--r-- | bsd-core/Makefile | 2 | ||||
-rw-r--r-- | bsd-core/drmP.h | 3 | ||||
-rw-r--r-- | bsd-core/drm_bufs.c | 2 | ||||
-rw-r--r-- | bsd-core/drm_drv.c | 2 | ||||
-rw-r--r-- | bsd-core/drm_memory.c | 2 | ||||
-rw-r--r-- | bsd-core/savage_drv.c | 24 |
6 files changed, 18 insertions, 17 deletions
diff --git a/bsd-core/Makefile b/bsd-core/Makefile index a5ac952b..96b878c0 100644 --- a/bsd-core/Makefile +++ b/bsd-core/Makefile @@ -55,7 +55,7 @@ SHAREDFILES= drm.h \ via_verifier.h \ via_video.c -SUBDIR = drm mach64 mga r128 radeon sis tdfx # via i915 +SUBDIR = drm mach64 mga r128 radeon savage sis tdfx # via i915 CLEANFILES+= ${SHAREDFILES} diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 0adfef93..43f24271 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -843,7 +843,7 @@ void drm_free(void *pt, size_t size, int area); void *drm_ioremap(drm_device_t *dev, drm_local_map_t *map); void drm_ioremapfree(drm_local_map_t *map); int drm_mtrr_add(unsigned long offset, size_t size, int flags); -int drm_mtrr_del(unsigned long offset, size_t size, int flags); +int drm_mtrr_del(int handle, unsigned long offset, size_t size, int flags); int drm_context_switch(drm_device_t *dev, int old, int new); int drm_context_switch_complete(drm_device_t *dev, int new); @@ -880,6 +880,7 @@ int drm_dma_setup(drm_device_t *dev); void drm_dma_takedown(drm_device_t *dev); void drm_free_buffer(drm_device_t *dev, drm_buf_t *buf); void drm_reclaim_buffers(drm_device_t *dev, DRMFILE filp); +#define drm_core_reclaim_buffers drm_reclaim_buffers /* IRQ support (drm_irq.c) */ int drm_irq_install(drm_device_t *dev); diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 93bcc812..5edc6feb 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -297,7 +297,7 @@ void drm_rmmap(drm_device_t *dev, drm_local_map_t *map) if (map->mtrr) { int __unused retcode; - retcode = drm_mtrr_del(map->offset, map->size, + retcode = drm_mtrr_del(0, map->offset, map->size, DRM_MTRR_WC); DRM_DEBUG("mtrr_del = %d\n", retcode); } diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 6766195b..951f7462 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -576,7 +576,7 @@ static void drm_unload(drm_device_t *dev) if (dev->agp && dev->agp->mtrr) { int __unused retcode; - retcode = drm_mtrr_del(dev->agp->info.ai_aperture_base, + retcode = drm_mtrr_del(0, dev->agp->info.ai_aperture_base, dev->agp->info.ai_aperture_size, DRM_MTRR_WC); DRM_DEBUG("mtrr_del = %d", retcode); } diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c index ea084c52..6d467e98 100644 --- a/bsd-core/drm_memory.c +++ b/bsd-core/drm_memory.c @@ -113,7 +113,7 @@ drm_mtrr_add(unsigned long offset, size_t size, int flags) } int -drm_mtrr_del(unsigned long offset, size_t size, int flags) +drm_mtrr_del(int __unused handle, unsigned long offset, size_t size, int flags) { int act; struct mem_range_desc mrdesc; diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c index c9a2fb10..71b5065b 100644 --- a/bsd-core/savage_drv.c +++ b/bsd-core/savage_drv.c @@ -43,15 +43,15 @@ extern int savage_max_ioctl; static void savage_configure(drm_device_t *dev) { dev->driver.buf_priv_size = sizeof(drm_savage_buf_priv_t); - dev->load = savage_driver_load; - dev->firstopen = savage_driver_firstopen; - dev->lastclose = savage_driver_lastclose; - dev->unload = savage_driver_unload; - dev->reclaim_buffers = savage_reclaim_buffers; - dev->dma_ioctl = savage_bci_buffers; + dev->driver.load = savage_driver_load; + dev->driver.firstopen = savage_driver_firstopen; + dev->driver.lastclose = savage_driver_lastclose; + dev->driver.unload = savage_driver_unload; + dev->driver.reclaim_buffers_locked = savage_reclaim_buffers; + dev->driver.dma_ioctl = savage_bci_buffers; - dev->ioctls = savage_ioctls; - dev->max_ioctl = savage_max_ioctl; + dev->driver.ioctls = savage_ioctls; + dev->driver.max_ioctl = savage_max_ioctl; dev->driver.name = DRIVER_NAME; dev->driver.desc = DRIVER_DESC; @@ -60,10 +60,10 @@ static void savage_configure(drm_device_t *dev) dev->driver.minor = DRIVER_MINOR; dev->driver.patchlevel = DRIVER_PATCHLEVEL; - dev->use_agp = 1; - dev->use_mtrr = 1; - dev->use_pci_dma = 1; - dev->use_dma = 1; + dev->driver.use_agp = 1; + dev->driver.use_mtrr = 1; + dev->driver.use_pci_dma = 1; + dev->driver.use_dma = 1; } #ifdef __FreeBSD__ |