rpms/kernel/F-12 drm-nouveau.patch, 1.55, 1.56 kernel.spec, 1.1800, 1.1801

Ben Skeggs bskeggs at fedoraproject.org
Tue Sep 15 09:52:52 UTC 2009


Author: bskeggs

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11282

Modified Files:
	drm-nouveau.patch kernel.spec 
Log Message:
* Tue Sep 15 2009 Ben Skeggs <bskeggs at redhat.com>
- nouveau: misc fixes to context-related issues, fixes some severe nv4x bugs


drm-nouveau.patch:
 drivers/gpu/drm/Kconfig                     |   45 
 drivers/gpu/drm/Makefile                    |    2 
 drivers/gpu/drm/drm_bufs.c                  |   28 
 drivers/gpu/drm/i2c/Makefile                |    4 
 drivers/gpu/drm/i2c/ch7006_drv.c            |  532 
 drivers/gpu/drm/i2c/ch7006_mode.c           |  473 
 drivers/gpu/drm/i2c/ch7006_priv.h           |  340 
 drivers/gpu/drm/nouveau/Makefile            |   28 
 drivers/gpu/drm/nouveau/nouveau_acpi.c      |  127 
 drivers/gpu/drm/nouveau/nouveau_backlight.c |  155 
 drivers/gpu/drm/nouveau/nouveau_bios.c      | 5209 ++++++
 drivers/gpu/drm/nouveau/nouveau_bios.h      |  235 
 drivers/gpu/drm/nouveau/nouveau_bo.c        |  622 
 drivers/gpu/drm/nouveau/nouveau_calc.c      |  626 
 drivers/gpu/drm/nouveau/nouveau_channel.c   |  537 
 drivers/gpu/drm/nouveau/nouveau_connector.c |  750 
 drivers/gpu/drm/nouveau/nouveau_connector.h |   55 
 drivers/gpu/drm/nouveau/nouveau_crtc.h      |   95 
 drivers/gpu/drm/nouveau/nouveau_display.c   |  115 
 drivers/gpu/drm/nouveau/nouveau_dma.c       |  206 
 drivers/gpu/drm/nouveau/nouveau_dma.h       |  148 
 drivers/gpu/drm/nouveau/nouveau_drv.c       |  433 
 drivers/gpu/drm/nouveau/nouveau_drv.h       | 1218 +
 drivers/gpu/drm/nouveau/nouveau_encoder.h   |   66 
 drivers/gpu/drm/nouveau/nouveau_fb.h        |   47 
 drivers/gpu/drm/nouveau/nouveau_fbcon.c     |  354 
 drivers/gpu/drm/nouveau/nouveau_fbcon.h     |   48 
 drivers/gpu/drm/nouveau/nouveau_fence.c     |  261 
 drivers/gpu/drm/nouveau/nouveau_gem.c       |  954 +
 drivers/gpu/drm/nouveau/nouveau_hw.c        | 1077 +
 drivers/gpu/drm/nouveau/nouveau_hw.h        |  446 
 drivers/gpu/drm/nouveau/nouveau_i2c.c       |  256 
 drivers/gpu/drm/nouveau/nouveau_i2c.h       |   45 
 drivers/gpu/drm/nouveau/nouveau_ioc32.c     |   72 
 drivers/gpu/drm/nouveau/nouveau_irq.c       |  683 
 drivers/gpu/drm/nouveau/nouveau_mem.c       |  565 
 drivers/gpu/drm/nouveau/nouveau_notifier.c  |  194 
 drivers/gpu/drm/nouveau/nouveau_object.c    | 1279 +
 drivers/gpu/drm/nouveau/nouveau_reg.h       |  833 +
 drivers/gpu/drm/nouveau/nouveau_sgdma.c     |  317 
 drivers/gpu/drm/nouveau/nouveau_state.c     |  834 +
 drivers/gpu/drm/nouveau/nouveau_swmthd.h    |   33 
 drivers/gpu/drm/nouveau/nouveau_ttm.c       |  131 
 drivers/gpu/drm/nouveau/nv04_crtc.c         | 1014 +
 drivers/gpu/drm/nouveau/nv04_cursor.c       |   70 
 drivers/gpu/drm/nouveau/nv04_dac.c          |  525 
 drivers/gpu/drm/nouveau/nv04_dfp.c          |  621 
 drivers/gpu/drm/nouveau/nv04_display.c      |  293 
 drivers/gpu/drm/nouveau/nv04_fb.c           |   21 
 drivers/gpu/drm/nouveau/nv04_fbcon.c        |  295 
 drivers/gpu/drm/nouveau/nv04_fifo.c         |  295 
 drivers/gpu/drm/nouveau/nv04_graph.c        |  583 
 drivers/gpu/drm/nouveau/nv04_instmem.c      |  213 
 drivers/gpu/drm/nouveau/nv04_mc.c           |   20 
 drivers/gpu/drm/nouveau/nv04_timer.c        |   51 
 drivers/gpu/drm/nouveau/nv04_tv.c           |  304 
 drivers/gpu/drm/nouveau/nv10_fb.c           |   24 
 drivers/gpu/drm/nouveau/nv10_fifo.c         |  177 
 drivers/gpu/drm/nouveau/nv10_graph.c        |  945 +
 drivers/gpu/drm/nouveau/nv17_tv.c           |  660 
 drivers/gpu/drm/nouveau/nv17_tv.h           |  156 
 drivers/gpu/drm/nouveau/nv17_tv_modes.c     |  582 
 drivers/gpu/drm/nouveau/nv20_graph.c        |  784 
 drivers/gpu/drm/nouveau/nv40_fb.c           |   62 
 drivers/gpu/drm/nouveau/nv40_fifo.c         |  223 
 drivers/gpu/drm/nouveau/nv40_graph.c        | 2214 ++
 drivers/gpu/drm/nouveau/nv40_mc.c           |   38 
 drivers/gpu/drm/nouveau/nv50_crtc.c         |  799 +
 drivers/gpu/drm/nouveau/nv50_cursor.c       |  151 
 drivers/gpu/drm/nouveau/nv50_dac.c          |  296 
 drivers/gpu/drm/nouveau/nv50_display.c      |  905 +
 drivers/gpu/drm/nouveau/nv50_display.h      |   46 
 drivers/gpu/drm/nouveau/nv50_evo.h          |  113 
 drivers/gpu/drm/nouveau/nv50_fbcon.c        |  256 
 drivers/gpu/drm/nouveau/nv50_fifo.c         |  473 
 drivers/gpu/drm/nouveau/nv50_graph.c        |  443 
 drivers/gpu/drm/nouveau/nv50_grctx.h        |22284 ++++++++++++++++++++++++++++
 drivers/gpu/drm/nouveau/nv50_instmem.c      |  499 
 drivers/gpu/drm/nouveau/nv50_mc.c           |   40 
 drivers/gpu/drm/nouveau/nv50_sor.c          |  250 
 drivers/gpu/drm/nouveau/nvreg.h             |  535 
 drivers/gpu/drm/ttm/ttm_bo.c                |    4 
 include/drm/Kbuild                          |    1 
 include/drm/drmP.h                          |    2 
 include/drm/i2c/ch7006.h                    |   86 
 include/drm/nouveau_drm.h                   |  216 
 86 files changed, 58026 insertions(+), 21 deletions(-)

