rpms/kernel/devel drm-nouveau-updates.patch, 1.1, 1.2 kernel.spec, 1.2072, 1.2073

Ben Skeggs bskeggs at fedoraproject.org
Tue Jul 13 05:17:44 UTC 2010


Author: bskeggs

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv23206

Modified Files:
	drm-nouveau-updates.patch kernel.spec 
Log Message:
* Tue Jul 13 2010 Ben Skeggs <bskeggs at redhat.com>
- nouveau: miscellanous fixes



drm-nouveau-updates.patch:
 b/drivers/gpu/drm/drm_crtc_helper.c           |   22 -
 b/drivers/gpu/drm/i2c/ch7006_drv.c            |   18 +
 b/drivers/gpu/drm/nouveau/Makefile            |    2 
 b/drivers/gpu/drm/nouveau/nouveau_acpi.c      |    2 
 b/drivers/gpu/drm/nouveau/nouveau_bios.c      |  194 ++++++++-----
 b/drivers/gpu/drm/nouveau/nouveau_bios.h      |    1 
 b/drivers/gpu/drm/nouveau/nouveau_bo.c        |    9 
 b/drivers/gpu/drm/nouveau/nouveau_channel.c   |    5 
 b/drivers/gpu/drm/nouveau/nouveau_connector.c |  316 ++++++++++-----------
 b/drivers/gpu/drm/nouveau/nouveau_connector.h |    7 
 b/drivers/gpu/drm/nouveau/nouveau_dma.c       |    8 
 b/drivers/gpu/drm/nouveau/nouveau_dp.c        |   24 +
 b/drivers/gpu/drm/nouveau/nouveau_drv.c       |   26 -
 b/drivers/gpu/drm/nouveau/nouveau_drv.h       |   87 +----
 b/drivers/gpu/drm/nouveau/nouveau_encoder.h   |   10 
 b/drivers/gpu/drm/nouveau/nouveau_fbcon.c     |    5 
 b/drivers/gpu/drm/nouveau/nouveau_fence.c     |   31 --
 b/drivers/gpu/drm/nouveau/nouveau_gem.c       |   11 
 b/drivers/gpu/drm/nouveau/nouveau_mem.c       |  261 +----------------
 b/drivers/gpu/drm/nouveau/nouveau_notifier.c  |   30 --
 b/drivers/gpu/drm/nouveau/nouveau_object.c    |  105 ++-----
 b/drivers/gpu/drm/nouveau/nouveau_reg.h       |    1 
 b/drivers/gpu/drm/nouveau/nouveau_sgdma.c     |   46 ---
 b/drivers/gpu/drm/nouveau/nouveau_state.c     |  169 +++--------
 b/drivers/gpu/drm/nouveau/nv04_crtc.c         |    5 
 b/drivers/gpu/drm/nouveau/nv04_dac.c          |   37 +-
 b/drivers/gpu/drm/nouveau/nv04_dfp.c          |   12 
 b/drivers/gpu/drm/nouveau/nv04_display.c      |   23 +
 b/drivers/gpu/drm/nouveau/nv04_fifo.c         |   20 -
 b/drivers/gpu/drm/nouveau/nv04_graph.c        |    5 
 b/drivers/gpu/drm/nouveau/nv04_instmem.c      |   21 -
 b/drivers/gpu/drm/nouveau/nv04_mc.c           |    4 
 b/drivers/gpu/drm/nouveau/nv04_tv.c           |    8 
 b/drivers/gpu/drm/nouveau/nv10_fifo.c         |   10 
 b/drivers/gpu/drm/nouveau/nv17_tv.c           |   45 ++-
 b/drivers/gpu/drm/nouveau/nv20_graph.c        |   96 +++---
 b/drivers/gpu/drm/nouveau/nv40_fifo.c         |    8 
 b/drivers/gpu/drm/nouveau/nv40_graph.c        |   58 +--
 b/drivers/gpu/drm/nouveau/nv50_crtc.c         |   42 --
 b/drivers/gpu/drm/nouveau/nv50_dac.c          |   43 ++
 b/drivers/gpu/drm/nouveau/nv50_display.c      |  385 +++++++++++++++-----------
 b/drivers/gpu/drm/nouveau/nv50_fifo.c         |  126 +++-----
 b/drivers/gpu/drm/nouveau/nv50_graph.c        |   86 ++---
 b/drivers/gpu/drm/nouveau/nv50_instmem.c      |   60 +---
 b/drivers/gpu/drm/nouveau/nv50_sor.c          |  105 +++----
 drivers/gpu/drm/nouveau/nouveau_grctx.c       |  160 ----------
 46 files changed, 1142 insertions(+), 1607 deletions(-)

