[Intel-gfx] [PATCH 2/2] Fix up some pI830->memory_manager versus use_drm_mode confusion.

Eric Anholt eric at anholt.net
Wed Apr 22 05:27:35 CEST 2009


We'd end up doing direct drm_intel_bo_maps of our tiled buffers for sw
fallbacks, resulting in bad rendering with KMS.  Also cleans up a spurious
error message.x
---
 src/i830_driver.c |    2 +-
 src/i830_exa.c    |    4 ++--
 src/i830_memory.c |    7 ++++---
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3c27745..fb92d86 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2639,7 +2639,7 @@ I830BlockHandler(int i,
 	*/
        intel_batch_flush(pScrn, flushed);
 #ifdef XF86DRI
-       if (pI830->memory_manager)
+       if (pI830->memory_manager || pI830->use_drm_mode)
 	 drmCommandNone(pI830->drmSubFD, DRM_I915_GEM_THROTTLE);
 #endif
 
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 5199cef..7b2c647 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -829,7 +829,7 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 	}
 
 	/* No VT sema or GEM?  No GTT mapping. */
-	if (!scrn->vtSema || !i830->memory_manager) {
+	if (!scrn->vtSema || (!i830->memory_manager && !i830->use_drm_mode)) {
 	    if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0)
 		return FALSE;
 	    pixmap->devPrivate.ptr = bo->virtual;
@@ -867,7 +867,7 @@ i830_uxa_finish_access (PixmapPtr pixmap)
 	if (bo == i830->front_buffer->bo)
 	    i830->need_flush = TRUE;
 
-	if (!scrn->vtSema || !i830->memory_manager) {
+	if (!scrn->vtSema || (!i830->memory_manager && !i830->use_drm_mode)) {
 	    dri_bo_unmap(bo);
 	    pixmap->devPrivate.ptr = NULL;
 	    return;
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 470734e..b56ad3c 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -490,9 +490,10 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
      * 5.4 or newer so we can rely on the lock being held after DRIScreenInit,
      * rather than after DRIFinishScreenInit.
      */
-    if ((pI830->directRenderingType == DRI_XF86DRI && has_gem && has_dri &&
-	(dri_major > 5 || (dri_major == 5 && dri_minor >= 4))) ||
-	(pI830->directRenderingType == DRI_DRI2 && has_gem))
+    if (((pI830->directRenderingType == DRI_XF86DRI && has_gem && has_dri &&
+	  (dri_major > 5 || (dri_major == 5 && dri_minor >= 4))) ||
+	 (pI830->directRenderingType == DRI_DRI2 && has_gem)) &&
+	 !pI830->use_drm_mode)
     {
 	int mmsize;
 
-- 
1.6.2.2




More information about the Intel-gfx mailing list