diff mbox

[16/18] drm/i915: Allocate overlay registers from stolen memory

Message ID 1350666204-8101-16-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Accepted
Delegated to: Ben Widawsky
Headers show

Commit Message

Chris Wilson Oct. 19, 2012, 5:03 p.m. UTC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_overlay.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Ben Widawsky Nov. 5, 2012, 5:39 p.m. UTC | #1
On Fri, 19 Oct 2012 18:03:22 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

14-16 are:
Acked-by: Ben Widawsky <ben@bwidawsk.net>

I think it's a nice way to prove the existing code works, but am a
little scared of putting something like the ringbuffer in stolen memory.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index afd0f30..2fa20a4 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1368,8 +1368,10 @@  void intel_setup_overlay(struct drm_device *dev)
 
 	overlay->dev = dev;
 
-	reg_bo = i915_gem_alloc_object(dev, PAGE_SIZE);
-	if (!reg_bo)
+	reg_bo = i915_gem_object_create_stolen(dev, PAGE_SIZE);
+	if (reg_bo == NULL)
+		reg_bo = i915_gem_alloc_object(dev, PAGE_SIZE);
+	if (reg_bo == NULL)
 		goto out_free;
 	overlay->reg_bo = reg_bo;