View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.1 -r 1.2 drm-nouveau-updates.patchIndex: drm-nouveau-updates.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau-updates.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- drm-nouveau-updates.patch	7 Jul 2010 06:56:32 -0000	1.1
+++ drm-nouveau-updates.patch	13 Jul 2010 05:17:43 -0000	1.2
@@ -1,6 +1,8 @@
  drivers/gpu/drm/drm_crtc_helper.c           |   22 +-
+ drivers/gpu/drm/i2c/ch7006_drv.c            |   18 ++
+ drivers/gpu/drm/nouveau/Makefile            |    2 +-
  drivers/gpu/drm/nouveau/nouveau_acpi.c      |    2 +-
- drivers/gpu/drm/nouveau/nouveau_bios.c      |  161 ++++++++----
+ drivers/gpu/drm/nouveau/nouveau_bios.c      |  194 +++++++++-----
  drivers/gpu/drm/nouveau/nouveau_bios.h      |    1 +
  drivers/gpu/drm/nouveau/nouveau_bo.c        |    9 +-
  drivers/gpu/drm/nouveau/nouveau_channel.c   |    5 -
@@ -8,33 +10,41 @@
  drivers/gpu/drm/nouveau/nouveau_connector.h |    7 +-
  drivers/gpu/drm/nouveau/nouveau_dma.c       |    8 +-
  drivers/gpu/drm/nouveau/nouveau_dp.c        |   24 ++-
- drivers/gpu/drm/nouveau/nouveau_drv.c       |   22 +-
- drivers/gpu/drm/nouveau/nouveau_drv.h       |   54 +---
+ drivers/gpu/drm/nouveau/nouveau_drv.c       |   26 +--
+ drivers/gpu/drm/nouveau/nouveau_drv.h       |   87 ++-----
  drivers/gpu/drm/nouveau/nouveau_encoder.h   |   10 +-
- drivers/gpu/drm/nouveau/nouveau_fbcon.c     |    2 +-
+ drivers/gpu/drm/nouveau/nouveau_fbcon.c     |    5 +-
  drivers/gpu/drm/nouveau/nouveau_fence.c     |   31 +--
  drivers/gpu/drm/nouveau/nouveau_gem.c       |   11 +-
- drivers/gpu/drm/nouveau/nouveau_mem.c       |  189 +-------------
+ drivers/gpu/drm/nouveau/nouveau_grctx.c     |  160 -----------
+ drivers/gpu/drm/nouveau/nouveau_mem.c       |  261 ++-----------------
  drivers/gpu/drm/nouveau/nouveau_notifier.c  |   30 +--
- drivers/gpu/drm/nouveau/nouveau_object.c    |   30 +--
+ drivers/gpu/drm/nouveau/nouveau_object.c    |  105 +++-----
  drivers/gpu/drm/nouveau/nouveau_reg.h       |    1 +
- drivers/gpu/drm/nouveau/nouveau_state.c     |  145 ++++-------
+ drivers/gpu/drm/nouveau/nouveau_sgdma.c     |   46 +---
+ drivers/gpu/drm/nouveau/nouveau_state.c     |  169 ++++--------
  drivers/gpu/drm/nouveau/nv04_crtc.c         |    5 +
  drivers/gpu/drm/nouveau/nv04_dac.c          |   37 ++-
  drivers/gpu/drm/nouveau/nv04_dfp.c          |   12 +-
  drivers/gpu/drm/nouveau/nv04_display.c      |   23 ++-
- drivers/gpu/drm/nouveau/nv04_fifo.c         |   11 +-
+ drivers/gpu/drm/nouveau/nv04_fifo.c         |   20 +-
  drivers/gpu/drm/nouveau/nv04_graph.c        |    5 +-
- drivers/gpu/drm/nouveau/nv04_instmem.c      |   12 +-
+ drivers/gpu/drm/nouveau/nv04_instmem.c      |   21 +-
+ drivers/gpu/drm/nouveau/nv04_mc.c           |    4 +
  drivers/gpu/drm/nouveau/nv04_tv.c           |    8 +-
