WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [drm:r100_ring_test] *ERROR* radeon: ring test failed

To: Pasi Kärkkäinen <pasik@xxxxxx>
Subject: [Xen-devel] [drm:r100_ring_test] *ERROR* radeon: ring test failed
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Tue, 20 Oct 2009 12:58:05 -0400
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 20 Oct 2009 10:09:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20091016090159.GI1434@xxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4AB431AD.1030205@xxxxxxxx> <20091011153900.GW1434@xxxxxxxxxxx> <20091012200248.GA16486@xxxxxxxxxxxxxxxxxxx> <20091014211415.GQ1434@xxxxxxxxxxx> <20091015200409.GD11348@xxxxxxxxxxxxxxxxxxx> <20091016090159.GI1434@xxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.19 (2009-01-05)
> > > http://pasik.reaktio.net/xen/pv_ops-dom0-debug/radeondebug/dmesg-2.6.31.3-1.2.71.xendom0.fc12.x86_64-2009-10-14.txt
> > 
> > Nah. Still has the same problem:
> > 
> > [drm:r100_ring_test] *ERROR* radeon: ring test failed 
> > (sracth(0x15E4)=0xCAFEDEAD)
> > [drm:r100_cp_init] *ERROR* radeon: cp isn't working (-

I looked a bit at the code and tried to reproduce this, but found out that the 
hardware I've is
a bit too modern for mode-setting to work (no support yet for RS780).

I looked at the code yesterday and I think I've found the
the failure. But I don't have yet a test bed for this, so if you
are willing to be guinea pig, please test this patch (also attached):


diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index b8b6c4a..4445364 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -27,7 +27,7 @@
 /*
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
-
+#include <linux/dma-mapping.h>
 #include <linux/vmalloc.h>
 #include <linux/sched.h>
 #include <linux/highmem.h>
@@ -138,6 +138,9 @@ static void ttm_tt_free_page_directory(struct ttm_tt *ttm)
 static struct page *ttm_tt_alloc_page(unsigned page_flags)
 {
        gfp_t gfp_flags = GFP_USER;
+       void *addr;
+       dma_addr_t phys;
+       struct page *page;
 
        if (page_flags & TTM_PAGE_FLAG_ZERO_ALLOC)
                gfp_flags |= __GFP_ZERO;
@@ -147,7 +150,24 @@ static struct page *ttm_tt_alloc_page(unsigned page_flags)
        else
                gfp_flags |= __GFP_HIGHMEM;
 
-       return alloc_page(gfp_flags);
+       addr = dma_alloc_coherent(NULL, PAGE_SIZE, &phys, gfp_flags);
+       BUG_ON(!addr);
+       page = virt_to_page(addr);
+       get_page(page);
+       return page;
+}
+
+static void ttm_tt_free_page(struct page *page)
+{
+       void *addr;
+
+       if (page == NULL)
+               return;
+
+       put_page(page);
+       addr = page_address(page);
+
+       dma_free_coherent(NULL, PAGE_SIZE, addr, virt_to_bus(addr));
 }
 
 static void ttm_tt_free_user_pages(struct ttm_tt *ttm)
@@ -180,7 +200,7 @@ static void ttm_tt_free_user_pages(struct ttm_tt *ttm)
 
                ttm->pages[i] = NULL;
                ttm_mem_global_free(ttm->bdev->mem_glob, PAGE_SIZE, false);
-               put_page(page);
+               ttm_tt_free_page(page);
        }
        ttm->state = tt_unpopulated;
        ttm->first_himem_page = ttm->num_pages;
@@ -218,7 +238,7 @@ static struct page *__ttm_tt_get_page(struct ttm_tt *ttm, 
int index)
        }
        return p;
 out_err:
-       put_page(p);
+       ttm_tt_free_page(p);
        return NULL;
 }
 

Attachment: ttm.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>