summaryrefslogtreecommitdiff
path: root/shared-core/i915_dma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-04-17 18:16:38 +1000
committerDave Airlie <airlied@linux.ie>2007-04-17 18:16:38 +1000
commit79aa1d54746f33c33ffbf98fb96ccbf88c3cb390 (patch)
tree7ccbdbc7750015391833988a68b8058d2eb77235 /shared-core/i915_dma.c
parentcd5769c3b563048357535b24dc40783775adb227 (diff)
another large overhaul of interactions with userspace...
We need to keep a list of user created fbs to nuke on master exit. We also need to use the bo properly.
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;