summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-01-05 19:12:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-01-05 19:12:49 +0000
commit57760d0fdaa0859b46f19c135b385c994185f75b (patch)
tree79a9fd5344e098b41b8bde92cc6d51c0431ff34c
parentb11c7ae9dc92860a99923a1c9d307cd587a8a01f (diff)
Partially revert some of these changes - misunderstanding between drahn@ and I
about which diff he had tested.
-rw-r--r--sys/arch/arm/xscale/pxa2x0_lcd.c94
-rw-r--r--sys/arch/arm/xscale/pxa2x0_lcd.h11
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_lcd.c21
3 files changed, 100 insertions, 26 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_lcd.c b/sys/arch/arm/xscale/pxa2x0_lcd.c
index 9e1efd6e3c9..5eab0ab878f 100644
--- a/sys/arch/arm/xscale/pxa2x0_lcd.c
+++ b/sys/arch/arm/xscale/pxa2x0_lcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_lcd.c,v 1.5 2005/01/05 18:11:54 miod Exp $ */
+/* $OpenBSD: pxa2x0_lcd.c,v 1.6 2005/01/05 19:12:47 miod Exp $ */
/* $NetBSD: pxa2x0_lcd.c,v 1.8 2003/10/03 07:24:05 bsh Exp $ */
/*
@@ -472,8 +472,7 @@ pxa2x0_lcd_new_screen(struct pxa2x0_lcd_softc *sc,
* raster operation subsystem.
*/
int
-pxa2x0_lcd_setup_wsscreen(struct pxa2x0_lcd_softc *sc,
- struct pxa2x0_wsscreen_descr *descr,
+pxa2x0_lcd_setup_wsscreen(struct pxa2x0_wsscreen_descr *descr,
const struct lcd_panel_geometry *geom,
const char *fontname)
{
@@ -508,16 +507,9 @@ pxa2x0_lcd_setup_wsscreen(struct pxa2x0_lcd_softc *sc,
rasops_init(&rinfo, 100, 100);
- /*
- * Since we will use a rasops structure per screen, we need to
- * keep a copy of the emulops (which will always be the same)
- * in the softc, so as not to require an extra indirection layer.
- */
- sc->emulops = rinfo.ri_ops;
descr->c.nrows = rinfo.ri_rows;
descr->c.ncols = rinfo.ri_cols;
descr->c.capabilities = rinfo.ri_caps;
- descr->c.textops = &sc->emulops;
return cookie;
}
@@ -571,7 +563,7 @@ pxa2x0_lcd_alloc_screen(void *v, const struct wsscreen_descr *_type,
scr->rinfo.ri_ops.alloc_attr(&scr->rinfo, 0, 0, 0, attrp);
- *cookiep = &scr->rinfo;
+ *cookiep = scr;
*curxp = 0;
*curyp = 0;
@@ -660,3 +652,83 @@ pxa2x0_lcd_mmap(void *v, off_t offset, int prot)
return (bus_dmamem_mmap(sc->dma_tag, screen->segs, screen->nsegs,
offset, prot, BUS_DMA_WAITOK | BUS_DMA_COHERENT));
}
+
+static void
+pxa2x0_lcd_cursor(void *cookie, int on, int row, int col)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ (* scr->rinfo.ri_ops.cursor)(&scr->rinfo, on, row, col);
+}
+
+static int
+pxa2x0_lcd_mapchar(void *cookie, int c, unsigned int *cp)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ return (* scr->rinfo.ri_ops.mapchar)(&scr->rinfo, c, cp);
+}
+
+static void
+pxa2x0_lcd_putchar(void *cookie, int row, int col, u_int uc, long attr)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ (* scr->rinfo.ri_ops.putchar)(&scr->rinfo,
+ row, col, uc, attr);
+}
+
+static void
+pxa2x0_lcd_copycols(void *cookie, int row, int src, int dst, int num)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ (* scr->rinfo.ri_ops.copycols)(&scr->rinfo,
+ row, src, dst, num);
+}
+
+static void
+pxa2x0_lcd_erasecols(void *cookie, int row, int col, int num, long attr)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ (* scr->rinfo.ri_ops.erasecols)(&scr->rinfo,
+ row, col, num, attr);
+}
+
+static void
+pxa2x0_lcd_copyrows(void *cookie, int src, int dst, int num)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ (* scr->rinfo.ri_ops.copyrows)(&scr->rinfo,
+ src, dst, num);
+}
+
+static void
+pxa2x0_lcd_eraserows(void *cookie, int row, int num, long attr)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ (* scr->rinfo.ri_ops.eraserows)(&scr->rinfo,
+ row, num, attr);
+}
+
+static int
+pxa2x0_lcd_alloc_attr(void *cookie, int fg, int bg, int flg, long *attr)
+{
+ struct pxa2x0_lcd_screen *scr = cookie;
+
+ return scr->rinfo.ri_ops.alloc_attr(&scr->rinfo, fg, bg, flg, attr);
+}
+
+const struct wsdisplay_emulops pxa2x0_lcd_emulops = {
+ pxa2x0_lcd_cursor,
+ pxa2x0_lcd_mapchar,
+ pxa2x0_lcd_putchar,
+ pxa2x0_lcd_copycols,
+ pxa2x0_lcd_erasecols,
+ pxa2x0_lcd_copyrows,
+ pxa2x0_lcd_eraserows,
+ pxa2x0_lcd_alloc_attr
+};
diff --git a/sys/arch/arm/xscale/pxa2x0_lcd.h b/sys/arch/arm/xscale/pxa2x0_lcd.h
index 22c18ac6506..12200d87af3 100644
--- a/sys/arch/arm/xscale/pxa2x0_lcd.h
+++ b/sys/arch/arm/xscale/pxa2x0_lcd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_lcd.h,v 1.3 2005/01/05 18:11:54 miod Exp $ */
+/* $OpenBSD: pxa2x0_lcd.h,v 1.4 2005/01/05 19:12:47 miod Exp $ */
/* $NetBSD: pxa2x0_lcd.h,v 1.2 2003/06/17 09:43:14 bsh Exp $ */
/*
* Copyright (c) 2002 Genetec Corporation. All rights reserved.
@@ -85,8 +85,6 @@ struct pxa2x0_lcd_softc {
int n_screens;
LIST_HEAD(, pxa2x0_lcd_screen) screens;
struct pxa2x0_lcd_screen *active;
- struct wsdisplay_emulops emulops; /* master emulops copy */
-
void *ih; /* interrupt handler */
};
@@ -136,9 +134,8 @@ struct pxa2x0_wsscreen_descr {
int depth; /* bits per pixel */
};
-int pxa2x0_lcd_setup_wsscreen(struct pxa2x0_lcd_softc *,
- struct pxa2x0_wsscreen_descr *, const struct lcd_panel_geometry *,
- const char * );
+int pxa2x0_lcd_setup_wsscreen(struct pxa2x0_wsscreen_descr *,
+ const struct lcd_panel_geometry *, const char * );
int pxa2x0_lcd_show_screen(void *, void *, int, void (*)(void *, int, int),
void *);
@@ -148,4 +145,6 @@ int pxa2x0_lcd_alloc_screen(void *, const struct wsscreen_descr *,
void **, int *, int *, long *);
void pxa2x0_lcd_free_screen(void *, void *);
+extern const struct wsdisplay_emulops pxa2x0_lcd_emulops;
+
#endif /* _ARM_XSCALE_PXA2X0_LCD_H */
diff --git a/sys/arch/zaurus/zaurus/zaurus_lcd.c b/sys/arch/zaurus/zaurus/zaurus_lcd.c
index 42fbada74ba..58b44576126 100644
--- a/sys/arch/zaurus/zaurus/zaurus_lcd.c
+++ b/sys/arch/zaurus/zaurus/zaurus_lcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_lcd.c,v 1.4 2005/01/05 18:11:57 miod Exp $ */
+/* $OpenBSD: zaurus_lcd.c,v 1.5 2005/01/05 19:12:48 miod Exp $ */
/* $NetBSD: lubbock_lcd.c,v 1.1 2003/08/09 19:38:53 bsh Exp $ */
/*
@@ -70,18 +70,21 @@ int lcdintr(void *);
struct pxa2x0_wsscreen_descr
lcd_bpp16_screen = {
{
- "std" /* "bpp16" */
+ "std" /* "bpp16" */, 0, 0,
+ &pxa2x0_lcd_emulops,
},
16 /* bits per pixel */
#ifdef notyet
}, lcd_bpp8_screen = {
{
- "bpp8"
+ "bpp8", 0, 0,
+ &pxa2x0_lcd_emulops,
},
8 /* bits per pixel */
}, lcd_bpp4_screen = {
{
- "bpp4"
+ "bpp4", 0, 0,
+ &pxa2x0_lcd_emulops,
},
4 /* bits per pixel */
#endif
@@ -131,7 +134,7 @@ lcd_match(struct device *parent, void *cf, void *aux)
return 1;
}
-#define CURRENT_DISPLAY &sharp_zaurus_C3000
+#define CURRENT_DISPLAY sharp_zaurus_C3000
static const struct lcd_panel_geometry sharp_zaurus_C3000 =
{
@@ -158,13 +161,13 @@ lcd_attach(struct device *parent, struct device *self, void *aux)
struct pxa2x0_lcd_softc *sc = (struct pxa2x0_lcd_softc *)self;
struct wsemuldisplaydev_attach_args aa;
- pxa2x0_lcd_attach_sub(sc, aux, CURRENT_DISPLAY);
+ pxa2x0_lcd_attach_sub(sc, aux, &CURRENT_DISPLAY);
/* make wsdisplay screen list */
- pxa2x0_lcd_setup_wsscreen(sc, &lcd_bpp16_screen, CURRENT_DISPLAY, NULL);
+ pxa2x0_lcd_setup_wsscreen(&lcd_bpp16_screen, &CURRENT_DISPLAY, NULL);
#ifdef notyet
- pxa2x0_lcd_setup_wsscreen(sc, &lcd_bpp8_screen, CURRENT_DISPLAY, NULL);
- pxa2x0_lcd_setup_wsscreen(sc, &lcd_bpp4_screen, CURRENT_DISPLAY, NULL);
+ pxa2x0_lcd_setup_wsscreen(&lcd_bpp8_screen, &CURRENT_DISPLAY, NULL);
+ pxa2x0_lcd_setup_wsscreen(&lcd_bpp4_screen, &CURRENT_DISPLAY, NULL);
#endif
aa.console = 0; /* XXX */