radeon: add userspace mm enable switch

main
Dave Airlie 2008-08-04 14:59:17 +10:00
parent 29649ddede
commit aa8e15f8b5
4 changed files with 12 additions and 4 deletions

View File

@ -1364,8 +1364,7 @@ static int radeon_do_cleanup_cp(struct drm_device * dev)
if (dev_priv->gart_info.bus_addr) {
/* Turn off PCI GART */
radeon_set_pcigart(dev_priv, 0);
if (!drm_ati_pcigart_cleanup(dev, &dev_priv->gart_info))
DRM_ERROR("failed to cleanup PCI GART!\n");
drm_ati_pcigart_cleanup(dev, &dev_priv->gart_info);
}
if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB)
@ -1373,6 +1372,7 @@ static int radeon_do_cleanup_cp(struct drm_device * dev)
if (dev_priv->pcigart_offset_set == 1) {
drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
dev_priv->gart_info.addr = NULL;
dev_priv->pcigart_offset_set = 0;
}
}
}
@ -1563,8 +1563,10 @@ void radeon_do_release(struct drm_device * dev)
radeon_mem_takedown(&(dev_priv->gart_heap));
radeon_mem_takedown(&(dev_priv->fb_heap));
radeon_gem_mm_fini(dev);
if (dev_priv->user_mm_enable) {
radeon_gem_mm_fini(dev);
dev_priv->user_mm_enable = false;
}
/* deallocate kernel resources */
radeon_do_cleanup_cp(dev);

View File

@ -768,6 +768,7 @@ typedef struct drm_radeon_setparam {
#define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */
#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */
#define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */
#define RADEON_SETPARAM_MM_INIT 7 /* Initialise the mm */
/* 1.14: Clients can allocate/free a surface
*/
typedef struct drm_radeon_surface_alloc {

View File

@ -314,6 +314,8 @@ typedef struct drm_radeon_private {
int new_memmap;
bool user_mm_enable;
int gart_size;
u32 gart_vm_start;
unsigned long gart_buffers_offset;

View File

@ -3182,6 +3182,9 @@ static int radeon_cp_setparam(struct drm_device *dev, void *data, struct drm_fil
case RADEON_SETPARAM_VBLANK_CRTC:
return radeon_vblank_crtc_set(dev, sp->value);
break;
case RADEON_SETPARAM_MM_INIT:
dev_priv->user_mm_enable = true;
return radeon_gem_mm_init(dev);
default:
DRM_DEBUG("Invalid parameter %d\n", sp->param);
return -EINVAL;