summaryrefslogtreecommitdiff
path: root/shared-core/i915_dma.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-17 10:14:18 -0700
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-17 10:14:18 -0700
commit1c7f895fa6531b16e7e9fd4568d4f6a50ca5711e (patch)
treeb46163c3b5f98e18d3ad1c70c095d77fc71721e6 /shared-core/i915_dma.c
parent4e4d9cbeb3f52b605e46aad8ae1a947ca236079f (diff)
parentb729b919baed250313caf3f0bbd4044e084de8bf (diff)
Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts: shared-core/i915_init.c - reconcile with airlied's new code
Diffstat (limited to 'shared-core/i915_dma.c')
-rw-r--r--shared-core/i915_dma.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 2b29dbe2..25172c1b 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -85,6 +85,8 @@ int i915_dma_cleanup(drm_device_t * dev)
* may not have been called from userspace and after dev_private
* is freed, it's too late.
*/
+ I915_WRITE(LP_RING + RING_LEN, 0);
+
if (dev->irq)
drm_irq_uninstall(dev);
@@ -97,6 +99,16 @@ static int i915_initialize(drm_device_t * dev,
drm_i915_init_t * init)
{
+ /* reset ring pointers */
+ I915_WRITE(LP_RING + RING_LEN, 0);
+ mb();
+
+ memset((void *)(dev_priv->ring.virtual_start), 0, dev_priv->ring.Size);
+
+ I915_WRITE(LP_RING + RING_START, dev_priv->ring.Start);
+ I915_WRITE(LP_RING + RING_LEN, ((dev_priv->ring.Size - 4096) & RING_NR_PAGES) | (RING_NO_REPORT | RING_VALID));
+
+
dev_priv->cpp = init->cpp;
dev_priv->sarea_priv->pf_current_page = 0;