Index: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/drm-nouveau.patch,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -p -r1.55 -r1.56
--- drm-nouveau.patch	15 Sep 2009 06:44:12 -0000	1.55
+++ drm-nouveau.patch	15 Sep 2009 09:52:49 -0000	1.56
@@ -8538,10 +8538,10 @@ index 0000000..3f80db8
 +}
 diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
 new file mode 100644
-index 0000000..7761425
+index 0000000..65810d4
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
-@@ -0,0 +1,520 @@
+@@ -0,0 +1,537 @@
 +/*
 + * Copyright 2005-2006 Stephane Marchesin
 + * All Rights Reserved.
@@ -8656,6 +8656,7 @@ index 0000000..7761425
 +	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +	struct nouveau_engine *engine = &dev_priv->engine;
 +	struct nouveau_channel *chan;
++	unsigned fbdev_flags = 0;
 +	int channel, user;
 +	int ret;
 +
@@ -8745,6 +8746,11 @@ index 0000000..7761425
 +		return ret;
 +	}
 +
++	if (dev_priv->fbdev_info) {
++		fbdev_flags = dev_priv->fbdev_info->flags;
++		dev_priv->fbdev_info->flags |= FBINFO_HWACCEL_DISABLED;
++	}
++
 +	engine->graph.fifo_access(dev, false);
 +	nouveau_wait_for_idle(dev);
 +
@@ -8773,25 +8779,24 @@ index 0000000..7761425
 +	 * isn't entirely.. well.. correct.. setup PFIFO ourselves.  For any
 +	 * other case, the GPU will handle this when it switches contexts.
 +	 */
