drm/radeon/ttm: more VRAM fixes

main
Dave Airlie 2007-07-16 14:45:47 +10:00
parent ead9cd64bd
commit 0be629a914
2 changed files with 8 additions and 4 deletions

View File

@ -71,6 +71,11 @@ uint32_t radeon_evict_mask(drm_buffer_object_t *bo)
case DRM_BO_MEM_LOCAL: case DRM_BO_MEM_LOCAL:
case DRM_BO_MEM_TT: case DRM_BO_MEM_TT:
return DRM_BO_FLAG_MEM_LOCAL; return DRM_BO_FLAG_MEM_LOCAL;
case DRM_BO_MEM_VRAM:
if (bo->mem.num_pages > 128)
return DRM_BO_MEM_TT;
else
return DRM_BO_MEM_LOCAL;
default: default:
return DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_CACHED; return DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_CACHED;
} }
@ -88,8 +93,7 @@ int radeon_init_mem_type(drm_device_t * dev, uint32_t type,
man->drm_bus_maptype = 0; man->drm_bus_maptype = 0;
break; break;
case DRM_BO_MEM_VRAM: case DRM_BO_MEM_VRAM:
man->flags = _DRM_FLAG_MEMTYPE_MAPPABLE | man->flags = _DRM_FLAG_MEMTYPE_MAPPABLE | _DRM_FLAG_NEEDS_IOREMAP;
_DRM_FLAG_MEMTYPE_FIXED | _DRM_FLAG_NEEDS_IOREMAP;
man->io_addr = NULL; man->io_addr = NULL;
man->drm_bus_maptype = _DRM_FRAME_BUFFER; man->drm_bus_maptype = _DRM_FRAME_BUFFER;
man->io_offset = drm_get_resource_start(dev, 0); man->io_offset = drm_get_resource_start(dev, 0);

View File

@ -71,8 +71,8 @@ static drm_fence_driver_t radeon_fence_driver = {
#endif #endif
#ifdef RADEON_HAVE_BUFFER #ifdef RADEON_HAVE_BUFFER
static uint32_t radeon_mem_prios[] = {DRM_BO_MEM_PRIV0, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL}; static uint32_t radeon_mem_prios[] = {DRM_BO_MEM_VRAM, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL};
static uint32_t radeon_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_PRIV0, DRM_BO_MEM_LOCAL}; static uint32_t radeon_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_VRAM, DRM_BO_MEM_LOCAL};
static drm_bo_driver_t radeon_bo_driver = { static drm_bo_driver_t radeon_bo_driver = {
.mem_type_prio = radeon_mem_prios, .mem_type_prio = radeon_mem_prios,