[Intel-gfx] [PATCH 3/6] i830_bind_memory: Use dri_bo_pin under GEM. Pin when ACCEL_NONE.

Keith Packard keithp at keithp.com
Wed Jul 8 22:28:20 CEST 2009


When running GEM, any buffer objects can only be pinned using dri_bo_pin,
they shouldn't be pinned through the GART directly.

Also, when running with KMS but without UXA, make sure frame buffers get
pinned when allocated so that the screen pixmap can be set at that time.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 src/i830_memory.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/i830_memory.c b/src/i830_memory.c
index 7326744..2393689 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -202,7 +202,10 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
     if (mem == NULL || mem->bound)
 	return TRUE;
 
-    if (mem->bo != NULL && !pI830->use_drm_mode) {
+    if (pI830->have_gem && mem->bo != NULL) {
+	if (pI830->use_drm_mode && pI830->accel != ACCEL_NONE)
+	    return TRUE;
+
 	if (dri_bo_pin(mem->bo, mem->alignment) != 0) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "Failed to pin %s: %s\n",
@@ -1114,7 +1117,7 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn)
 	return NULL;
     }
 
-    if (!pI830->use_drm_mode && pI830->FbBase && front_buffer->bound)
+    if (pI830->FbBase && front_buffer->bound)
 	memset (pI830->FbBase + front_buffer->offset, 0, size);
 
     i830_set_max_gtt_map_size(pScrn);
-- 
1.6.3.3




More information about the Intel-gfx mailing list