aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-04-09 15:05:06 -0400
committerDave Airlie <airlied@redhat.com>2010-04-19 23:22:26 -0400
commitac52bc56de25535a907ef07f8755f1387b89b0f5 (patch)
tree7415fc01a7b420899bfd09b4836d454e8c14dfc6 /drivers
parentfd632aa34c8592fb1d37fc83cbffa827bc7dd42c (diff)
drm/i915: introduce i915_gem_alloc_object
Just preparation, no functional change. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c12
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c2
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c2
5 files changed, 14 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 1258b1119d93..6b931b8750aa 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -908,6 +908,8 @@ int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
908 struct drm_file *file_priv); 908 struct drm_file *file_priv);
909void i915_gem_load(struct drm_device *dev); 909void i915_gem_load(struct drm_device *dev);
910int i915_gem_init_object(struct drm_gem_object *obj); 910int i915_gem_init_object(struct drm_gem_object *obj);
911struct drm_gem_object * i915_gem_alloc_object(struct drm_device *dev,
912 size_t size);
911void i915_gem_free_object(struct drm_gem_object *obj); 913void i915_gem_free_object(struct drm_gem_object *obj);
912int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment); 914int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment);
913void i915_gem_object_unpin(struct drm_gem_object *obj); 915void i915_gem_object_unpin(struct drm_gem_object *obj);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d4ea90999f67..92dd52216825 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -124,7 +124,7 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
124 args->size = roundup(args->size, PAGE_SIZE); 124 args->size = roundup(args->size, PAGE_SIZE);
125 125
126 /* Allocate the new object */ 126 /* Allocate the new object */
127 obj = drm_gem_object_alloc(dev, args->size); 127 obj = i915_gem_alloc_object(dev, args->size);
128 if (obj == NULL) 128 if (obj == NULL)
129 return -ENOMEM; 129 return -ENOMEM;
130 130
@@ -4421,6 +4421,12 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
4421 return 0; 4421 return 0;
4422} 4422}
4423 4423
4424struct drm_gem_object * i915_gem_alloc_object(struct drm_device *dev,
4425 size_t size)
4426{
4427 return drm_gem_object_alloc(dev, size);
4428}
4429
4424int i915_gem_init_object(struct drm_gem_object *obj) 4430int i915_gem_init_object(struct drm_gem_object *obj)
4425{ 4431{
4426 struct drm_i915_gem_object *obj_priv; 4432 struct drm_i915_gem_object *obj_priv;
@@ -4563,7 +4569,7 @@ i915_gem_init_hws(struct drm_device *dev)
4563 if (!I915_NEED_GFX_HWS(dev)) 4569 if (!I915_NEED_GFX_HWS(dev))
4564 return 0; 4570 return 0;
4565 4571
4566 obj = drm_gem_object_alloc(dev, 4096); 4572 obj = i915_gem_alloc_object(dev, 4096);
4567 if (obj == NULL) { 4573 if (obj == NULL) {
4568 DRM_ERROR("Failed to allocate status page\n"); 4574 DRM_ERROR("Failed to allocate status page\n");
4569 return -ENOMEM; 4575 return -ENOMEM;
@@ -4640,7 +4646,7 @@ i915_gem_init_ringbuffer(struct drm_device *dev)
4640 if (ret != 0) 4646 if (ret != 0)
4641 return ret; 4647 return ret;
4642 4648
4643 obj = drm_gem_object_alloc(dev, 128 * 1024); 4649 obj = i915_gem_alloc_object(dev, 128 * 1024);
4644 if (obj == NULL) { 4650 if (obj == NULL) {
4645 DRM_ERROR("Failed to allocate ringbuffer\n"); 4651 DRM_ERROR("Failed to allocate ringbuffer\n");
4646 i915_gem_cleanup_hws(dev); 4652 i915_gem_cleanup_hws(dev);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2f5f74160cbf..3836f56e842c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4967,7 +4967,7 @@ intel_alloc_power_context(struct drm_device *dev)
4967 struct drm_gem_object *pwrctx; 4967 struct drm_gem_object *pwrctx;
4968 int ret; 4968 int ret;
4969 4969
4970 pwrctx = drm_gem_object_alloc(dev, 4096); 4970 pwrctx = i915_gem_alloc_object(dev, 4096);
4971 if (!pwrctx) { 4971 if (!pwrctx) {
4972 DRM_DEBUG("failed to alloc power context, RC6 disabled\n"); 4972 DRM_DEBUG("failed to alloc power context, RC6 disabled\n");
4973 return NULL; 4973 return NULL;
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 34ad0333eaef..b04e0a86bf9a 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -88,7 +88,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
88 88
89 size = mode_cmd.pitch * mode_cmd.height; 89 size = mode_cmd.pitch * mode_cmd.height;
90 size = ALIGN(size, PAGE_SIZE); 90 size = ALIGN(size, PAGE_SIZE);
91 fbo = drm_gem_object_alloc(dev, size); 91 fbo = i915_gem_alloc_object(dev, size);
92 if (!fbo) { 92 if (!fbo) {
93 DRM_ERROR("failed to allocate framebuffer\n"); 93 DRM_ERROR("failed to allocate framebuffer\n");
94 ret = -ENOMEM; 94 ret = -ENOMEM;
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 6d524a1fc271..bc3721af855c 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1341,7 +1341,7 @@ void intel_setup_overlay(struct drm_device *dev)
1341 return; 1341 return;
1342 overlay->dev = dev; 1342 overlay->dev = dev;
1343 1343
1344 reg_bo = drm_gem_object_alloc(dev, PAGE_SIZE); 1344 reg_bo = i915_gem_alloc_object(dev, PAGE_SIZE);
1345 if (!reg_bo) 1345 if (!reg_bo)
1346 goto out_free; 1346 goto out_free;
1347 overlay->reg_bo = to_intel_bo(reg_bo); 1347 overlay->reg_bo = to_intel_bo(reg_bo);