+ drivers/gpu/drm/nouveau/nv10_fifo.c         |   10 -
  drivers/gpu/drm/nouveau/nv17_tv.c           |   45 +++-
+ drivers/gpu/drm/nouveau/nv20_graph.c        |   96 ++++---
+ drivers/gpu/drm/nouveau/nv40_fifo.c         |    8 -
+ drivers/gpu/drm/nouveau/nv40_graph.c        |   58 ++---
  drivers/gpu/drm/nouveau/nv50_crtc.c         |   42 +---
  drivers/gpu/drm/nouveau/nv50_dac.c          |   43 ++-
- drivers/gpu/drm/nouveau/nv50_display.c      |  382 ++++++++++++++++-----------
- drivers/gpu/drm/nouveau/nv50_graph.c        |   10 +-
- drivers/gpu/drm/nouveau/nv50_instmem.c      |   12 +-
+ drivers/gpu/drm/nouveau/nv50_display.c      |  385 ++++++++++++++++-----------
+ drivers/gpu/drm/nouveau/nv50_fifo.c         |  126 ++++------
+ drivers/gpu/drm/nouveau/nv50_graph.c        |   86 +++----
+ drivers/gpu/drm/nouveau/nv50_instmem.c      |   60 ++---
  drivers/gpu/drm/nouveau/nv50_sor.c          |  105 ++++----
- 36 files changed, 881 insertions(+), 951 deletions(-)
+ 46 files changed, 1142 insertions(+), 1607 deletions(-)
 
 diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
 index 9b2a541..1eaa315 100644
@@ -94,6 +104,55 @@ index 9b2a541..1eaa315 100644
  	}
  }
  
+diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
+index 81681a0..3e2c9da 100644
+--- a/drivers/gpu/drm/i2c/ch7006_drv.c
++++ b/drivers/gpu/drm/i2c/ch7006_drv.c
+@@ -428,6 +428,22 @@ static int ch7006_remove(struct i2c_client *client)
+ 	return 0;
+ }
+ 
++static int ch7006_suspend(struct i2c_client *client, pm_message_t mesg)
++{
++	ch7006_dbg(client, "\n");
++
++	return 0;
++}
++
++static int ch7006_resume(struct i2c_client *client)
++{
++	ch7006_dbg(client, "\n");
++
++	ch7006_write(client, 0x3d, 0x0);
++
++	return 0;
++}
++
+ static int ch7006_encoder_init(struct i2c_client *client,
+ 			       struct drm_device *dev,
+ 			       struct drm_encoder_slave *encoder)
+@@ -487,6 +503,8 @@ static struct drm_i2c_encoder_driver ch7006_driver = {
+ 	.i2c_driver = {
+ 		.probe = ch7006_probe,
+ 		.remove = ch7006_remove,
++		.suspend = ch7006_suspend,
++		.resume = ch7006_resume,
+ 
+ 		.driver = {
+ 			.name = "ch7006",
+diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
+index acd31ed..4a1db73 100644
+--- a/drivers/gpu/drm/nouveau/Makefile
++++ b/drivers/gpu/drm/nouveau/Makefile
+@@ -9,7 +9,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \
+              nouveau_bo.o nouveau_fence.o nouveau_gem.o nouveau_ttm.o \
+              nouveau_hw.o nouveau_calc.o nouveau_bios.o nouveau_i2c.o \
+              nouveau_display.o nouveau_connector.o nouveau_fbcon.o \
+-             nouveau_dp.o nouveau_grctx.o \
++             nouveau_dp.o \
+              nv04_timer.o \
+              nv04_mc.o nv40_mc.o nv50_mc.o \
+              nv04_fb.o nv10_fb.o nv40_fb.o nv50_fb.o \
 diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
 index d4bcca8..381d385 100644
 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -108,10 +167,77 @@ index d4bcca8..381d385 100644
  	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
  	struct acpi_object_list input;
 diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
-index fc924b6..e05f129 100644
+index fc924b6..5437c89 100644
 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c
 +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
-@@ -935,7 +935,7 @@ init_io_restrict_prog(struct nvbios *bios, uint16_t offset,
+@@ -203,36 +203,26 @@ struct methods {
+ 	const bool rw;
+ };
+ 
+-static struct methods nv04_methods[] = {
+-	{ "PROM", load_vbios_prom, false },
+-	{ "PRAMIN", load_vbios_pramin, true },
+-	{ "PCIROM", load_vbios_pci, true },
+-};
+-
+-static struct methods nv50_methods[] = {
+-	{ "ACPI", load_vbios_acpi, true },
++static struct methods shadow_methods[] = {
+ 	{ "PRAMIN", load_vbios_pramin, true },
+ 	{ "PROM", load_vbios_prom, false },
+ 	{ "PCIROM", load_vbios_pci, true },
++	{ "ACPI", load_vbios_acpi, true },
+ };
+ 
+-#define METHODCNT 3
+-
+ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
+ {
+-	struct drm_nouveau_private *dev_priv = dev->dev_private;
+-	struct methods *methods;
+-	int i;
++	const int nr_methods = ARRAY_SIZE(shadow_methods);
++	struct methods *methods = shadow_methods;
+ 	int testscore = 3;
+-	int scores[METHODCNT];
++	int scores[nr_methods], i;
+ 
+ 	if (nouveau_vbios) {
+-		methods = nv04_methods;
+-		for (i = 0; i < METHODCNT; i++)
++		for (i = 0; i < nr_methods; i++)
+ 			if (!strcasecmp(nouveau_vbios, methods[i].desc))
+ 				break;
+ 
+-		if (i < METHODCNT) {
++		if (i < nr_methods) {
+ 			NV_INFO(dev, "Attempting to use BIOS image from %s\n",
+ 				methods[i].desc);
+ 
+@@ -244,12 +234,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
+ 		NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios);
+ 	}
+ 
+-	if (dev_priv->card_type < NV_50)
+-		methods = nv04_methods;
+-	else
+-		methods = nv50_methods;
+-
+-	for (i = 0; i < METHODCNT; i++) {
++	for (i = 0; i < nr_methods; i++) {
+ 		NV_TRACE(dev, "Attempting to load BIOS image from %s\n",
+ 			 methods[i].desc);
+ 		data[0] = data[1] = 0;	/* avoid reuse of previous image */
+@@ -260,7 +245,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
+ 	}
+ 
+ 	while (--testscore > 0) {
+-		for (i = 0; i < METHODCNT; i++) {
[...2882 lines suppressed...]
+ 	nv_wo32(dev, ramin, (hdr + 0x0c)/4, 0);
+ 	nv_wo32(dev, ramin, (hdr + 0x10)/4, 0);
+ 	nv_wo32(dev, ramin, (hdr + 0x14)/4, 0x00010000);
+-	dev_priv->engine.instmem.finish_access(dev);
+-
+-	dev_priv->engine.instmem.prepare_access(dev, true);
+-	if (!pgraph->ctxprog) {
+-		struct nouveau_grctx ctx = {};
+-		ctx.dev = chan->dev;
+-		ctx.mode = NOUVEAU_GRCTX_VALS;
 -		ctx.data = chan->ramin_grctx->gpuobj;
-+		ctx.data = obj;
- 		nv50_grctx_init(&ctx);
- 	} else {
+-		nv50_grctx_init(&ctx);
+-	} else {
 -		nouveau_grctx_vals_load(dev, ctx);
-+		nouveau_grctx_vals_load(dev, obj);
- 	}
+-	}
 -	nv_wo32(dev, ctx, 0x00000/4, chan->ramin->instance >> 12);
-+	nv_wo32(dev, obj, 0x00000/4, chan->ramin->instance >> 12);
- 	dev_priv->engine.instmem.finish_access(dev);
+-	dev_priv->engine.instmem.finish_access(dev);
  
++	ctx.dev = chan->dev;
++	ctx.mode = NOUVEAU_GRCTX_VALS;
++	ctx.data = obj;
++	nv50_grctx_init(&ctx);
++
++	nv_wo32(dev, obj, 0x00000/4, chan->ramin->instance >> 12);
++
++	dev_priv->engine.instmem.flush(dev);
  	return 0;
+ }
+ 
+@@ -257,17 +244,16 @@ nv50_graph_destroy_context(struct nouveau_channel *chan)
+ {
+ 	struct drm_device *dev = chan->dev;
+ 	struct drm_nouveau_private *dev_priv = dev->dev_private;
+-	int i, hdr = IS_G80 ? 0x200 : 0x20;
++	int i, hdr = (dev_priv->chipset == 0x50) ? 0x200 : 0x20;
+ 
+ 	NV_DEBUG(dev, "ch%d\n", chan->id);
+ 
+ 	if (!chan->ramin || !chan->ramin->gpuobj)
+ 		return;
+ 
+-	dev_priv->engine.instmem.prepare_access(dev, true);
+ 	for (i = hdr; i < hdr + 24; i += 4)
+ 		nv_wo32(dev, chan->ramin->gpuobj, i/4, 0);
+-	dev_priv->engine.instmem.finish_access(dev);
++	dev_priv->engine.instmem.flush(dev);
+ 
+ 	nouveau_gpuobj_ref_del(dev, &chan->ramin_grctx);
+ }
 diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c
-index 5f21df3..8238065 100644
+index 5f21df3..2080632 100644
 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c
 +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c
-@@ -147,7 +147,7 @@ nv50_instmem_init(struct drm_device *dev)
+@@ -35,8 +35,6 @@ struct nv50_instmem_priv {
+ 	struct nouveau_gpuobj_ref *pramin_pt;
+ 	struct nouveau_gpuobj_ref *pramin_bar;
+ 	struct nouveau_gpuobj_ref *fb_bar;
+-
+-	bool last_access_wr;
+ };
+ 
+ #define NV50_INSTMEM_PAGE_SHIFT 12
+@@ -147,7 +145,7 @@ nv50_instmem_init(struct drm_device *dev)
  	if (ret)
  		return ret;
  
@@ -3394,7 +5297,21 @@ index 5f21df3..8238065 100644
  		return -ENOMEM;
  
  	/* RAMFC + zero channel's PRAMIN up to start of VM pagedir */
-@@ -276,9 +276,7 @@ nv50_instmem_init(struct drm_device *dev)
+@@ -262,23 +260,18 @@ nv50_instmem_init(struct drm_device *dev)
+ 
+ 	/* Assume that praying isn't enough, check that we can re-read the
+ 	 * entire fake channel back from the PRAMIN BAR */
+-	dev_priv->engine.instmem.prepare_access(dev, false);
+ 	for (i = 0; i < c_size; i += 4) {
+ 		if (nv_rd32(dev, NV_RAMIN + i) != nv_ri32(dev, i)) {
+ 			NV_ERROR(dev, "Error reading back PRAMIN at 0x%08x\n",
+ 									i);
+-			dev_priv->engine.instmem.finish_access(dev);
+ 			return -EINVAL;
+ 		}
+ 	}
+-	dev_priv->engine.instmem.finish_access(dev);
+ 
  	nv_wr32(dev, NV50_PUNK_BAR0_PRAMIN, save_nv001700);
  
  	/* Global PRAMIN heap */
@@ -3405,7 +5322,7 @@ index 5f21df3..8238065 100644
  		NV_ERROR(dev, "Failed to init RAMIN heap\n");
  	}
  
-@@ -321,7 +319,7 @@ nv50_instmem_takedown(struct drm_device *dev)
+@@ -321,7 +314,7 @@ nv50_instmem_takedown(struct drm_device *dev)
  		nouveau_gpuobj_del(dev, &chan->vm_pd);
  		nouveau_gpuobj_ref_del(dev, &chan->ramfc);
  		nouveau_gpuobj_ref_del(dev, &chan->ramin);
@@ -3414,7 +5331,7 @@ index 5f21df3..8238065 100644
  
  		dev_priv->fifos[0] = dev_priv->fifos[127] = NULL;
  		kfree(chan);
-@@ -436,14 +434,14 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
+@@ -436,14 +429,14 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
  	if (!gpuobj->im_backing || !gpuobj->im_pramin || gpuobj->im_bound)
  		return -EINVAL;
  
@@ -3431,6 +5348,83 @@ index 5f21df3..8238065 100644
  		 gpuobj->im_pramin->start, pte, pte_end);
  	NV_DEBUG(dev, "first vram page: 0x%08x\n", gpuobj->im_backing_start);
  
+@@ -453,27 +446,15 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
+ 		vram |= 0x30;
+ 	}
+ 
+-	dev_priv->engine.instmem.prepare_access(dev, true);
+ 	while (pte < pte_end) {
+ 		nv_wo32(dev, pramin_pt, pte++, lower_32_bits(vram));
+ 		nv_wo32(dev, pramin_pt, pte++, upper_32_bits(vram));
+ 		vram += NV50_INSTMEM_PAGE_SIZE;
+ 	}
+-	dev_priv->engine.instmem.finish_access(dev);
+-
+-	nv_wr32(dev, 0x100c80, 0x00040001);
+-	if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) {
+-		NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (1)\n");
+-		NV_ERROR(dev, "0x100c80 = 0x%08x\n", nv_rd32(dev, 0x100c80));
+-		return -EBUSY;
+-	}
++	dev_priv->engine.instmem.flush(dev);
+ 
+-	nv_wr32(dev, 0x100c80, 0x00060001);
+-	if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) {
+-		NV_ERROR(dev, "timeout: (0x100c80 & 1) == 0 (2)\n");
+-		NV_ERROR(dev, "0x100c80 = 0x%08x\n", nv_rd32(dev, 0x100c80));
+-		return -EBUSY;
+-	}
++	nv50_vm_flush(dev, 4);
++	nv50_vm_flush(dev, 6);
+ 
+ 	gpuobj->im_bound = 1;
+ 	return 0;
+@@ -492,36 +473,29 @@ nv50_instmem_unbind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
+ 	pte     = (gpuobj->im_pramin->start >> 12) << 1;
+ 	pte_end = ((gpuobj->im_pramin->size >> 12) << 1) + pte;
+ 
+-	dev_priv->engine.instmem.prepare_access(dev, true);
+ 	while (pte < pte_end) {
+ 		nv_wo32(dev, priv->pramin_pt->gpuobj, pte++, 0x00000000);
+ 		nv_wo32(dev, priv->pramin_pt->gpuobj, pte++, 0x00000000);
+ 	}
+-	dev_priv->engine.instmem.finish_access(dev);
++	dev_priv->engine.instmem.flush(dev);
+ 
+ 	gpuobj->im_bound = 0;
+ 	return 0;
+ }
+ 
+ void
+-nv50_instmem_prepare_access(struct drm_device *dev, bool write)
++nv50_instmem_flush(struct drm_device *dev)
+ {
+-	struct drm_nouveau_private *dev_priv = dev->dev_private;
+-	struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv;
+-
+-	priv->last_access_wr = write;
++	nv_wr32(dev, 0x070000, 0x00000001);
++	if (!nv_wait(0x070000, 0x00000001, 0x00000000))
++		NV_ERROR(dev, "PRAMIN flush timeout\n");
+ }
+ 
+ void
+-nv50_instmem_finish_access(struct drm_device *dev)
++nv50_vm_flush(struct drm_device *dev, int engine)
+ {
+-	struct drm_nouveau_private *dev_priv = dev->dev_private;
+-	struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv;
+-
+-	if (priv->last_access_wr) {
+-		nv_wr32(dev, 0x070000, 0x00000001);
+-		if (!nv_wait(0x070000, 0x00000001, 0x00000000))
+-			NV_ERROR(dev, "PRAMIN flush timeout\n");
+-	}
++	nv_wr32(dev, 0x100c80, (engine << 16) | 1);
++	if (!nv_wait(0x100c80, 0x00000001, 0x00000000))
++		NV_ERROR(dev, "vm flush timeout: engine %d\n", engine);
+ }
+ 
 diff --git a/drivers/gpu/drm/nouveau/nv50_sor.c b/drivers/gpu/drm/nouveau/nv50_sor.c
 index 812778d..bcd4cf8 100644
 --- a/drivers/gpu/drm/nouveau/nv50_sor.c


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.2072
retrieving revision 1.2073
diff -u -p -r1.2072 -r1.2073
--- kernel.spec	13 Jul 2010 03:37:42 -0000	1.2072
+++ kernel.spec	13 Jul 2010 05:17:43 -0000	1.2073
@@ -1856,6 +1856,9 @@ fi
 #                 ||     ||
 
 %changelog
+* Tue Jul 13 2010 Ben Skeggs <bskeggs at redhat.com>
+- nouveau: miscellanous fixes
+
 * Mon Jul 12 2010 Dave Jones <davej at redhat.com>
 - 2.6.35-rc4-git5
 



More information about the scm-commits mailing list