-+	if (dev_priv->engine.fifo.init == nv04_fifo_init ||
-+	    dev_priv->engine.fifo.init == nv40_fifo_init) {
++	if ((dev_priv->engine.fifo.init == nv04_fifo_init ||
++	     dev_priv->engine.fifo.init == nv40_fifo_init) &&
++	    dev_priv->fifo_alloc_count == 1) {
 +		/* setup channel's default get/put values
 +		 */
 +		nvchan_wr32(chan->user_get, chan->pushbuf_base);
 +		nvchan_wr32(chan->user_put, chan->pushbuf_base);
 +
-+		if (dev_priv->fifo_alloc_count == 1) {
-+			ret = engine->fifo.load_context(chan);
-+			if (ret) {
-+				nouveau_channel_free(chan);
-+				return ret;
-+			}
++		ret = engine->fifo.load_context(chan);
++		if (ret) {
++			nouveau_channel_free(chan);
++			return ret;
++		}
 +
-+			ret = engine->graph.load_context(chan);
-+			if (ret) {
-+				nouveau_channel_free(chan);
-+				return ret;
-+			}
++		ret = engine->graph.load_context(chan);
++		if (ret) {
++			nouveau_channel_free(chan);
++			return ret;
 +		}
 +	}
 +
@@ -8806,6 +8811,9 @@ index 0000000..7761425
 +
 +	engine->graph.fifo_access(dev, true);
 +
++	if (dev_priv->fbdev_info)
++		dev_priv->fbdev_info->flags = fbdev_flags;
++
 +	ret = nouveau_dma_init(chan);
 +	if (!ret)
 +		ret = nouveau_fence_init(chan);
@@ -8867,6 +8875,7 @@ index 0000000..7761425
 +	struct drm_device *dev = chan->dev;
 +	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +	struct nouveau_engine *engine = &dev_priv->engine;
++	unsigned fbdev_flags = 0;
 +	uint64_t t_start;
 +	bool timeout = false;
 +	int ret;
@@ -8911,6 +8920,11 @@ index 0000000..7761425
 +	nouveau_fence_fini(chan);
 +
 +	/* disable the fifo caches */
++	if (dev_priv->fbdev_info) {
++		fbdev_flags = dev_priv->fbdev_info->flags;
++		dev_priv->fbdev_info->flags |= FBINFO_HWACCEL_DISABLED;
++	}
++
 +	nv_wr32(dev, NV03_PFIFO_CACHES, 0x00000000);
 +	nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_PUSH,
 +			nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_PUSH) & ~0x1);
@@ -8929,6 +8943,9 @@ index 0000000..7761425
 +	nv_wr32(dev, NV04_PFIFO_CACHE1_PULL0, 0x00000001);
 +	nv_wr32(dev, NV03_PFIFO_CACHES, 0x00000001);
 +
++	if (dev_priv->fbdev_info)
++		dev_priv->fbdev_info->flags = fbdev_flags;
++
 +	/* Deallocate push buffer */
 +	nouveau_gpuobj_ref_del(dev, &chan->pushbuf);
 +	nouveau_bo_ref(NULL, &chan->pushbuf_bo);
@@ -12257,10 +12274,10 @@ index 0000000..4a3f31a
 +#endif /* __NOUVEAU_FB_H__ */
 diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
 new file mode 100644
