diff mbox

[21/24] drm/i915: Allocate ringbuffers from stolen memory

Message ID 1346788996-19080-22-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Deferred
Headers show

Commit Message

Chris Wilson Sept. 4, 2012, 8:03 p.m. UTC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jesse Barnes Oct. 11, 2012, 6:54 p.m. UTC | #1
On Tue,  4 Sep 2012 21:03:13 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 984a0c5..577a96a 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -1096,7 +1096,11 @@ static int intel_init_ring_buffer(struct drm_device *dev,
>  			return ret;
>  	}
>  
> -	obj = i915_gem_alloc_object(dev, ring->size);
> +	obj = NULL;
> +	if (!HAS_LLC(dev))
> +		obj = i915_gem_object_create_stolen(dev, ring->size);
> +	if (obj == NULL)
> +		obj = i915_gem_alloc_object(dev, ring->size);
>  	if (obj == NULL) {
>  		DRM_ERROR("Failed to allocate ringbuffer\n");
>  		ret = -ENOMEM;

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 984a0c5..577a96a 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1096,7 +1096,11 @@  static int intel_init_ring_buffer(struct drm_device *dev,
 			return ret;
 	}
 
-	obj = i915_gem_alloc_object(dev, ring->size);
+	obj = NULL;
+	if (!HAS_LLC(dev))
+		obj = i915_gem_object_create_stolen(dev, ring->size);
+	if (obj == NULL)
+		obj = i915_gem_alloc_object(dev, ring->size);
 	if (obj == NULL) {
 		DRM_ERROR("Failed to allocate ringbuffer\n");
 		ret = -ENOMEM;