summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranholt <anholt@FreeBSD.org>2004-01-06 04:34:53 +0000
committeranholt <anholt@FreeBSD.org>2004-01-06 04:34:53 +0000
commit7a30cbbe36c3da10547bc71289118de8e9bf0798 (patch)
treedc23cbfd6e49f2154d34faf1bfc9e044ed6193d3
parent6ecda71663ef14ce4784c7105163615d9178cfb9 (diff)
downloadFreeBSD-src-7a30cbbe36c3da10547bc71289118de8e9bf0798.zip
FreeBSD-src-7a30cbbe36c3da10547bc71289118de8e9bf0798.tar.gz
Merge from DRI CVS. No longer maps the framebuffer into KVA on radeon, r128,
and mga. MTRR code cleanups. Includes new Radeon and Rage 128 PCI IDs.
-rw-r--r--sys/dev/drm/drmP.h4
-rw-r--r--sys/dev/drm/drm_bufs.h39
-rw-r--r--sys/dev/drm/drm_drv.h28
-rw-r--r--sys/dev/drm/drm_sysctl.h2
-rw-r--r--sys/dev/drm/mga_dma.c8
-rw-r--r--sys/dev/drm/mga_drv.h1
-rw-r--r--sys/dev/drm/r128.h20
-rw-r--r--sys/dev/drm/r128_cce.c7
-rw-r--r--sys/dev/drm/r128_drv.h1
-rw-r--r--sys/dev/drm/radeon.h25
-rw-r--r--sys/dev/drm/radeon_cp.c7
-rw-r--r--sys/dev/drm/radeon_drv.h1
12 files changed, 77 insertions, 66 deletions
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h
index dc1ab7e..7872c79 100644
--- a/sys/dev/drm/drmP.h
+++ b/sys/dev/drm/drmP.h
@@ -268,7 +268,7 @@ typedef struct drm_agp_head {
int enabled;
int acquired;
unsigned long base;
- int agp_mtrr;
+ int mtrr;
int cant_use_aperture;
unsigned long page_mask;
} drm_agp_head_t;
@@ -288,7 +288,7 @@ typedef struct drm_local_map {
drm_map_flags_t flags; /* Flags */
void *handle; /* User-space: "Handle" to pass to mmap */
/* Kernel-space: kernel-virtual address */
- int mtrr; /* MTRR slot used */
+ int mtrr; /* Boolean: MTRR used */
/* Private data */
bus_space_tag_t iot;
bus_space_handle_t ioh;
diff --git a/sys/dev/drm/drm_bufs.h b/sys/dev/drm/drm_bufs.h
index 8b278f8..8b40f98 100644
--- a/sys/dev/drm/drm_bufs.h
+++ b/sys/dev/drm/drm_bufs.h
@@ -88,7 +88,7 @@ int DRM(addmap)( DRM_IOCTL_ARGS )
map->size = request.size;
map->type = request.type;
map->flags = request.flags;
- map->mtrr = -1;
+ map->mtrr = 0;
map->handle = 0;
/* Only allow shared memory to be removable since we only keep enough
@@ -105,28 +105,23 @@ int DRM(addmap)( DRM_IOCTL_ARGS )
DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
return DRM_ERR(EINVAL);
}
+ if (map->offset + map->size < map->offset) {
+ DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);
+ return DRM_ERR(EINVAL);
+ }
switch ( map->type ) {
case _DRM_REGISTERS:
+ DRM_IOREMAP(map, dev);
+ if (!(map->flags & _DRM_WRITE_COMBINING))
+ break;
+ /* FALLTHROUGH */
case _DRM_FRAME_BUFFER:
- if ( map->offset + map->size < map->offset ) {
- DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
- return DRM_ERR(EINVAL);
- }
#if __REALLY_HAVE_MTRR
- if ( map->type == _DRM_FRAME_BUFFER ||
- (map->flags & _DRM_WRITE_COMBINING) ) {
- int mtrr;
-
- mtrr = DRM(mtrr_add)(map->offset, map->size,
- DRM_MTRR_WC);
- if (mtrr == 0)
- map->mtrr = 1;
- }
-#endif /* __REALLY_HAVE_MTRR */
- DRM_IOREMAP(map, dev);
+ if (DRM(mtrr_add)(map->offset, map->size, DRM_MTRR_WC) == 0)
+ map->mtrr = 1;
+#endif
break;
-
case _DRM_SHM:
map->handle = (void *)DRM(alloc)(map->size, DRM_MEM_SAREA);
DRM_DEBUG( "%lu %d %p\n",
@@ -153,7 +148,7 @@ int DRM(addmap)( DRM_IOCTL_ARGS )
#if __REALLY_HAVE_AGP
case _DRM_AGP:
map->offset += dev->agp->base;
- map->mtrr = dev->agp->agp_mtrr; /* for getmap */
+ map->mtrr = dev->agp->mtrr; /* for getmap */
break;
#endif
case _DRM_SCATTER_GATHER:
@@ -232,12 +227,12 @@ int DRM(rmmap)( DRM_IOCTL_ARGS )
case _DRM_REGISTERS:
case _DRM_FRAME_BUFFER:
#if __REALLY_HAVE_MTRR
- if (map->mtrr >= 0) {
- int __unused mtrr;
+ if (map->mtrr) {
+ int __unused retcode;
- mtrr = DRM(mtrr_del)(map->offset, map->size,
+ retcode = DRM(mtrr_del)(map->offset, map->size,
DRM_MTRR_WC);
- DRM_DEBUG("mtrr_del = %d\n", mtrr);
+ DRM_DEBUG("mtrr_del = %d\n", retcode);
}
#endif
DRM(ioremapfree)(map);
diff --git a/sys/dev/drm/drm_drv.h b/sys/dev/drm/drm_drv.h
index 395ba0b..f34d3a8 100644
--- a/sys/dev/drm/drm_drv.h
+++ b/sys/dev/drm/drm_drv.h
@@ -566,17 +566,18 @@ static int DRM(takedown)( drm_device_t *dev )
map = list->map;
switch ( map->type ) {
case _DRM_REGISTERS:
+ DRM(ioremapfree)(map);
+ /* FALLTHROUGH */
case _DRM_FRAME_BUFFER:
#if __REALLY_HAVE_MTRR
- if ( map->mtrr >= 0 ) {
- int __unused mtrr;
+ if (map->mtrr) {
+ int __unused retcode;
- mtrr = DRM(mtrr_del)(map->offset,
+ retcode = DRM(mtrr_del)(map->offset,
map->size, DRM_MTRR_WC);
- DRM_DEBUG("mtrr_del=%d\n", mtrr);
+ DRM_DEBUG("mtrr_del = %d", retcode);
}
#endif
- DRM(ioremapfree)( map );
break;
case _DRM_SHM:
DRM(free)(map->handle,
@@ -680,12 +681,9 @@ static int DRM(init)( device_t nbdev )
#endif /* __MUST_HAVE_AGP */
#if __REALLY_HAVE_MTRR
if (dev->agp) {
- int retcode;
-
- retcode = DRM(mtrr_add)(dev->agp->info.ai_aperture_base,
- dev->agp->info.ai_aperture_size, DRM_MTRR_WC);
- if (retcode == 0)
- dev->agp->agp_mtrr=1;
+ if (DRM(mtrr_add)(dev->agp->info.ai_aperture_base,
+ dev->agp->info.ai_aperture_size, DRM_MTRR_WC) == 0)
+ dev->agp->mtrr = 1;
}
#endif /* __REALLY_HAVE_MTRR */
#endif /* __REALLY_HAVE_AGP */
@@ -743,12 +741,12 @@ static void DRM(cleanup)(drm_device_t *dev)
#endif
#if __REALLY_HAVE_AGP && __REALLY_HAVE_MTRR
- if ( dev->agp && dev->agp->agp_mtrr >= 0) {
- int __unused mtrr;
+ if (dev->agp && dev->agp->mtrr) {
+ int __unused retcode;
- mtrr = DRM(mtrr_del)(dev->agp->info.ai_aperture_base,
+ retcode = DRM(mtrr_del)(dev->agp->info.ai_aperture_base,
dev->agp->info.ai_aperture_size, DRM_MTRR_WC);
- DRM_DEBUG("mtrr_del=%d\n", mtrr);
+ DRM_DEBUG("mtrr_del = %d", retcode);
}
#endif
diff --git a/sys/dev/drm/drm_sysctl.h b/sys/dev/drm/drm_sysctl.h
index ee25d90..a1ab863 100644
--- a/sys/dev/drm/drm_sysctl.h
+++ b/sys/dev/drm/drm_sysctl.h
@@ -194,7 +194,7 @@ static int DRM(vm_info)DRM_SYSCTL_HANDLER_ARGS
else
type = types[map->type];
- if (map->mtrr <= 0)
+ if (!map->mtrr)
yesno = "no";
else
yesno = "yes";
diff --git a/sys/dev/drm/mga_dma.c b/sys/dev/drm/mga_dma.c
index 01406b5..3f75d76 100644
--- a/sys/dev/drm/mga_dma.c
+++ b/sys/dev/drm/mga_dma.c
@@ -502,14 +502,6 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
- if(!dev_priv->fb) {
- DRM_ERROR( "failed to find framebuffer!\n" );
- /* Assign dev_private so we can do cleanup. */
- dev->dev_private = (void *)dev_priv;
- mga_do_cleanup_dma( dev );
- return DRM_ERR(EINVAL);
- }
DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
if(!dev_priv->mmio) {
DRM_ERROR( "failed to find mmio region!\n" );
diff --git a/sys/dev/drm/mga_drv.h b/sys/dev/drm/mga_drv.h
index 54c6926..c84c9ea 100644
--- a/sys/dev/drm/mga_drv.h
+++ b/sys/dev/drm/mga_drv.h
@@ -93,7 +93,6 @@ typedef struct drm_mga_private {
unsigned int texture_size;
drm_local_map_t *sarea;
- drm_local_map_t *fb;
drm_local_map_t *mmio;
drm_local_map_t *status;
drm_local_map_t *warp;
diff --git a/sys/dev/drm/r128.h b/sys/dev/drm/r128.h
index c94e329..6ed9dea 100644
--- a/sys/dev/drm/r128.h
+++ b/sys/dev/drm/r128.h
@@ -86,10 +86,30 @@
{0x1002, 0x4c46, 0, "ATI Rage 128 Mobility LF (AGP)"}, \
{0x1002, 0x4d46, 0, "ATI Rage 128 Mobility MF (AGP)"}, \
{0x1002, 0x4d4c, 0, "ATI Rage 128 Mobility ML (AGP)"}, \
+ {0x1002, 0x5041, 0, "ATI Rage 128 Pro PA (PCI)"}, \
+ {0x1002, 0x5042, 0, "ATI Rage 128 Pro PB (AGP)"}, \
+ {0x1002, 0x5043, 0, "ATI Rage 128 Pro PC (AGP)"}, \
{0x1002, 0x5044, 0, "ATI Rage 128 Pro PD (PCI)"}, \
+ {0x1002, 0x5045, 0, "ATI Rage 128 Pro PE (AGP)"}, \
{0x1002, 0x5046, 0, "ATI Rage 128 Pro PF (AGP)"}, \
+ {0x1002, 0x5047, 0, "ATI Rage 128 Pro PG (PCI)"}, \
+ {0x1002, 0x5048, 0, "ATI Rage 128 Pro PH (AGP)"}, \
+ {0x1002, 0x5049, 0, "ATI Rage 128 Pro PI (AGP)"}, \
+ {0x1002, 0x504A, 0, "ATI Rage 128 Pro PJ (PCI)"}, \
+ {0x1002, 0x504B, 0, "ATI Rage 128 Pro PK (AGP)"}, \
+ {0x1002, 0x504C, 0, "ATI Rage 128 Pro PL (AGP)"}, \
+ {0x1002, 0x504D, 0, "ATI Rage 128 Pro PM (PCI)"}, \
+ {0x1002, 0x504E, 0, "ATI Rage 128 Pro PN (AGP)"}, \
+ {0x1002, 0x504F, 0, "ATI Rage 128 Pro PO (AGP)"}, \
{0x1002, 0x5050, 0, "ATI Rage 128 Pro PP (PCI)"}, \
+ {0x1002, 0x5051, 0, "ATI Rage 128 Pro PQ (AGP)"}, \
{0x1002, 0x5052, 0, "ATI Rage 128 Pro PR (PCI)"}, \
+ {0x1002, 0x5053, 0, "ATI Rage 128 Pro PS (PCI)"}, \
+ {0x1002, 0x5054, 0, "ATI Rage 128 Pro PT (AGP)"}, \
+ {0x1002, 0x5055, 0, "ATI Rage 128 Pro PU (AGP)"}, \
+ {0x1002, 0x5056, 0, "ATI Rage 128 Pro PV (PCI)"}, \
+ {0x1002, 0x5057, 0, "ATI Rage 128 Pro PW (AGP)"}, \
+ {0x1002, 0x5058, 0, "ATI Rage 128 Pro PX (AGP)"}, \
{0x1002, 0x5245, 0, "ATI Rage 128 RE (PCI)"}, \
{0x1002, 0x5246, 0, "ATI Rage 128 RF (AGP)"}, \
{0x1002, 0x5247, 0, "ATI Rage 128 RG (AGP)"}, \
diff --git a/sys/dev/drm/r128_cce.c b/sys/dev/drm/r128_cce.c
index 39b37a8..e7160bd 100644
--- a/sys/dev/drm/r128_cce.c
+++ b/sys/dev/drm/r128_cce.c
@@ -469,13 +469,6 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
- if(!dev_priv->fb) {
- DRM_ERROR("could not find framebuffer!\n");
- dev->dev_private = (void *)dev_priv;
- r128_do_cleanup_cce( dev );
- return DRM_ERR(EINVAL);
- }
DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
if(!dev_priv->mmio) {
DRM_ERROR("could not find mmio region!\n");
diff --git a/sys/dev/drm/r128_drv.h b/sys/dev/drm/r128_drv.h
index e465dc5..0695684 100644
--- a/sys/dev/drm/r128_drv.h
+++ b/sys/dev/drm/r128_drv.h
@@ -99,7 +99,6 @@ typedef struct drm_r128_private {
u32 span_pitch_offset_c;
drm_local_map_t *sarea;
- drm_local_map_t *fb;
drm_local_map_t *mmio;
drm_local_map_t *cce_ring;
drm_local_map_t *ring_rptr;
diff --git a/sys/dev/drm/radeon.h b/sys/dev/drm/radeon.h
index 3cdf7fb..6083f26 100644
--- a/sys/dev/drm/radeon.h
+++ b/sys/dev/drm/radeon.h
@@ -116,7 +116,14 @@
[DRM_IOCTL_NR(DRM_IOCTL_RADEON_SETPARAM)] = { radeon_cp_setparam, 1, 0 }, \
#define DRIVER_PCI_IDS \
+ {0x1002, 0x4136, 0, "ATI Radeon RS100 IGP 320M"}, \
+ {0x1002, 0x4137, 0, "ATI Radeon RS200 IGP"}, \
+ {0x1002, 0x4237, 0, "ATI Radeon RS250 IGP"}, \
{0x1002, 0x4242, 0, "ATI Radeon BB R200 AIW 8500DV"}, \
+ {0x1002, 0x4242, 0, "ATI Radeon BC R200"}, \
+ {0x1002, 0x4336, 0, "ATI Radeon RS100 Mobility U1"}, \
+ {0x1002, 0x4337, 0, "ATI Radeon RS200 Mobility IGP 340M"}, \
+ {0x1002, 0x4437, 0, "ATI Radeon RS250 Mobility IGP"}, \
{0x1002, 0x4964, 0, "ATI Radeon Id R250 9000"}, \
{0x1002, 0x4965, 0, "ATI Radeon Ie R250 9000"}, \
{0x1002, 0x4966, 0, "ATI Radeon If R250 9000"}, \
@@ -150,7 +157,23 @@
{0x1002, 0x516A, 0, "ATI Radeon Qj R200"}, \
{0x1002, 0x516B, 0, "ATI Radeon Qk R200"}, \
{0x1002, 0x516C, 0, "ATI Radeon Ql R200"}, \
- {0x1002, 0x5961, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x5834, 0, "ATI Radeon RS300 IGP"}, \
+ {0x1002, 0x5835, 0, "ATI Radeon RS300 Mobility IGP"}, \
+ {0x1002, 0x5836, 0, "ATI Radeon RS300 IGP"}, \
+ {0x1002, 0x5837, 0, "ATI Radeon RS300 IGP"}, \
+ {0x1002, 0x5960, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x5961, 0, "ATI Radeon RV280 9200 SE"}, \
+ {0x1002, 0x5962, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x5963, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x5964, 0, "ATI Radeon RV280 9200 SE"}, \
+ {0x1002, 0x5968, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x5969, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x596A, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x596B, 0, "ATI Radeon RV280 9200"}, \
+ {0x1002, 0x5c61, 0, "ATI Radeon RV280 Mobility"}, \
+ {0x1002, 0x5c62, 0, "ATI Radeon RV280"}, \
+ {0x1002, 0x5c63, 0, "ATI Radeon RV280 Mobility"}, \
+ {0x1002, 0x5c64, 0, "ATI Radeon RV280"}, \
{0, 0, 0, NULL}
#define DRIVER_FILE_FIELDS \
diff --git a/sys/dev/drm/radeon_cp.c b/sys/dev/drm/radeon_cp.c
index 6ec65b7..59cd9ff 100644
--- a/sys/dev/drm/radeon_cp.c
+++ b/sys/dev/drm/radeon_cp.c
@@ -1120,13 +1120,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
- if(!dev_priv->fb) {
- DRM_ERROR("could not find framebuffer!\n");
- dev->dev_private = (void *)dev_priv;
- radeon_do_cleanup_cp(dev);
- return DRM_ERR(EINVAL);
- }
DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
if(!dev_priv->mmio) {
DRM_ERROR("could not find mmio region!\n");
diff --git a/sys/dev/drm/radeon_drv.h b/sys/dev/drm/radeon_drv.h
index 6a04349..3794db9 100644
--- a/sys/dev/drm/radeon_drv.h
+++ b/sys/dev/drm/radeon_drv.h
@@ -137,7 +137,6 @@ typedef struct drm_radeon_private {
unsigned long gart_textures_offset;
drm_local_map_t *sarea;
- drm_local_map_t *fb;
drm_local_map_t *mmio;
drm_local_map_t *cp_ring;
drm_local_map_t *ring_rptr;
OpenPOWER on IntegriCloud