-index 0000000..af69791
+index 0000000..f744723
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
-@@ -0,0 +1,357 @@
+@@ -0,0 +1,354 @@
 +/*
 + * Copyright © 2007 David Airlie
 + *
@@ -12341,8 +12358,7 @@ index 0000000..af69791
 +
 +	ret = -EBUSY;
 +	for (i = 0; i < 100000; i++) {
-+		if (nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy + 3)
-+									== 0) {
++		if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy + 3)) {
 +			ret = 0;
 +			break;
 +		}
@@ -12549,7 +12565,6 @@ index 0000000..af69791
 +	par->nouveau_fb = nouveau_fb;
 +	par->dev = dev;
 +
-+#if 0
 +	switch (dev_priv->card_type) {
 +	case NV_50:
 +		nv50_fbcon_accel_init(info);
@@ -12558,7 +12573,6 @@ index 0000000..af69791
 +		nv04_fbcon_accel_init(info);
 +		break;
 +	};
-+#endif
 +
 +	/* Clear the entire fbcon.  The drm will program every connector
 +	 * with it's preferred mode.  If the sizes differ, one display will
@@ -23330,10 +23344,10 @@ index 0000000..638cf60
 +}
 diff --git a/drivers/gpu/drm/nouveau/nv04_fbcon.c b/drivers/gpu/drm/nouveau/nv04_fbcon.c
 new file mode 100644
-index 0000000..a2046d6
+index 0000000..8915fb3
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv04_fbcon.c
-@@ -0,0 +1,292 @@
+@@ -0,0 +1,295 @@
 +/*
 + * Copyright 2009 Ben Skeggs
 + * Copyright 2008 Stuart Bennett
@@ -23439,14 +23453,17 @@ index 0000000..a2046d6
 +	if (info->state != FBINFO_STATE_RUNNING)
 +		return;
 +
-+	if (image->depth != 1 || info->flags & FBINFO_HWACCEL_DISABLED) {
++	if (image->depth != 1) {
 +		cfb_imageblit(info, image);
 +		return;
 +	}
 +
-+	if (RING_SPACE(chan, 8)) {
++	if (!(info->flags & FBINFO_HWACCEL_DISABLED) && RING_SPACE(chan, 8)) {
 +		NV_ERROR(dev, "GPU lockup - switching to software fbcon\n");
 +		info->flags |= FBINFO_HWACCEL_DISABLED;
++	}
++
++	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 +		cfb_imageblit(info, image);
 +		return;
 +	}
@@ -23628,7 +23645,7 @@ index 0000000..a2046d6
 +
 diff --git a/drivers/gpu/drm/nouveau/nv04_fifo.c b/drivers/gpu/drm/nouveau/nv04_fifo.c
 new file mode 100644
-index 0000000..d9a6b70
+index 0000000..6e984dc
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv04_fifo.c
 @@ -0,0 +1,295 @@
@@ -23710,7 +23727,7 @@ index 0000000..d9a6b70
 +			nv_wr32(dev, 0x2230, 0);
 +			nv_wr32(dev, NV40_PFIFO_RAMFC,
 +				((nouveau_mem_fb_amount(dev) - 512 * 1024 +
-+				  dev_priv->ramfc_offset) >> 16) | (2 << 16));
++				  dev_priv->ramfc_offset) >> 16) | (3 << 16));
 +			break;
 +		}
 +		break;
@@ -24518,10 +24535,10 @@ index 0000000..b74d2fc
 +
 diff --git a/drivers/gpu/drm/nouveau/nv04_instmem.c b/drivers/gpu/drm/nouveau/nv04_instmem.c
 new file mode 100644
-index 0000000..0d1e3e8
+index 0000000..928464e
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv04_instmem.c
-@@ -0,0 +1,207 @@
+@@ -0,0 +1,213 @@
 +#include "drmP.h"
 +#include "drm.h"
 +#include "nouveau_drv.h"
@@ -24645,12 +24662,18 @@ index 0000000..0d1e3e8
 +	 */
 +	offset = dev_priv->ramfc_offset + dev_priv->ramfc_size;
 +
-+	/* On my NV4E, there's *something* clobbering the 16KiB just after
-+	 * where we setup these fixed tables.  No idea what it is just yet,
-+	 * so reserve this space on all NV4X cards for now.
++	/* It appears RAMRO (or something?) is controlled by 0x2220/0x2230
++	 * on certain NV4x chipsets as well as RAMFC.  When 0x2230 == 0
++	 * ("new style" control) the upper 16-bits of 0x2220 points at this
++	 * other mysterious table that's clobbering important things.
++	 *
++	 * We're now pointing this at RAMIN+0x30000 to avoid RAMFC getting
++	 * smashed to pieces on us, so reserve 0x30000-0x40000 too..
 +	 */
-+	if (dev_priv->card_type >= NV_40)
-+		offset += 16*1024;
++	if (dev_priv->card_type >= NV_40) {
++		if (offset < 0x40000)
++			offset = 0x40000;
++	}
 +
 +	ret = nouveau_mem_init_heap(&dev_priv->ramin_heap,
 +				    offset, dev_priv->ramin_rsvd_vram - offset);
@@ -28791,10 +28814,10 @@ index 0000000..6b5fdcc
 +}
 diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c
 new file mode 100644
