summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-03-03 01:52:42 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-03-03 01:52:42 +0000
commitebf26765384bf85377083af5f4ad3cfcca892f7d (patch)
tree3980d9674ecd3bbd190735a63214511ab7789fa2
parent398f76333463e3b823fd242357811314b1b7197f (diff)
If we couldn't register an interrupt, don't abort attaching - we'll just
update colormaps immediately rather than waiting for the retrace interrupt.
-rw-r--r--sys/dev/sbus/cgsix.c14
-rw-r--r--sys/dev/sbus/vigra.c9
2 files changed, 14 insertions, 9 deletions
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 78e3e4451e3..435895b9003 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.48 2005/03/03 01:41:11 miod Exp $ */
+/* $OpenBSD: cgsix.c,v 1.49 2005/03/03 01:52:41 miod Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -180,8 +180,8 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
if ((sc->sc_ih = bus_intr_establish(sa->sa_bustag, sa->sa_pri,
IPL_TTY, 0, cgsix_intr, sc, self->dv_xname)) == NULL) {
- printf(": couldn't establish interrupt, pri %d\n", sa->sa_pri);
- goto fail_intr;
+ printf(": couldn't establish interrupt, pri %d\n%s",
+ sa->sa_pri, self->dv_xname);
}
/* if prom didn't initialize us, do it the hard way */
@@ -249,8 +249,6 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
return;
-fail_intr:
- bus_space_unmap(sa->sa_bustag, sc->sc_fbc_regs, CGSIX_FBC_SIZE);
fail_fbc:
bus_space_unmap(sa->sa_bustag, sc->sc_tec_regs, CGSIX_TEC_SIZE);
fail_tec:
@@ -313,7 +311,11 @@ cgsix_ioctl(void *v, u_long cmd, caddr_t data, int flags, struct proc *p)
error = cg6_bt_putcmap(&sc->sc_cmap, cm);
if (error)
return (error);
- cgsix_loadcmap_deferred(sc, cm->index, cm->count);
+ /* if we can handle interrupts, defer the update */
+ if (sc->sc_ih != NULL)
+ cgsix_loadcmap_deferred(sc, cm->index, cm->count);
+ else
+ cgsix_loadcmap_immediate(sc, cm->index, cm->count);
break;
case WSDISPLAYIO_SCURSOR:
curs = (struct wsdisplay_cursor *)data;
diff --git a/sys/dev/sbus/vigra.c b/sys/dev/sbus/vigra.c
index 32272c6e050..7aaae48890e 100644
--- a/sys/dev/sbus/vigra.c
+++ b/sys/dev/sbus/vigra.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vigra.c,v 1.3 2005/01/05 23:04:25 miod Exp $ */
+/* $OpenBSD: vigra.c,v 1.4 2005/03/03 01:52:41 miod Exp $ */
/*
* Copyright (c) 2002, 2003, Miodrag Vallat.
@@ -315,7 +315,6 @@ vigraattach(struct device *parent, struct device *self, void *args)
IPL_TTY, 0, vigra_intr, sc, self->dv_xname)) == NULL) {
printf("\n%s: couldn't establish interrupt, pri %d\n",
sa->sa_pri);
- return;
}
/*
@@ -393,7 +392,11 @@ vigra_ioctl(void *v, u_long cmd, caddr_t data, int flags, struct proc *p)
error = vigra_putcmap(&sc->sc_cmap, cm, sc->sc_g300);
if (error)
return (error);
- vigra_loadcmap_deferred(sc, cm->index, cm->count);
+ /* if we can handle interrupts, defer the update */
+ if (sc->sc_ih != NULL)
+ vigra_loadcmap_deferred(sc, cm->index, cm->count);
+ else
+ vigra_loadcmap_immediate(sc, cm->index, cm->count);
break;
case WSDISPLAYIO_SVIDEO: