diff options
author | Dave Airlie <airlied@redhat.com> | 2008-10-16 10:51:31 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-10-16 10:51:31 +1000 |
commit | d958cd7bb95558aa6c49824e2ae2b302f1433d2e (patch) | |
tree | fcc96465b0ed6b4fe275538863523dfdfda0ba4b | |
parent | 11320fd6b106c1255f3fad0860cb4da71697b46a (diff) |
radeon: use discardable flags on no backing store objects
-rw-r--r-- | linux-core/radeon_fb.c | 2 | ||||
-rw-r--r-- | linux-core/radeon_gem.c | 7 | ||||
-rw-r--r-- | shared-core/radeon_drv.h | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/linux-core/radeon_fb.c b/linux-core/radeon_fb.c index 8c9461da..8d4181e8 100644 --- a/linux-core/radeon_fb.c +++ b/linux-core/radeon_fb.c @@ -728,7 +728,7 @@ int radeonfb_create(struct drm_device *dev, uint32_t fb_width, uint32_t fb_heigh size = mode_cmd.pitch * mode_cmd.height; aligned_size = ALIGN(size, PAGE_SIZE); - fbo = radeon_gem_object_alloc(dev, aligned_size, 1, RADEON_GEM_DOMAIN_VRAM); + fbo = radeon_gem_object_alloc(dev, aligned_size, 1, RADEON_GEM_DOMAIN_VRAM, 0); if (!fbo) { printk(KERN_ERR "failed to allocate framebuffer\n"); ret = -ENOMEM; diff --git a/linux-core/radeon_gem.c b/linux-core/radeon_gem.c index 225f0269..5e2ad98b 100644 --- a/linux-core/radeon_gem.c +++ b/linux-core/radeon_gem.c @@ -74,7 +74,7 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data, } struct drm_gem_object *radeon_gem_object_alloc(struct drm_device *dev, int size, int alignment, - int initial_domain) + int initial_domain, bool discardable) { struct drm_gem_object *obj; struct drm_radeon_gem_object *obj_priv; @@ -97,6 +97,9 @@ struct drm_gem_object *radeon_gem_object_alloc(struct drm_device *dev, int size, flags |= DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_EXE; + if (discardable) + flags |= DRM_BO_FLAG_DISCARDABLE; + if (alignment == 0) alignment = PAGE_SIZE; @@ -129,7 +132,7 @@ int radeon_gem_create_ioctl(struct drm_device *dev, void *data, /* create a gem object to contain this object in */ args->size = roundup(args->size, PAGE_SIZE); - obj = radeon_gem_object_alloc(dev, args->size, args->alignment, args->initial_domain); + obj = radeon_gem_object_alloc(dev, args->size, args->alignment, args->initial_domain, args->no_backing_store); if (!obj) return -EINVAL; diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 3490ddbe..c37f23d6 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -1672,7 +1672,7 @@ int radeon_gem_indirect_ioctl(struct drm_device *dev, void *data, int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); struct drm_gem_object *radeon_gem_object_alloc(struct drm_device *dev, int size, int alignment, - int initial_domain); + int initial_domain, bool discardable); int radeon_modeset_init(struct drm_device *dev); void radeon_modeset_cleanup(struct drm_device *dev); extern u32 radeon_read_mc_reg(drm_radeon_private_t *dev_priv, int addr); |