diff options
author | Jeremy Kolb <jkolb@brandeis.edu> | 2007-10-31 20:14:48 -0400 |
---|---|---|
committer | Jeremy Kolb <jkolb@brandeis.edu> | 2007-10-31 20:14:48 -0400 |
commit | 9416541fb29666c630f2bcfcc0f3ae0b6c4436d8 (patch) | |
tree | e9eb35ec99c6173967202518faea490f593be9cf /linux-core/drm_bo.c | |
parent | 31847b4b62575739a164e019b33ced0531683403 (diff) | |
parent | 61cbcb5dbe487c6d4eba04794cbaa0279ab807b0 (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm
Diffstat (limited to 'linux-core/drm_bo.c')
-rw-r--r-- | linux-core/drm_bo.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c index 16203c77..dc96e8aa 100644 --- a/linux-core/drm_bo.c +++ b/linux-core/drm_bo.c @@ -806,6 +806,9 @@ static int drm_bo_mt_compatible(struct drm_mem_type_manager * man, } flag_diff = (mask ^ cur_flags); + if (flag_diff & DRM_BO_FLAG_CACHED_MAPPED) + cur_flags |= DRM_BO_FLAG_CACHED_MAPPED; + if ((flag_diff & DRM_BO_FLAG_CACHED) && (!(mask & DRM_BO_FLAG_CACHED) || (mask & DRM_BO_FLAG_FORCE_CACHING))) @@ -1029,7 +1032,7 @@ static int drm_bo_busy(struct drm_buffer_object * bo) return 0; } -static int drm_bo_read_cached(struct drm_buffer_object * bo) +static int drm_bo_evict_cached(struct drm_buffer_object * bo) { int ret = 0; @@ -1177,15 +1180,11 @@ static int drm_buffer_object_map(struct drm_file *file_priv, uint32_t handle, goto out; } - if ((map_flags & DRM_BO_FLAG_READ) && - (bo->mem.flags & DRM_BO_FLAG_READ_CACHED) && - (!(bo->mem.flags & DRM_BO_FLAG_CACHED))) { - drm_bo_read_cached(bo); - } + if (bo->mem.flags & DRM_BO_FLAG_CACHED_MAPPED) + drm_bo_evict_cached(bo); + break; - } else if ((map_flags & DRM_BO_FLAG_READ) && - (bo->mem.flags & DRM_BO_FLAG_READ_CACHED) && - (!(bo->mem.flags & DRM_BO_FLAG_CACHED))) { + } else if (bo->mem.flags & DRM_BO_FLAG_CACHED_MAPPED) { /* * We are already mapped with different flags. @@ -1666,7 +1665,6 @@ int drm_buffer_object_create(struct drm_device *dev, DRM_BO_FLAG_MAPPABLE; atomic_inc(&bm->count); ret = drm_bo_new_mask(bo, mask, hint); - if (ret) goto out_err; |