[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dri-patches
Subject:    drm: Branch 'master' - 2 commits
From:       thomash () kemper ! freedesktop ! org (Thomas Hellstrom)
Date:       2006-10-21 12:20:39
Message-ID: 20061021122039.DA78710078 () kemper ! freedesktop ! org
[Download RAW message or body]

 linux-core/drm_agpsupport.c |    2 +-
 linux-core/drm_ttm.c        |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
diff-tree 7ea059ae076c50f2012dee2ccbb8d41745705383 (from parents)
Merge: 9ed4656799043f24f4d64615ebb8128bedc99799 a8909a0ebcc21ad6b92b93ffe87878ece4b56506
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date:   Sat Oct 21 14:20:28 2006 +0200

    Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm

diff-tree 9ed4656799043f24f4d64615ebb8128bedc99799 (from 9321592149c031694c459bb05e7a31d1197fe5cb)
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date:   Sat Oct 21 14:17:51 2006 +0200

    The CPU cache must be flushed _before_ we start modifying the kernel map ptes,
    otherwise data will be missing, which becomes apparent when the kernel evicts
    batch buffers which are likely to be written into in the evicted state,
    and then rebound to the AGP aperture.
    This means we cannot rely on the AGP module to flush the
    cache for us.

diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index 13a3ced..a5f1f9e 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -610,7 +610,7 @@ static int drm_agp_bind_ttm(drm_ttm_back
 	DRM_DEBUG("drm_agp_bind_ttm\n");
 	DRM_MASK_VAL(backend->flags, DRM_BE_FLAG_BOUND_CACHED,
 		     (cached) ? DRM_BE_FLAG_BOUND_CACHED : 0);
-	mem->is_flushed = FALSE;
+	mem->is_flushed = TRUE;
 	mem->type = (cached) ? agp_priv->cached_type : agp_priv->uncached_type;
 	ret = drm_agp_bind_memory(mem, offset);
 	if (ret) {
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 599589f..7344acc 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -28,6 +28,18 @@
 
 #include "drmP.h"
 
+static void drm_ttm_ipi_handler(void *null)
+{
+	wbinvd();
+}
+
+static void drm_ttm_cache_flush(void) 
+{
+	if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1, 1) != 0)
+		DRM_ERROR("Timed out waiting for drm cache flush.\n");
+}
+
+
 /*
  * Use kmalloc if possible. Otherwise fall back to vmalloc.
  */
@@ -99,6 +111,9 @@ static int drm_set_caching(drm_ttm_t * t
 	if ((ttm->page_flags & DRM_TTM_PAGE_UNCACHED) == noncached)
 		return 0;
 
+	if (noncached) 
+		drm_ttm_cache_flush();
+
 	for (i = 0; i < ttm->num_pages; ++i) {
 		cur_page = ttm->pages + i;
 		if (*cur_page) {

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
--
_______________________________________________
Dri-patches mailing list
Dri-patches@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic