tga.c revision 1.9 1 /* $NetBSD: tga.c,v 1.9 1998/09/02 19:51:06 drochner Exp $ */
2
3 /*
4 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved.
6 *
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 *
19 * Carnegie Mellon requests users of this software to return to
20 *
21 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
25 *
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
28 */
29
30 #include "opt_uvm.h"
31
32 #include <sys/param.h>
33 #include <sys/systm.h>
34 #include <sys/kernel.h>
35 #include <sys/device.h>
36 #include <sys/conf.h>
37 #include <sys/malloc.h>
38 #include <sys/buf.h>
39 #include <sys/ioctl.h>
40
41 #include <vm/vm.h>
42
43 #include <machine/bus.h>
44 #include <machine/intr.h>
45
46 #include <dev/pci/pcireg.h>
47 #include <dev/pci/pcivar.h>
48 #include <dev/pci/pcidevs.h>
49 #include <dev/pci/tgareg.h>
50 #include <dev/pci/tgavar.h>
51 #include <dev/ic/bt485reg.h>
52
53 #include <dev/rcons/raster.h>
54 #include <dev/wscons/wsconsio.h>
55 #include <dev/wscons/wscons_raster.h>
56 #include <dev/wscons/wsdisplayvar.h>
57
58 #ifdef __alpha__
59 #include <machine/pte.h>
60 #endif
61
62 int tgamatch __P((struct device *, struct cfdata *, void *));
63 void tgaattach __P((struct device *, struct device *, void *));
64 int tgaprint __P((void *, const char *));
65
66 struct cfattach tga_ca = {
67 sizeof(struct tga_softc), tgamatch, tgaattach,
68 };
69
70 int tga_identify __P((tga_reg_t *));
71 const struct tga_conf *tga_getconf __P((int));
72 void tga_getdevconfig __P((bus_space_tag_t memt, pci_chipset_tag_t pc,
73 pcitag_t tag, struct tga_devconfig *dc));
74
75 struct tga_devconfig tga_console_dc;
76
77 struct wsdisplay_emulops tga_emulops = {
78 rcons_cursor, /* could use hardware cursor; punt */
79 rcons_mapchar,
80 rcons_putchar,
81 rcons_copycols,
82 rcons_erasecols,
83 rcons_copyrows,
84 rcons_eraserows,
85 rcons_alloc_attr
86 };
87
88 struct wsscreen_descr tga_stdscreen = {
89 "std",
90 0, 0, /* will be filled in -- XXX shouldn't, it's global */
91 &tga_emulops,
92 0, 0,
93 WSSCREEN_REVERSE
94 };
95
96 const struct wsscreen_descr *_tga_scrlist[] = {
97 &tga_stdscreen,
98 /* XXX other formats, graphics screen? */
99 };
100
101 struct wsscreen_list tga_screenlist = {
102 sizeof(_tga_scrlist) / sizeof(struct wsscreen_descr *), _tga_scrlist
103 };
104
105 int tga_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
106 int tga_mmap __P((void *, off_t, int));
107 static int tga_alloc_screen __P((void *, const struct wsscreen_descr *,
108 void **, int *, int *, long *));
109 static void tga_free_screen __P((void *, void *));
110 static void tga_show_screen __P((void *, void *));
111 static int tga_load_font __P((void *, void *, int, int, int, void *));
112
113 struct wsdisplay_accessops tga_accessops = {
114 tga_ioctl,
115 tga_mmap,
116 tga_alloc_screen,
117 tga_free_screen,
118 tga_show_screen,
119 tga_load_font
120 };
121
122 void tga_blank __P((struct tga_devconfig *));
123 void tga_unblank __P((struct tga_devconfig *));
124
125 int
126 tgamatch(parent, match, aux)
127 struct device *parent;
128 struct cfdata *match;
129 void *aux;
130 {
131 struct pci_attach_args *pa = aux;
132
133 if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_DEC ||
134 PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_DEC_21030)
135 return (0);
136
137 return (10);
138 }
139
140 void
141 tga_getdevconfig(memt, pc, tag, dc)
142 bus_space_tag_t memt;
143 pci_chipset_tag_t pc;
144 pcitag_t tag;
145 struct tga_devconfig *dc;
146 {
147 const struct tga_conf *tgac;
148 const struct tga_ramdac_conf *tgar;
149 struct raster *rap;
150 struct rcons *rcp;
151 bus_size_t pcisize;
152 int i, flags;
153
154 dc->dc_memt = memt;
155 dc->dc_pc = pc;
156
157 dc->dc_pcitag = tag;
158
159 /* XXX magic number */
160 if (pci_mapreg_info(pc, tag, 0x10,
161 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
162 &dc->dc_pcipaddr, &pcisize, &flags))
163 return;
164 if ((flags & BUS_SPACE_MAP_CACHEABLE) == 0) /* XXX */
165 panic("tga memory not cacheable");
166
167 if (bus_space_map(memt, dc->dc_pcipaddr, pcisize,
168 BUS_SPACE_MAP_CACHEABLE | BUS_SPACE_MAP_LINEAR, &dc->dc_vaddr))
169 return;
170 #ifdef __alpha__
171 dc->dc_paddr = ALPHA_K0SEG_TO_PHYS(dc->dc_vaddr); /* XXX */
172 #endif
173
174 dc->dc_regs = (tga_reg_t *)(dc->dc_vaddr + TGA_MEM_CREGS);
175 dc->dc_tga_type = tga_identify(dc->dc_regs);
176 tgac = dc->dc_tgaconf = tga_getconf(dc->dc_tga_type);
177 if (tgac == NULL)
178 return;
179
180 #if 0
181 /* XXX on the Alpha, pcisize = 4 * cspace_size. */
182 if (tgac->tgac_cspace_size != pcisize) /* sanity */
183 panic("tga_getdevconfig: memory size mismatch?");
184 #endif
185
186 tgar = tgac->tgac_ramdac;
187
188 switch (dc->dc_regs[TGA_REG_VHCR] & 0x1ff) { /* XXX */
189 case 0:
190 dc->dc_wid = 8192;
191 break;
192
193 case 1:
194 dc->dc_wid = 8196;
195 break;
196
197 default:
198 dc->dc_wid = (dc->dc_regs[TGA_REG_VHCR] & 0x1ff) * 4; /* XXX */
199 break;
200 }
201
202 dc->dc_rowbytes = dc->dc_wid * (dc->dc_tgaconf->tgac_phys_depth / 8);
203
204 if ((dc->dc_regs[TGA_REG_VHCR] & 0x00000001) != 0 && /* XXX */
205 (dc->dc_regs[TGA_REG_VHCR] & 0x80000000) != 0) { /* XXX */
206 dc->dc_wid -= 4;
207 /*
208 * XXX XXX turning off 'odd' shouldn't be necesssary,
209 * XXX XXX but i can't make X work with the weird size.
210 */
211 dc->dc_regs[TGA_REG_VHCR] &= ~0x80000001;
212 dc->dc_rowbytes =
213 dc->dc_wid * (dc->dc_tgaconf->tgac_phys_depth / 8);
214 }
215
216 dc->dc_ht = (dc->dc_regs[TGA_REG_VVCR] & 0x7ff); /* XXX */
217
218 /* XXX this seems to be what DEC does */
219 dc->dc_regs[TGA_REG_CCBR] = 0;
220 dc->dc_regs[TGA_REG_VVBR] = 1;
221 dc->dc_videobase = dc->dc_vaddr + tgac->tgac_dbuf[0] +
222 1 * tgac->tgac_vvbr_units;
223 dc->dc_blanked = 1;
224 tga_unblank(dc);
225
226 /*
227 * Set all bits in the pixel mask, to enable writes to all pixels.
228 * It seems that the console firmware clears some of them
229 * under some circumstances, which causes cute vertical stripes.
230 */
231 dc->dc_regs[TGA_REG_GPXR_P] = 0xffffffff;
232
233 /* clear the screen */
234 for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
235 *(u_int32_t *)(dc->dc_videobase + i) = 0;
236
237 /* initialize the raster */
238 rap = &dc->dc_raster;
239 rap->width = dc->dc_wid;
240 rap->height = dc->dc_ht;
241 rap->depth = tgac->tgac_phys_depth;
242 rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
243 rap->pixels = (u_int32_t *)dc->dc_videobase;
244
245 /* initialize the raster console blitter */
246 rcp = &dc->dc_rcons;
247 rcp->rc_sp = rap;
248 rcp->rc_crow = rcp->rc_ccol = -1;
249 rcp->rc_crowp = &rcp->rc_crow;
250 rcp->rc_ccolp = &rcp->rc_ccol;
251 rcons_init(rcp, 34, 80);
252
253 tga_stdscreen.nrows = dc->dc_rcons.rc_maxrow;
254 tga_stdscreen.ncols = dc->dc_rcons.rc_maxcol;
255 }
256
257 void
258 tgaattach(parent, self, aux)
259 struct device *parent, *self;
260 void *aux;
261 {
262 struct pci_attach_args *pa = aux;
263 struct tga_softc *sc = (struct tga_softc *)self;
264 struct wsemuldisplaydev_attach_args aa;
265 pci_intr_handle_t intrh;
266 const char *intrstr;
267 u_int8_t rev;
268 int console;
269
270 #ifdef __alpha__
271 console = (pa->pa_tag == tga_console_dc.dc_pcitag);
272 #else
273 console = 0;
274 #endif
275 if (console) {
276 sc->sc_dc = &tga_console_dc;
277 sc->nscreens = 1;
278 } else {
279 sc->sc_dc = (struct tga_devconfig *)
280 malloc(sizeof(struct tga_devconfig), M_DEVBUF, M_WAITOK);
281 bzero(sc->sc_dc, sizeof(struct tga_devconfig));
282 tga_getdevconfig(pa->pa_memt, pa->pa_pc, pa->pa_tag, sc->sc_dc);
283 }
284 if (sc->sc_dc->dc_vaddr == NULL) {
285 printf(": couldn't map memory space; punt!\n");
286 return;
287 }
288
289 /* XXX say what's going on. */
290 intrstr = NULL;
291 if (sc->sc_dc->dc_tgaconf->tgac_ramdac->tgar_intr != NULL) {
292 if (pci_intr_map(pa->pa_pc, pa->pa_intrtag, pa->pa_intrpin,
293 pa->pa_intrline, &intrh)) {
294 printf(": couldn't map interrupt");
295 return;
296 }
297 intrstr = pci_intr_string(pa->pa_pc, intrh);
298 sc->sc_intr = pci_intr_establish(pa->pa_pc, intrh, IPL_TTY,
299 sc->sc_dc->dc_tgaconf->tgac_ramdac->tgar_intr, sc->sc_dc);
300 if (sc->sc_intr == NULL) {
301 printf(": couldn't establish interrupt");
302 if (intrstr != NULL)
303 printf("at %s", intrstr);
304 printf("\n");
305 return;
306 }
307 }
308
309 /*
310 * Initialize the RAMDAC and allocate any private storage it needs.
311 * Initialization includes disabling cursor, setting a sane
312 * colormap, etc.
313 */
314 (*sc->sc_dc->dc_tgaconf->tgac_ramdac->tgar_init)(sc->sc_dc, 1);
315
316 printf(": DC21030 ");
317 rev = PCI_REVISION(pa->pa_class);
318 switch (rev) {
319 case 1: case 2: case 3:
320 printf("step %c", 'A' + rev - 1);
321 break;
322
323 default:
324 printf("unknown stepping (0x%x)", rev);
325 break;
326 }
327 printf(", ");
328
329 if (sc->sc_dc->dc_tgaconf == NULL) {
330 printf("unknown board configuration\n");
331 return;
332 }
333 printf("board type %s\n", sc->sc_dc->dc_tgaconf->tgac_name);
334 printf("%s: %d x %d, %dbpp, %s RAMDAC\n", sc->sc_dev.dv_xname,
335 sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
336 sc->sc_dc->dc_tgaconf->tgac_phys_depth,
337 sc->sc_dc->dc_tgaconf->tgac_ramdac->tgar_name);
338
339 if (intrstr != NULL)
340 printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname,
341 intrstr);
342
343 aa.console = console;
344 aa.scrdata = &tga_screenlist;
345 aa.accessops = &tga_accessops;
346 aa.accesscookie = sc;
347
348 config_found(self, &aa, wsemuldisplaydevprint);
349 }
350
351 int
352 tga_ioctl(v, cmd, data, flag, p)
353 void *v;
354 u_long cmd;
355 caddr_t data;
356 int flag;
357 struct proc *p;
358 {
359 struct tga_softc *sc = v;
360 struct tga_devconfig *dc = sc->sc_dc;
361 const struct tga_ramdac_conf *tgar = dc->dc_tgaconf->tgac_ramdac;
362
363 switch (cmd) {
364 case WSDISPLAYIO_GTYPE:
365 *(u_int *)data = WSDISPLAY_TYPE_TGA;
366 return (0);
367
368 case WSDISPLAYIO_GINFO:
369 #define wsd_fbip ((struct wsdisplay_fbinfo *)data)
370 wsd_fbip->height = sc->sc_dc->dc_ht;
371 wsd_fbip->width = sc->sc_dc->dc_wid;
372 wsd_fbip->depth = sc->sc_dc->dc_tgaconf->tgac_phys_depth;
373 wsd_fbip->cmsize = 256; /* XXX ??? */
374 #undef fbt
375 return (0);
376
377 case WSDISPLAYIO_GETCMAP:
378 return (*tgar->tgar_get_cmap)(dc,
379 (struct wsdisplay_cmap *)data);
380
381 case WSDISPLAYIO_PUTCMAP:
382 return (*tgar->tgar_set_cmap)(dc,
383 (struct wsdisplay_cmap *)data);
384
385 case WSDISPLAYIO_GVIDEO:
386 if (*(u_int *)data == WSDISPLAYIO_VIDEO_OFF)
387 tga_blank(sc->sc_dc);
388 else
389 tga_unblank(sc->sc_dc);
390 return (0);
391
392 case WSDISPLAYIO_SVIDEO:
393 *(u_int *)data = dc->dc_blanked ?
394 WSDISPLAYIO_VIDEO_OFF : WSDISPLAYIO_VIDEO_ON;
395 return (0);
396
397 case WSDISPLAYIO_GCURPOS:
398 return (*tgar->tgar_get_curpos)(dc,
399 (struct wsdisplay_curpos *)data);
400
401 case WSDISPLAYIO_SCURPOS:
402 return (*tgar->tgar_set_curpos)(dc,
403 (struct wsdisplay_curpos *)data);
404
405 case WSDISPLAYIO_GCURMAX:
406 return (*tgar->tgar_get_curmax)(dc,
407 (struct wsdisplay_curpos *)data);
408
409 case WSDISPLAYIO_GCURSOR:
410 return (*tgar->tgar_get_cursor)(dc,
411 (struct wsdisplay_cursor *)data);
412
413 case WSDISPLAYIO_SCURSOR:
414 return (*tgar->tgar_set_cursor)(dc,
415 (struct wsdisplay_cursor *)data);
416 }
417 return (-1);
418 }
419
420 int
421 tga_mmap(v, offset, prot)
422 void *v;
423 off_t offset;
424 int prot;
425 {
426
427 /* XXX NEW MAPPING CODE... */
428
429 #ifdef __alpha__
430 struct tga_softc *sc = v;
431
432 if (offset > sc->sc_dc->dc_tgaconf->tgac_cspace_size)
433 return -1;
434 return alpha_btop(sc->sc_dc->dc_paddr + offset);
435 #else
436 return (-1);
437 #endif
438 }
439
440 int
441 tga_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
442 void *v;
443 const struct wsscreen_descr *type;
444 void **cookiep;
445 int *curxp, *curyp;
446 long *attrp;
447 {
448 struct tga_softc *sc = v;
449 long defattr;
450
451 if (sc->nscreens > 0)
452 return (ENOMEM);
453
454 *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */
455 *curxp = 0;
456 *curyp = 0;
457 rcons_alloc_attr(&sc->sc_dc->dc_rcons, 0, 0, 0, &defattr);
458 *attrp = defattr;
459 sc->nscreens++;
460 return (0);
461 }
462
463 void
464 tga_free_screen(v, cookie)
465 void *v;
466 void *cookie;
467 {
468 struct tga_softc *sc = v;
469
470 if (sc->sc_dc == &tga_console_dc)
471 panic("tga_free_screen: console");
472
473 sc->nscreens--;
474 }
475
476 void
477 tga_show_screen(v, cookie)
478 void *v;
479 void *cookie;
480 {
481 }
482
483 static int
484 tga_load_font(v, cookie, first, num, stride, data)
485 void *v;
486 void *cookie;
487 int first, num, stride;
488 void *data;
489 {
490 return (EINVAL);
491 }
492
493 int
494 tga_cnattach(iot, memt, pc, bus, device, function)
495 bus_space_tag_t iot, memt;
496 pci_chipset_tag_t pc;
497 int bus, device, function;
498 {
499 struct tga_devconfig *dcp = &tga_console_dc;
500 long defattr;
501
502 tga_getdevconfig(memt, pc,
503 pci_make_tag(pc, bus, device, function), dcp);
504
505 /* sanity checks */
506 if (dcp->dc_vaddr == NULL)
507 panic("tga_console(%d, %d): couldn't map memory space",
508 device, function);
509 if (dcp->dc_tgaconf == NULL)
510 panic("tga_console(%d, %d): unknown board configuration",
511 device, function);
512
513 /*
514 * Initialize the RAMDAC but DO NOT allocate any private storage.
515 * Initialization includes disabling cursor, setting a sane
516 * colormap, etc. It will be reinitialized in tgaattach().
517 */
518 (*dcp->dc_tgaconf->tgac_ramdac->tgar_init)(dcp, 0);
519
520 rcons_alloc_attr(&dcp->dc_rcons, 0, 0, 0, &defattr);
521
522 wsdisplay_cnattach(&tga_stdscreen, &dcp->dc_rcons,
523 0, 0, defattr);
524
525 return(0);
526 }
527
528 /*
529 * Functions to blank and unblank the display.
530 */
531 void
532 tga_blank(dc)
533 struct tga_devconfig *dc;
534 {
535
536 if (!dc->dc_blanked) {
537 dc->dc_blanked = 1;
538 dc->dc_regs[TGA_REG_VVVR] |= VVR_BLANK; /* XXX */
539 }
540 }
541
542 void
543 tga_unblank(dc)
544 struct tga_devconfig *dc;
545 {
546
547 if (dc->dc_blanked) {
548 dc->dc_blanked = 0;
549 dc->dc_regs[TGA_REG_VVVR] &= ~VVR_BLANK; /* XXX */
550 }
551 }
552
553 /*
554 * Functions to manipulate the built-in cursor handing hardware.
555 */
556 int
557 tga_builtin_set_cursor(dc, cursorp)
558 struct tga_devconfig *dc;
559 struct wsdisplay_cursor *cursorp;
560 {
561 int count, error, v;
562
563 v = cursorp->which;
564 if (v & WSDISPLAY_CURSOR_DOCMAP) {
565 error = (*dc->dc_tgaconf->tgac_ramdac->tgar_check_curcmap)(dc,
566 cursorp);
567 if (error)
568 return (error);
569 }
570 if (v & WSDISPLAY_CURSOR_DOSHAPE) {
571 if ((u_int)cursorp->size.x != 64 ||
572 (u_int)cursorp->size.y > 64)
573 return (EINVAL);
574 /* The cursor is 2 bits deep, and there is no mask */
575 count = (cursorp->size.y * 64 * 2) / NBBY;
576 #if defined(UVM)
577 if (!uvm_useracc(cursorp->image, count, B_READ))
578 return (EFAULT);
579 #else
580 if (!useracc(cursorp->image, count, B_READ))
581 return (EFAULT);
582 #endif
583 }
584 if (v & WSDISPLAY_CURSOR_DOHOT) /* not supported */
585 return EINVAL;
586
587 /* parameters are OK; do it */
588 if (v & WSDISPLAY_CURSOR_DOCUR) {
589 if (cursorp->enable)
590 dc->dc_regs[TGA_REG_VVVR] |= 0x04; /* XXX */
591 else
592 dc->dc_regs[TGA_REG_VVVR] &= ~0x04; /* XXX */
593 }
594 if (v & WSDISPLAY_CURSOR_DOPOS) {
595 dc->dc_regs[TGA_REG_CXYR] = ((cursorp->pos.y & 0xfff) << 12) |
596 (cursorp->pos.x & 0xfff);
597 }
598 if (v & WSDISPLAY_CURSOR_DOCMAP) {
599 /* can't fail. */
600 (*dc->dc_tgaconf->tgac_ramdac->tgar_set_curcmap)(dc, cursorp);
601 }
602 if (v & WSDISPLAY_CURSOR_DOSHAPE) {
603 count = ((64 * 2) / NBBY) * cursorp->size.y;
604 dc->dc_regs[TGA_REG_CCBR] =
605 (dc->dc_regs[TGA_REG_CCBR] & ~0xfc00) |
606 (cursorp->size.y << 10);
607 copyin(cursorp->image, (char *)(dc->dc_vaddr +
608 (dc->dc_regs[TGA_REG_CCBR] & 0x3ff)),
609 count); /* can't fail. */
610 }
611 return (0);
612 }
613
614 int
615 tga_builtin_get_cursor(dc, cursorp)
616 struct tga_devconfig *dc;
617 struct wsdisplay_cursor *cursorp;
618 {
619 int count, error;
620
621 cursorp->which = WSDISPLAY_CURSOR_DOALL &
622 ~(WSDISPLAY_CURSOR_DOHOT | WSDISPLAY_CURSOR_DOCMAP);
623 cursorp->enable = (dc->dc_regs[TGA_REG_VVVR] & 0x04) != 0;
624 cursorp->pos.x = dc->dc_regs[TGA_REG_CXYR] & 0xfff;
625 cursorp->pos.y = (dc->dc_regs[TGA_REG_CXYR] >> 12) & 0xfff;
626 cursorp->size.x = 64;
627 cursorp->size.y = (dc->dc_regs[TGA_REG_CCBR] >> 10) & 0x3f;
628
629 if (cursorp->image != NULL) {
630 count = (cursorp->size.y * 64 * 2) / NBBY;
631 error = copyout((char *)(dc->dc_vaddr +
632 (dc->dc_regs[TGA_REG_CCBR] & 0x3ff)),
633 cursorp->image, count);
634 if (error)
635 return (error);
636 /* No mask */
637 }
638 error = (*dc->dc_tgaconf->tgac_ramdac->tgar_get_curcmap)(dc, cursorp);
639 return (error);
640 }
641
642 int
643 tga_builtin_set_curpos(dc, curposp)
644 struct tga_devconfig *dc;
645 struct wsdisplay_curpos *curposp;
646 {
647
648 dc->dc_regs[TGA_REG_CXYR] =
649 ((curposp->y & 0xfff) << 12) | (curposp->x & 0xfff);
650 return (0);
651 }
652
653 int
654 tga_builtin_get_curpos(dc, curposp)
655 struct tga_devconfig *dc;
656 struct wsdisplay_curpos *curposp;
657 {
658
659 curposp->x = dc->dc_regs[TGA_REG_CXYR] & 0xfff;
660 curposp->y = (dc->dc_regs[TGA_REG_CXYR] >> 12) & 0xfff;
661 return (0);
662 }
663
664 int
665 tga_builtin_get_curmax(dc, curposp)
666 struct tga_devconfig *dc;
667 struct wsdisplay_curpos *curposp;
668 {
669
670 curposp->x = curposp->y = 64;
671 return (0);
672 }
673