Buffer flags and masks are 64-bit.

don't mask off the high dword.
main
Thomas Hellstrom 2007-10-26 10:25:57 +02:00
parent 9adf8c0256
commit 26c32a3d79
3 changed files with 14 additions and 13 deletions

View File

@ -54,9 +54,9 @@ static int drm_bo_setup_vm_locked(struct drm_buffer_object * bo);
static void drm_bo_takedown_vm_locked(struct drm_buffer_object * bo); static void drm_bo_takedown_vm_locked(struct drm_buffer_object * bo);
static void drm_bo_unmap_virtual(struct drm_buffer_object * bo); static void drm_bo_unmap_virtual(struct drm_buffer_object * bo);
static inline uint32_t drm_bo_type_flags(unsigned type) static inline uint64_t drm_bo_type_flags(unsigned type)
{ {
return (1 << (24 + type)); return (1ULL << (24 + type));
} }
/* /*
@ -784,10 +784,10 @@ static int drm_bo_mem_force_space(struct drm_device * dev,
static int drm_bo_mt_compatible(struct drm_mem_type_manager * man, static int drm_bo_mt_compatible(struct drm_mem_type_manager * man,
uint32_t mem_type, uint32_t mem_type,
uint32_t mask, uint32_t * res_mask) uint64_t mask, uint32_t * res_mask)
{ {
uint32_t cur_flags = drm_bo_type_flags(mem_type); uint64_t cur_flags = drm_bo_type_flags(mem_type);
uint32_t flag_diff; uint64_t flag_diff;
if (man->flags & _DRM_FLAG_MEMTYPE_CACHED) if (man->flags & _DRM_FLAG_MEMTYPE_CACHED)
cur_flags |= DRM_BO_FLAG_CACHED; cur_flags |= DRM_BO_FLAG_CACHED;
@ -1270,7 +1270,7 @@ static void drm_buffer_user_object_unmap(struct drm_file *file_priv,
* Note that new_mem_flags are NOT transferred to the bo->mem.mask. * Note that new_mem_flags are NOT transferred to the bo->mem.mask.
*/ */
int drm_bo_move_buffer(struct drm_buffer_object * bo, uint32_t new_mem_flags, int drm_bo_move_buffer(struct drm_buffer_object * bo, uint64_t new_mem_flags,
int no_wait, int move_unfenced) int no_wait, int move_unfenced)
{ {
struct drm_device *dev = bo->dev; struct drm_device *dev = bo->dev;

View File

@ -53,8 +53,8 @@ int drm_bo_move_ttm(struct drm_buffer_object * bo,
{ {
struct drm_ttm *ttm = bo->ttm; struct drm_ttm *ttm = bo->ttm;
struct drm_bo_mem_reg *old_mem = &bo->mem; struct drm_bo_mem_reg *old_mem = &bo->mem;
uint32_t save_flags = old_mem->flags; uint64_t save_flags = old_mem->flags;
uint32_t save_mask = old_mem->mask; uint64_t save_mask = old_mem->mask;
int ret; int ret;
if (old_mem->mem_type == DRM_BO_MEM_TT) { if (old_mem->mem_type == DRM_BO_MEM_TT) {
@ -211,8 +211,8 @@ int drm_bo_move_memcpy(struct drm_buffer_object * bo,
void *old_iomap; void *old_iomap;
void *new_iomap; void *new_iomap;
int ret; int ret;
uint32_t save_flags = old_mem->flags; uint64_t save_flags = old_mem->flags;
uint32_t save_mask = old_mem->mask; uint64_t save_mask = old_mem->mask;
unsigned long i; unsigned long i;
unsigned long page; unsigned long page;
unsigned long add = 0; unsigned long add = 0;
@ -334,8 +334,8 @@ int drm_bo_move_accel_cleanup(struct drm_buffer_object * bo,
struct drm_mem_type_manager *man = &dev->bm.man[new_mem->mem_type]; struct drm_mem_type_manager *man = &dev->bm.man[new_mem->mem_type];
struct drm_bo_mem_reg *old_mem = &bo->mem; struct drm_bo_mem_reg *old_mem = &bo->mem;
int ret; int ret;
uint32_t save_flags = old_mem->flags; uint64_t save_flags = old_mem->flags;
uint32_t save_mask = old_mem->mask; uint64_t save_mask = old_mem->mask;
struct drm_buffer_object *old_obj; struct drm_buffer_object *old_obj;
if (bo->fence) if (bo->fence)

View File

@ -511,7 +511,8 @@ extern int drm_bo_wait(struct drm_buffer_object * bo, int lazy, int ignore_signa
int no_wait); int no_wait);
extern int drm_bo_mem_space(struct drm_buffer_object * bo, extern int drm_bo_mem_space(struct drm_buffer_object * bo,
struct drm_bo_mem_reg * mem, int no_wait); struct drm_bo_mem_reg * mem, int no_wait);
extern int drm_bo_move_buffer(struct drm_buffer_object * bo, uint32_t new_mem_flags, extern int drm_bo_move_buffer(struct drm_buffer_object * bo,
uint64_t new_mem_flags,
int no_wait, int move_unfenced); int no_wait, int move_unfenced);
extern int drm_bo_clean_mm(struct drm_device * dev, unsigned mem_type); extern int drm_bo_clean_mm(struct drm_device * dev, unsigned mem_type);
extern int drm_bo_init_mm(struct drm_device * dev, unsigned type, extern int drm_bo_init_mm(struct drm_device * dev, unsigned type,