From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [drm:r100_ring_test] *ERROR* radeon: ring test failed Date: Tue, 20 Oct 2009 12:58:05 -0400 Message-ID: <20091020165805.GA12035@phenom.dumpdata.com> References: <4AB431AD.1030205@goop.org> <20091011153900.GW1434@reaktio.net> <20091012200248.GA16486@phenom.dumpdata.com> <20091014211415.GQ1434@reaktio.net> <20091015200409.GD11348@phenom.dumpdata.com> <20091016090159.GI1434@reaktio.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Return-path: Content-Disposition: inline In-Reply-To: <20091016090159.GI1434@reaktio.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Cc: Jeremy Fitzhardinge , Xen-devel List-Id: xen-devel@lists.xenproject.org --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > > 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 */ - +#include #include #include #include @@ -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; } --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ttm.patch" 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 */ - +#include #include #include #include @@ -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; } diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index a68829d..e57e442 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -524,7 +524,7 @@ extern void ttm_tt_destroy(struct ttm_tt *ttm); extern void ttm_tt_unbind(struct ttm_tt *ttm); /** - * ttm_ttm_destroy: + * ttm_tt_get_page: * * @ttm: The struct ttm_tt. * @index: Index of the desired page. --/04w6evG8XlLl3ft Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --/04w6evG8XlLl3ft--