-index 0000000..6415e4e
+index 0000000..915fe84
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv40_graph.c
-@@ -0,0 +1,2203 @@
+@@ -0,0 +1,2214 @@
 +/*
 + * Copyright (C) 2007 Ben Skeggs.
 + * All Rights Reserved.
@@ -30311,6 +30334,17 @@ index 0000000..6415e4e
 +void
 +nv40_graph_destroy_context(struct nouveau_channel *chan)
 +{
++	struct drm_device *dev = chan->dev;
++	uint32_t inst;
++
++	/* Mark context as unloaded if still active on PGRAPH */
++	inst = nv_rd32(dev, NV40_PGRAPH_CTXCTL_CUR);
++	if (inst & NV40_PGRAPH_CTXCTL_CUR_LOADED) {
++		inst &= NV40_PGRAPH_CTXCTL_CUR_INSTANCE;
++		if (inst == (chan->ramin_grctx->instance >> 4))
++			nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, inst);
++	}
++
 +	nouveau_gpuobj_ref_del(chan->dev, &chan->ramin_grctx);
 +}
 +
@@ -33390,7 +33424,7 @@ index 0000000..d2f0b80
 +
 diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c b/drivers/gpu/drm/nouveau/nv50_fbcon.c
 new file mode 100644
-index 0000000..d3807e3
+index 0000000..cc4c2f7
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
 @@ -0,0 +1,256 @@
@@ -33410,15 +33444,14 @@ index 0000000..d3807e3
 +	if (info->state != FBINFO_STATE_RUNNING)
 +		return;
 +
-+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
-+		cfb_fillrect(info, rect);
-+		return;
-+	}
-+
-+	if (RING_SPACE(chan, rect->rop == ROP_COPY ? 7 : 11)) {
++	if (!(info->flags & FBINFO_HWACCEL_DISABLED) &&
++	     RING_SPACE(chan, rect->rop == ROP_COPY ? 7 : 11)) {
 +		NV_ERROR(dev, "GPU lockup - switching to software fbcon\n");
 +
 +		info->flags |= FBINFO_HWACCEL_DISABLED;
++	}
++
++	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 +		cfb_fillrect(info, rect);
 +		return;
 +	}
@@ -33452,15 +33485,13 @@ index 0000000..d3807e3
 +	if (info->state != FBINFO_STATE_RUNNING)
 +		return;
 +
-+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
-+		cfb_copyarea(info, region);
-+		return;
-+	}
-+
-+	if (RING_SPACE(chan, 12)) {
++	if (!(info->flags & FBINFO_HWACCEL_DISABLED) && RING_SPACE(chan, 12)) {
 +		NV_ERROR(dev, "GPU lockup - switching to software fbcon\n");
 +
 +		info->flags |= FBINFO_HWACCEL_DISABLED;
++	}
++
++	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 +		cfb_copyarea(info, region);
 +		return;
 +	}
@@ -33494,14 +33525,17 @@ index 0000000..d3807e3
 +	if (info->state != FBINFO_STATE_RUNNING)
 +		return;
 +
-+	if (image->depth != 1 || (info->flags & FBINFO_HWACCEL_DISABLED)) {
++	if (image->depth != 1) {
 +		cfb_imageblit(info, image);
 +		return;
 +	}
 +
-+	if (RING_SPACE(chan, 11)) {
++	if (!(info->flags & FBINFO_HWACCEL_DISABLED) && RING_SPACE(chan, 11)) {
 +		NV_ERROR(dev, "GPU lockup - switching to software fbcon\n");
 +		info->flags |= FBINFO_HWACCEL_DISABLED;
++	}
++
++	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 +		cfb_imageblit(info, image);
 +		return;
 +	}


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1800
retrieving revision 1.1801
diff -u -p -r1.1800 -r1.1801
--- kernel.spec	15 Sep 2009 06:44:13 -0000	1.1800
+++ kernel.spec	15 Sep 2009 09:52:51 -0000	1.1801
@@ -2041,6 +2041,9 @@ fi
 
 %changelog
 * Tue Sep 15 2009 Ben Skeggs <bskeggs at redhat.com>
+- nouveau: misc fixes to context-related issues, fixes some severe nv4x bugs
+
+* Tue Sep 15 2009 Ben Skeggs <bskeggs at redhat.com>
 - nouveau: temporarily disable fbcon accel, it's racing with ttm
 
 * Mon Sep 14 2009 Steve Dickson <steved at redhat.com>




More information about the fedora-extras-commits mailing list