summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-05-05 13:02:47 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-05-05 13:02:47 +0000
commit900c86559a9a839726af9d092b8a8fbb10ac309a (patch)
tree92b705fcb9a60aa5afdc0e4b9454fafa8e022d51 /sys
parentfe2551a9af2d85c04dd5c0ede8c53291fbb5851f (diff)
With KMS, the inteldrm_quiesce dance isn't needed anymore. Zap the code.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.c42
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.h6
-rw-r--r--sys/dev/pci/drm/i915/i915_gem.c32
3 files changed, 4 insertions, 76 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c
index 48bf6c637f0..e51da6c63e0 100644
--- a/sys/dev/pci/drm/i915/i915_drv.c
+++ b/sys/dev/pci/drm/i915/i915_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.c,v 1.25 2013/05/05 12:30:41 kettenis Exp $ */
+/* $OpenBSD: i915_drv.c,v 1.26 2013/05/05 13:02:45 kettenis Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -128,7 +128,6 @@ int inteldrm_doioctl(struct drm_device *, u_long, caddr_t, struct drm_file *);
int inteldrm_gmch_match(struct pci_attach_args *);
void inteldrm_timeout(void *);
-void inteldrm_quiesce(struct inteldrm_softc *);
/* For reset and suspend */
int i8xx_do_reset(struct drm_device *);
@@ -1070,17 +1069,11 @@ inteldrm_activate(struct device *arg, int act)
switch (act) {
case DVACT_QUIESCE:
-// inteldrm_quiesce(dev_priv);
i915_drm_freeze(dev);
break;
case DVACT_SUSPEND:
-// i915_save_state(dev);
break;
case DVACT_RESUME:
-// i915_restore_state(dev);
-// /* entrypoints can stop sleeping now */
-// atomic_clearbits_int(&dev_priv->sc_flags, INTELDRM_QUIET);
-// wakeup(&dev_priv->flags);
i915_drm_thaw(dev);
intel_fb_restore_mode(dev);
break;
@@ -1105,17 +1098,11 @@ inteldrm_ioctl(struct drm_device *dev, u_long cmd, caddr_t data,
struct inteldrm_softc *dev_priv = dev->dev_private;
int error = 0;
- while ((dev_priv->sc_flags & INTELDRM_QUIET) && error == 0)
- error = tsleep(&dev_priv->flags, PCATCH, "intelioc", 0);
- if (error)
- return (error);
dev_priv->entries++;
error = inteldrm_doioctl(dev, cmd, data, file_priv);
dev_priv->entries--;
- if (dev_priv->sc_flags & INTELDRM_QUIET)
- wakeup(&dev_priv->entries);
return (error);
}
@@ -1559,33 +1546,6 @@ i915_gem_put_relocs_to_user(struct drm_i915_gem_exec_object2 *exec_list,
}
void
-inteldrm_quiesce(struct inteldrm_softc *dev_priv)
-{
- /*
- * Right now we depend on X vt switching, so we should be
- * already suspended, but fallbacks may fault, etc.
- * Since we can't readback the gtt to reset what we have, make
- * sure that everything is unbound.
- */
- KASSERT(dev_priv->mm.suspended);
- KASSERT(dev_priv->ring[RCS].obj == NULL);
- atomic_setbits_int(&dev_priv->sc_flags, INTELDRM_QUIET);
- while (dev_priv->entries)
- tsleep(&dev_priv->entries, 0, "intelquiet", 0);
- /*
- * nothing should be dirty WRT the chip, only stuff that's bound
- * for gtt mapping. Nothing should be pinned over vt switch, if it
- * is then rendering corruption will occur due to api misuse, shame.
- */
- KASSERT(list_empty(&dev_priv->mm.active_list));
- /* Disabled because root could panic the kernel if this was enabled */
- /* KASSERT(dev->pin_count == 0); */
-
- /* can't fail since uninterruptible */
- (void)i915_gem_evict_inactive(dev_priv);
-}
-
-void
inteldrm_timeout(void *arg)
{
struct inteldrm_softc *dev_priv = arg;
diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h
index 9bfd4fd869a..62496fecf85 100644
--- a/sys/dev/pci/drm/i915/i915_drv.h
+++ b/sys/dev/pci/drm/i915/i915_drv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.h,v 1.15 2013/04/21 14:41:26 kettenis Exp $ */
+/* $OpenBSD: i915_drv.h,v 1.16 2013/05/05 13:02:46 kettenis Exp $ */
/* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
*/
/*
@@ -618,10 +618,6 @@ struct inteldrm_softc {
int fence_reg_start; /* 4 by default */
int num_fence_regs; /* 8 pre-965, 16 post */
-#define INTELDRM_QUIET 0x01 /* suspend close, get off the hardware */
-#define INTELDRM_WEDGED 0x02 /* chipset hung pending reset */
-#define INTELDRM_SUSPENDED 0x04 /* in vt switch, no commands */
- int sc_flags; /* quiet, suspended, hung */
/* number of ioctls + faults in flight */
int entries;
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c
index 81c47c401ae..a11aecb6341 100644
--- a/sys/dev/pci/drm/i915/i915_gem.c
+++ b/sys/dev/pci/drm/i915/i915_gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem.c,v 1.12 2013/04/21 14:41:26 kettenis Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.13 2013/05/05 13:02:46 kettenis Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -749,29 +749,7 @@ i915_gem_fault(struct drm_obj *gem_obj, struct uvm_faultinfo *ufi,
vm_prot_t mapprot;
boolean_t locked = TRUE;
- /* Are we about to suspend?, if so wait until we're done */
- if (dev_priv->sc_flags & INTELDRM_QUIET) {
- /* we're about to sleep, unlock the map etc */
- uvmfault_unlockall(ufi, NULL, &obj->base.uobj, NULL);
- while (dev_priv->sc_flags & INTELDRM_QUIET)
- tsleep(&dev_priv->flags, 0, "intelflt", 0);
- dev_priv->entries++;
- /*
- * relock so we're in the same state we would be in if we
- * were not quiesced before
- */
- locked = uvmfault_relock(ufi);
- if (locked) {
- drm_lock_obj(&obj->base);
- } else {
- dev_priv->entries--;
- if (dev_priv->sc_flags & INTELDRM_QUIET)
- wakeup(&dev_priv->entries);
- return (VM_PAGER_REFAULT);
- }
- } else {
- dev_priv->entries++;
- }
+ dev_priv->entries++;
if (rw_enter(&dev->dev_lock, RW_NOSLEEP | RW_READ) != 0) {
uvmfault_unlockall(ufi, NULL, &obj->base.uobj, NULL);
@@ -784,8 +762,6 @@ i915_gem_fault(struct drm_obj *gem_obj, struct uvm_faultinfo *ufi,
drm_hold_object_locked(&obj->base);
else { /* obj already unlocked */
dev_priv->entries--;
- if (dev_priv->sc_flags & INTELDRM_QUIET)
- wakeup(&dev_priv->entries);
return (VM_PAGER_REFAULT);
}
@@ -847,8 +823,6 @@ i915_gem_fault(struct drm_obj *gem_obj, struct uvm_faultinfo *ufi,
NULL, NULL);
DRM_READUNLOCK();
dev_priv->entries--;
- if (dev_priv->sc_flags & INTELDRM_QUIET)
- wakeup(&dev_priv->entries);
uvm_wait("intelflt");
return (VM_PAGER_REFAULT);
}
@@ -858,8 +832,6 @@ error:
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, NULL, NULL);
DRM_READUNLOCK();
dev_priv->entries--;
- if (dev_priv->sc_flags & INTELDRM_QUIET)
- wakeup(&dev_priv->entries);
pmap_update(ufi->orig_map->pmap);
if (ret == EIO) {
/*