[PATCH 05/25] vmwgfx: Make sure the reserved area is at the start of vram

Thomas Hellstrom thellstrom at vmware.com
Wed Sep 28 07:10:01 PDT 2011


From: Jakob Bornecrantz <jakob at vmware.com>

Signed-off-by: Jakob Bornecrantz <jakob at vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom at vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index c14eb76..8ac6cee 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -716,7 +716,10 @@ static int vmw_surface_dmabuf_pin(struct vmw_framebuffer *vfb)
 	struct vmw_framebuffer_surface *vfbs =
 		vmw_framebuffer_to_vfbs(&vfb->base);
 	unsigned long size = vfbs->base.base.pitch * vfbs->base.base.height;
-	int ret;
+	struct ttm_placement ne_placement = vmw_vram_ne_placement;
+	int ret = 0;
+
+	ne_placement.lpfn = (size + (PAGE_SIZE - 1)) / PAGE_SIZE;
 
 	vfbs->buffer = kzalloc(sizeof(*vfbs->buffer), GFP_KERNEL);
 	if (unlikely(vfbs->buffer == NULL))
-- 
1.7.4.4



More information about the dri-devel mailing list