rpms/kernel/devel drm-nouveau.patch, 1.27, 1.28 kernel.spec, 1.1465, 1.1466

Ben Skeggs bskeggs at fedoraproject.org
Wed Mar 25 01:49:56 UTC 2009


Author: bskeggs

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1366

Modified Files:
	drm-nouveau.patch kernel.spec 
Log Message:
* Wed Mar 25 2009 Ben Skeggs <bskeggs at redhat.com>
- drm-nouveau.patch: idle channels better before destroying them


drm-nouveau.patch:

Index: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau.patch,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- drm-nouveau.patch	22 Mar 2009 23:56:32 -0000	1.27
+++ drm-nouveau.patch	25 Mar 2009 01:49:54 -0000	1.28
@@ -2343,10 +2343,10 @@
 +}
 diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.h b/drivers/gpu/drm/nouveau/nouveau_dma.h
 new file mode 100644
-index 0000000..076baf6
+index 0000000..c783de4
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_dma.h
-@@ -0,0 +1,105 @@
+@@ -0,0 +1,106 @@
 +/*
 + * Copyright (C) 2007 Ben Skeggs.
 + * All Rights Reserved.
@@ -2440,6 +2440,7 @@
 +
 +	if (chan->dma.cur == chan->dma.put)
 +		return;
++	chan->accel_done = true;
 +
 +	DRM_MEMORYBARRIER();
 +	chan->dma.put = chan->dma.cur;
@@ -2623,10 +2624,10 @@
 +MODULE_LICENSE("GPL and additional rights");
 diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
 new file mode 100644
-index 0000000..fa22fd1
+index 0000000..f1fdeba
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
-@@ -0,0 +1,750 @@
+@@ -0,0 +1,751 @@
 +/*
 + * Copyright 2005 Stephane Marchesin.
 + * All Rights Reserved.
@@ -2802,6 +2803,7 @@
 +	volatile uint32_t *m2mf_ntfy_map;
 +	uint32_t vram_handle;
 +	uint32_t gart_handle;
++	bool accel_done;
 +
 +	/* Push buffer state (only for drm's channel on !mm_enabled) */
 +	struct {
@@ -4617,10 +4619,10 @@
 +};
 diff --git a/drivers/gpu/drm/nouveau/nouveau_fifo.c b/drivers/gpu/drm/nouveau/nouveau_fifo.c
 new file mode 100644
-index 0000000..469fdf3
+index 0000000..42228e7
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_fifo.c
-@@ -0,0 +1,676 @@
+@@ -0,0 +1,703 @@
 +/*
 + * Copyright 2005-2006 Stephane Marchesin
 + * All Rights Reserved.
@@ -5086,6 +5088,8 @@
 +	struct drm_nouveau_private *dev_priv = dev->dev_private;
 +	struct nouveau_engine *engine = &dev_priv->engine;
 +	uint64_t t_start;
++	bool timeout = false;
++	int ret;
 +
 +	DRM_INFO("%s: freeing fifo %d\n", __func__, chan->id);
 +
@@ -5095,11 +5099,35 @@
 +		if (engine->timer.read(dev) - t_start > 2000000000ULL) {
 +			DRM_ERROR("Failed to idle channel %d before destroy."
 +				  "Prepare for strangeness..\n", chan->id);
++			timeout = true;
 +			break;
 +		}
 +	}
 +
-+	/* Signal all pending fences, if any */
++	/* Wait on a fence until channel goes idle, this ensures the engine
++	 * has finished with the last push buffer completely before we destroy
++	 * the channel.
++	 */
++	if (!timeout && dev_priv->mm_enabled) {
++		struct drm_fence_object *fence = NULL;
++
++		ret = drm_fence_object_create(dev, chan->id, DRM_FENCE_TYPE_EXE,
++					      DRM_FENCE_FLAG_EMIT, &fence);
++		if (ret == 0)
++			ret = drm_fence_object_wait(fence, 0, 1,
++						    DRM_FENCE_TYPE_EXE);
++
++		if (ret) {
++			DRM_ERROR("Failed to idle channel %d before destroy.  "
++				  "Prepare for strangeness..\n", chan->id);
++			timeout = true;
++		}
++	}
++
++	/* Ensure all outstanding fences are signaled.  They should be if the
++	 * above attempts at idling were OK, but if we failed this'll tell TTM
++	 * we're done with the buffers.
++	 */
 +	if (dev_priv->mm_enabled) {
 +		drm_fence_handler(dev, chan->id, chan->next_sequence,
 +				  DRM_FENCE_TYPE_EXE, 0);
@@ -5107,6 +5135,7 @@
 +
 +	/*XXX: Maybe should wait for PGRAPH to finish with the stuff it fetched
 +	 *     from CACHE1 too?
++	 *25/3/2009: handled in the mm_enabled case
 +	 */
 +
 +	/* disable the fifo caches */
@@ -7983,10 +8012,10 @@
 +}
 diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
 new file mode 100644
-index 0000000..068797b
+index 0000000..8304c2e
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_object.c
-@@ -0,0 +1,1237 @@
+@@ -0,0 +1,1240 @@
 +/*
 + * Copyright (C) 2006 Ben Skeggs.
 + *
@@ -9147,6 +9176,9 @@
 +
 +	DRM_DEBUG("ch%d\n", chan->id);
 +
++	if (!chan->ramht_refs.next)
++		return;
++
 +	list_for_each_safe(entry, tmp, &chan->ramht_refs) {
 +		ref = list_entry(entry, struct nouveau_gpuobj_ref, list);
 +
@@ -19848,10 +19880,10 @@
 +#define NV50_CRTC1_SCALE_RES2		0xCDC
 diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c b/drivers/gpu/drm/nouveau/nv50_fbcon.c
 new file mode 100644
-index 0000000..dfa14ae
+index 0000000..9e0625d
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
-@@ -0,0 +1,218 @@
+@@ -0,0 +1,220 @@
 +#include "drmP.h"
 +#include "nouveau_drv.h"
 +#include "nouveau_dma.h"
@@ -19866,7 +19898,8 @@
 +	struct nouveau_channel *chan = dev_priv->channel;
 +	int ret, i;
 +
-+	if (info->state != FBINFO_STATE_RUNNING ||
++	if (!chan->accel_done ||
++	    info->state != FBINFO_STATE_RUNNING ||
 +	    info->flags & FBINFO_HWACCEL_DISABLED)
 +		return 0;
 +
@@ -19898,6 +19931,7 @@
 +		return 0;
 +	}
 +
++	chan->accel_done = false;
 +	return 0;
 +}
 +


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1465
retrieving revision 1.1466
diff -u -r1.1465 -r1.1466
--- kernel.spec	24 Mar 2009 21:54:28 -0000	1.1465
+++ kernel.spec	25 Mar 2009 01:49:55 -0000	1.1466
@@ -1810,6 +1810,9 @@
 # and build.
 
 %changelog
+* Wed Mar 25 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: idle channels better before destroying them
+
 * Tue Mar 24 2009 Kyle McMartin <kyle at redhat.com>
 - Disable DMAR by default until suspend & resume is fixed.
 




More information about the fedora-extras-commits mailing list