All of lore.kernel.org
 help / color / mirror / Atom feed
* A few patches for ng
@ 2008-12-23 20:25 Maarten Maathuis
  0 siblings, 0 replies; only message in thread
From: Maarten Maathuis @ 2008-12-23 20:25 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

The first patch (for drm) fixes a very annoying bug for nv50 gart. The
2nd is just a few cleanups in libnouveau_drm.

I also pushed a few changes to the ng ddx, and I'm at the moment
thinking on how to deal with the issue of nv50.

We are no longer garuanteed that pixmaps are really migrated upon
mapping, so that is the first thing to do. Probably a good idea to
begin with making the bo copy stuff in kernel functional with tiled
memory. Then the simple start would be to copy the bo upon map and and
copy back upon unmap, the downside of this is a syncing requirement
(the tiled copy musn't be accessed at the same time). Another attempt
would to be finally try that wfb stuff in xorg and get that going. And
i have some more ideas floating around. Anyway, i'll have some more
stuff ready once you (darktama) are done moving.

Maarten.

[-- Attachment #2: 0001-nv50-properly-handle-gart.patch --]
[-- Type: application/octet-stream, Size: 1392 bytes --]

From 8caaf0c4a3dc4579e09963173438d876d335fbb5 Mon Sep 17 00:00:00 2001
From: Maarten Maathuis <madman2003@gmail.com>
Date: Tue, 23 Dec 2008 21:12:14 +0100
Subject: [PATCH] nv50: properly handle gart.

---
 shared-core/nouveau_object.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c
index 4c8d364..f7d93a8 100644
--- a/shared-core/nouveau_object.c
+++ b/shared-core/nouveau_object.c
@@ -961,6 +961,8 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan,
 
 	/* VRAM ctxdma */
 	if (dev_priv->card_type >= NV_50) {
+		/* VRAM is mapped into 512-1024 MB in the page directory. */
+		/* The reason available size is used, is to avoid dma'ing into RAMIN. */
 		ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
 					     (512*1024*1024),
 					     dev_priv->fb_available_size,
@@ -986,7 +988,12 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan,
 
 	/* TT memory ctxdma */
 	if (dev_priv->card_type >= NV_50) {
-		tt = vram;
+		/* GART is mapped into 0-512MB of the page directory. */
+		ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
+					     0,
+					     512*1024*1024,
+					     NV_DMA_ACCESS_RW,
+					     NV_DMA_TARGET_AGP, &tt);
 	} else
 	if (dev_priv->gart_info.type != NOUVEAU_GART_NONE) {
 		ret = nouveau_gpuobj_gart_dma_new(chan, 0,
-- 
1.6.0.4


[-- Attachment #3: 0001-A-few-minor-fixes.patch --]
[-- Type: application/octet-stream, Size: 1891 bytes --]

From abed0dd3583ac173e19570a4a0010eb56b45bc0b Mon Sep 17 00:00:00 2001
From: Maarten Maathuis <madman2003@gmail.com>
Date: Tue, 23 Dec 2008 21:16:10 +0100
Subject: [PATCH] A few minor fixes.

---
 src/nouveau_bo.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/nouveau_bo.c b/src/nouveau_bo.c
index 851eaf9..de6f167 100644
--- a/src/nouveau_bo.c
+++ b/src/nouveau_bo.c
@@ -328,7 +328,9 @@ nouveau_bo_wait(struct nouveau_bo *bo, int cpu_write)
 		nouveau_pushbuf_flush(nvbo->pending_channel, 0);
 	}
 
-	nouveau_bo_kmap(nvbo);
+	ret = nouveau_bo_kmap(nvbo);
+	if (ret)
+		return ret;
 
 	req.handle = nvbo->handle;
 	ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GEM_CPU_PREP,
@@ -350,8 +352,11 @@ nouveau_bo_map(struct nouveau_bo *bo, uint32_t flags)
 		return -EINVAL;
 
 	if (!nouveau_bo_allocated(nvbo)) {
-		if (nvbo->flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART))
-			nouveau_bo_kalloc(nvbo, NULL);
+		if (nvbo->flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) {
+			ret = nouveau_bo_kalloc(nvbo, NULL);
+			if (ret)
+				return ret;
+		}
 
 		if (!nouveau_bo_allocated(nvbo)) {
 			ret = nouveau_bo_ualloc(nvbo);
@@ -468,7 +473,9 @@ nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo)
 		return nvbo->pending;
 
 	if (!nvbo->handle) {
-		nouveau_bo_kalloc(nvbo, chan);
+		ret = nouveau_bo_kalloc(nvbo, chan);
+		if (ret)
+			return NULL;
 		if (nvbo->sysmem) {
 			void *sysmem_tmp = nvbo->sysmem;
 
@@ -494,7 +501,7 @@ nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo)
 	pbbo->user_priv = (uint64_t)(unsigned long)ref;
 	pbbo->handle = nvbo->handle;
 	pbbo->valid_domains = NOUVEAU_GEM_DOMAIN_VRAM | NOUVEAU_GEM_DOMAIN_GART;
-	pbbo->read_domains =
+	pbbo->read_domains = 0;
 	pbbo->write_domains = 0;
 	pbbo->presumed_domain = nvbo->domain;
 	pbbo->presumed_offset = nvbo->offset;
-- 
1.6.0.4


[-- Attachment #4: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-23 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23 20:25 A few patches for ng Maarten Maathuis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.