diff options
author | Dave Airlie <airlied@redhat.com> | 2008-08-26 17:33:46 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-08-26 17:33:46 +1000 |
commit | 4c8e8e0d0bad839cf5aacb22524885e49fe86715 (patch) | |
tree | b0d37af2d264f13155502bfbcf01048011d1df03 /linux-core/drm_bo.c | |
parent | 9afd2659430245c456cf887d47087de047c0aba8 (diff) |
drm: add memory clean flag.
When the mapping is clean this flag will be set. This can be used
by a driver to save migrating and allocating pages for an object
that will first be used in VRAM.
Diffstat (limited to 'linux-core/drm_bo.c')
-rw-r--r-- | linux-core/drm_bo.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c index 09b3fa39..ec63fa2a 100644 --- a/linux-core/drm_bo.c +++ b/linux-core/drm_bo.c @@ -1170,6 +1170,9 @@ out_unlock: DRM_FLAG_MASKED(bo->priv_flags, _DRM_BO_FLAG_UNFENCED, _DRM_BO_FLAG_UNFENCED); } + /* clear the clean flags */ + bo->mem.flags &= ~DRM_BO_FLAG_CLEAN; + mutex_unlock(&dev->struct_mutex); mutex_unlock(&bm->evict_mutex); return ret; @@ -1493,12 +1496,14 @@ int drm_buffer_object_create(struct drm_device *dev, bo->buffer_start = buffer_start & PAGE_MASK; bo->priv_flags = 0; bo->mem.flags = (DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED | - DRM_BO_FLAG_MAPPABLE); + DRM_BO_FLAG_MAPPABLE | DRM_BO_FLAG_CLEAN); bo->mem.proposed_flags = 0; atomic_inc(&bm->count); /* * Use drm_bo_modify_proposed_flags to error-check the proposed flags */ + flags |= DRM_BO_FLAG_CLEAN; /* or in the clean flag */ + ret = drm_bo_modify_proposed_flags (bo, flags, flags); if (ret) goto out_err; |