bt463.c revision 1.3 1 /* $NetBSD: bt463.c,v 1.3 2000/06/28 17:12:55 mrg Exp $ */
2
3 /*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the NetBSD
22 * Foundation, Inc. and its contributors.
23 * 4. Neither the name of The NetBSD Foundation nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40 /*
41 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
42 * All rights reserved.
43 *
44 * Author: Chris G. Demetriou
45 *
46 * Permission to use, copy, modify and distribute this software and
47 * its documentation is hereby granted, provided that both the copyright
48 * notice and this permission notice appear in all copies of the
49 * software, derivative works or modified versions, and any portions
50 * thereof, and that both notices appear in supporting documentation.
51 *
52 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
53 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
54 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
55 *
56 * Carnegie Mellon requests users of this software to return to
57 *
58 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
59 * School of Computer Science
60 * Carnegie Mellon University
61 * Pittsburgh PA 15213-3890
62 *
63 * any improvements or extensions that they make and grant Carnegie the
64 * rights to redistribute these changes.
65 */
66
67 /* This code was derived from and originally located in sys/dev/pci/
68 * NetBSD: tga_bt463.c,v 1.5 2000/03/04 10:27:59 elric Exp
69 */
70
71 #include <sys/param.h>
72 #include <sys/systm.h>
73 #include <sys/device.h>
74 #include <sys/buf.h>
75 #include <sys/kernel.h>
76 #include <sys/malloc.h>
77
78 #include <uvm/uvm_extern.h>
79
80 #include <dev/pci/pcivar.h>
81 #include <dev/pci/tgareg.h>
82 #include <dev/pci/tgavar.h>
83 #include <dev/ic/bt463reg.h>
84 #include <dev/ic/bt463var.h>
85
86 #include <dev/wscons/wsconsio.h>
87
88 /*
89 * Functions exported via the RAMDAC configuration table.
90 */
91 void bt463_init __P((struct ramdac_cookie *));
92 int bt463_set_cmap __P((struct ramdac_cookie *,
93 struct wsdisplay_cmap *));
94 int bt463_get_cmap __P((struct ramdac_cookie *,
95 struct wsdisplay_cmap *));
96 int bt463_set_cursor __P((struct ramdac_cookie *,
97 struct wsdisplay_cursor *));
98 int bt463_get_cursor __P((struct ramdac_cookie *,
99 struct wsdisplay_cursor *));
100 int bt463_set_curpos __P((struct ramdac_cookie *,
101 struct wsdisplay_curpos *));
102 int bt463_get_curpos __P((struct ramdac_cookie *,
103 struct wsdisplay_curpos *));
104 int bt463_get_curmax __P((struct ramdac_cookie *,
105 struct wsdisplay_curpos *));
106 int bt463_check_curcmap __P((struct ramdac_cookie *,
107 struct wsdisplay_cursor *cursorp));
108 void bt463_set_curcmap __P((struct ramdac_cookie *,
109 struct wsdisplay_cursor *cursorp));
110 int bt463_get_curcmap __P((struct ramdac_cookie *,
111 struct wsdisplay_cursor *cursorp));
112
113 #ifdef BT463_DEBUG
114 int bt463_store __P((void *));
115 int bt463_debug __P((void *));
116 int bt463_readback __P((void *));
117 void bt463_copyback __P((void *));
118 #endif
119
120 struct ramdac_funcs bt463_funcsstruct = {
121 "Bt463",
122 bt463_register,
123 bt463_init,
124 bt463_set_cmap,
125 bt463_get_cmap,
126 bt463_set_cursor,
127 bt463_get_cursor,
128 bt463_set_curpos,
129 bt463_get_curpos,
130 bt463_get_curmax,
131 bt463_check_curcmap,
132 bt463_set_curcmap,
133 bt463_get_curcmap,
134 };
135
136 /*
137 * Private data.
138 */
139 struct bt463data {
140 void *cookie; /* This is what is passed
141 * around, and is probably
142 * struct tga_devconfig *
143 */
144
145 int (*ramdac_sched_update) __P((void *, void (*)(void *)));
146 void (*ramdac_wr) __P((void *, u_int, u_int8_t));
147 u_int8_t (*ramdac_rd) __P((void *, u_int));
148
149 int changed; /* what changed; see below */
150 char curcmap_r[2]; /* cursor colormap */
151 char curcmap_g[2];
152 char curcmap_b[2];
153 char cmap_r[BT463_NCMAP_ENTRIES]; /* colormap */
154 char cmap_g[BT463_NCMAP_ENTRIES];
155 char cmap_b[BT463_NCMAP_ENTRIES];
156 int window_type[16]; /* 16 24-bit window type table entries */
157 };
158
159 /* When we're doing console initialization, there's no
160 * way to get our cookie back to the video card's softc
161 * before we call sched_update. So we stash it here,
162 * and bt463_update will look for it here first.
163 */
164 static struct bt463data *console_data;
165
166
167 #define BTWREG(data, addr, val) do { bt463_wraddr((data), (addr)); \
168 (data)->ramdac_wr((data)->cookie, BT463_REG_IREG_DATA, (val)); } while (0)
169 #define BTWNREG(data, val) (data)->ramdac_wr((data)->cookie, \
170 BT463_REG_IREG_DATA, (val))
171 #define BTRREG(data, addr) (bt463_wraddr((data), (addr)), \
172 (data)->ramdac_rd((data)->cookie, BT463_REG_IREG_DATA))
173 #define BTRNREG(data) ((data)->ramdac_rd((data)->cookie, BT463_REG_IREG_DATA))
174
175 #define DATA_CURCMAP_CHANGED 0x01 /* cursor colormap changed */
176 #define DATA_CMAP_CHANGED 0x02 /* colormap changed */
177 #define DATA_WTYPE_CHANGED 0x04 /* window type table changed */
178 #define DATA_ALL_CHANGED 0x07
179
180 /*
181 * Internal functions.
182 */
183 inline void bt463_wraddr __P((struct bt463data *, u_int16_t));
184
185 void bt463_update __P((void *));
186
187
188 /*****************************************************************************/
189
190 /*
191 * Functions exported via the RAMDAC configuration table.
192 */
193
194 struct ramdac_funcs *
195 bt463_funcs(void)
196 {
197 return &bt463_funcsstruct;
198 }
199
200 struct ramdac_cookie *
201 bt463_register(v, sched_update, wr, rd)
202 void *v;
203 int (*sched_update)(void *, void (*)(void *));
204 void (*wr)(void *, u_int, u_int8_t);
205 u_int8_t (*rd)(void *, u_int);
206 {
207 struct bt463data *data;
208 /*
209 * XXX -- comment out of date. rcd.
210 * If we should allocate a new private info struct, do so.
211 * Otherwise, use the one we have (if it's there), or
212 * use the temporary one on the stack.
213 */
214 data = malloc(sizeof *data, M_DEVBUF, M_WAITOK);
215 /* XXX -- if !data */
216 data->cookie = v;
217 data->ramdac_sched_update = sched_update;
218 data->ramdac_wr = wr;
219 data->ramdac_rd = rd;
220 return (struct ramdac_cookie *)data;
221 }
222
223 /*
224 * This function exists solely to provide a means to init
225 * the RAMDAC without first registering. It is useful for
226 * initializing the console early on.
227 */
228 void
229 bt463_cninit(v, sched_update, wr, rd)
230 void *v;
231 int (*sched_update)(void *, void (*)(void *));
232 void (*wr)(void *, u_int, u_int8_t);
233 u_int8_t (*rd)(void *, u_int);
234 {
235 struct bt463data tmp, *data = &tmp;
236 data->cookie = v;
237 data->ramdac_sched_update = sched_update;
238 data->ramdac_wr = wr;
239 data->ramdac_rd = rd;
240 /* Set up console_data so that when bt463_update is called back,
241 * it can use the right information.
242 */
243 console_data = data;
244 bt463_init((struct ramdac_cookie *)data);
245 console_data = NULL;
246 }
247
248 void
249 bt463_init(rc)
250 struct ramdac_cookie *rc;
251 {
252 struct bt463data *data = (struct bt463data *)rc;
253
254 int i;
255
256 /*
257 * Init the BT463 for normal operation.
258 */
259
260
261 /*
262 * Setup:
263 * reg 0: 4:1 multiplexing, 25/75 blink.
264 * reg 1: Overlay mapping: mapped to common palette,
265 * 14 window type entries, 24-plane configuration mode,
266 * 4 overlay planes, underlays disabled, no cursor.
267 * reg 2: sync-on-green enabled, pedestal enabled.
268 */
269
270 BTWREG(data, BT463_IREG_COMMAND_0, 0x40);
271 BTWREG(data, BT463_IREG_COMMAND_1, 0x48);
272 BTWREG(data, BT463_IREG_COMMAND_2, 0xC0);
273
274 /*
275 * Initialize the read mask.
276 */
277 bt463_wraddr(data, BT463_IREG_READ_MASK_P0_P7);
278 for (i = 0; i < 4; i++)
279 BTWNREG(data, 0xff);
280
281 /*
282 * Initialize the blink mask.
283 */
284 bt463_wraddr(data, BT463_IREG_BLINK_MASK_P0_P7);
285 for (i = 0; i < 4; i++)
286 BTWNREG(data, 0);
287
288
289 /*
290 * Clear test register
291 */
292 BTWREG(data, BT463_IREG_TEST, 0);
293
294 /*
295 * Initalize the RAMDAC info struct to hold all of our
296 * data, and fill it in.
297 */
298 data->changed = DATA_ALL_CHANGED;
299
300 /* initial cursor colormap: 0 is black, 1 is white */
301 data->curcmap_r[0] = data->curcmap_g[0] = data->curcmap_b[0] = 0;
302 data->curcmap_r[1] = data->curcmap_g[1] = data->curcmap_b[1] = 0xff;
303
304 /* Initial colormap: 0 is black, everything else is white */
305 data->cmap_r[0] = data->cmap_g[0] = data->cmap_b[0] = 0;
306 for (i = 1; i < 256; i++)
307 data->cmap_r[i] = data->cmap_g[i] = data->cmap_b[i] = 255;
308
309
310 /* Initialize the window type table:
311 *
312 * Entry 0: 24-plane truecolor, overlays enabled, bypassed.
313 *
314 * Lookup table bypass: yes ( 1 << 23 & 0x800000) 800000
315 * Colormap address: 0x000 (0x000 << 17 & 0x7e0000) 0
316 * Overlay mask: 0xf ( 0xf << 13 & 0x01e000) 1e000
317 * Overlay location: P<27:24> ( 0 << 12 & 0x001000) 0
318 * Display mode: Truecolor ( 0 << 9 & 0x000e00) 000
319 * Number of planes: 8 ( 8 << 5 & 0x0001e0) 100
320 * Plane shift: 0 ( 0 << 0 & 0x00001f) 0
321 * --------
322 * 0x81e100
323 */
324 data->window_type[0] = 0x81e100;
325
326 /* Entry 1: 8-plane pseudocolor in the bottom 8 bits,
327 * overlays enabled, colormap starting at 0.
328 *
329 * Lookup table bypass: no ( 0 << 23 & 0x800000) 0
330 * Colormap address: 0x000 (0x000 << 17 & 0x7e0000) 0
331 * Overlay mask: 0xf ( 0xf << 13 & 0x01e000) 0x1e000
332 * Overlay location: P<27:24> ( 0 << 12 & 0x001000) 0
333 * Display mode: Pseudocolor ( 1 << 9 & 0x000e00) 0x200
334 * Number of planes: 8 ( 8 << 5 & 0x0001e0) 0x100
335 * Plane shift: 16 ( 0x10 << 0 & 0x00001f) 10
336 * --------
337 * 0x01e310
338 */
339 data->window_type[1] = 0x01e310;
340
341 /* The colormap interface to the world only supports one colormap,
342 * so having an entry for the 'alternate' colormap in the bt463
343 * probably isn't useful.
344 */
345
346 /* Fill the remaining table entries with clones of entry 0 until we
347 * figure out a better use for them.
348 */
349
350 for (i = 2; i < BT463_NWTYPE_ENTRIES; i++) {
351 data->window_type[i] = 0x81e100;
352 }
353
354 data->ramdac_sched_update(data->cookie, bt463_update);
355
356 }
357
358 int
359 bt463_set_cmap(rc, cmapp)
360 struct ramdac_cookie *rc;
361 struct wsdisplay_cmap *cmapp;
362 {
363 struct bt463data *data = (struct bt463data *)rc;
364 int count, index, s;
365
366 if ((u_int)cmapp->index >= BT463_NCMAP_ENTRIES ||
367 ((u_int)cmapp->index + (u_int)cmapp->count) > BT463_NCMAP_ENTRIES)
368 return (EINVAL);
369 if (!uvm_useracc(cmapp->red, cmapp->count, B_READ) ||
370 !uvm_useracc(cmapp->green, cmapp->count, B_READ) ||
371 !uvm_useracc(cmapp->blue, cmapp->count, B_READ))
372 return (EFAULT);
373
374 s = spltty();
375
376 index = cmapp->index;
377 count = cmapp->count;
378 copyin(cmapp->red, &data->cmap_r[index], count);
379 copyin(cmapp->green, &data->cmap_g[index], count);
380 copyin(cmapp->blue, &data->cmap_b[index], count);
381
382 data->changed |= DATA_CMAP_CHANGED;
383
384 data->ramdac_sched_update(data->cookie, bt463_update);
385 splx(s);
386
387 return (0);
388 }
389
390 int
391 bt463_get_cmap(rc, cmapp)
392 struct ramdac_cookie *rc;
393 struct wsdisplay_cmap *cmapp;
394 {
395 struct bt463data *data = (struct bt463data *)rc;
396 int error, count, index;
397
398 if ((u_int)cmapp->index >= BT463_NCMAP_ENTRIES ||
399 ((u_int)cmapp->index + (u_int)cmapp->count) > BT463_NCMAP_ENTRIES)
400 return (EINVAL);
401
402 count = cmapp->count;
403 index = cmapp->index;
404
405 error = copyout(&data->cmap_r[index], cmapp->red, count);
406 if (error)
407 return (error);
408 error = copyout(&data->cmap_g[index], cmapp->green, count);
409 if (error)
410 return (error);
411 error = copyout(&data->cmap_b[index], cmapp->blue, count);
412 return (error);
413 }
414
415 int
416 bt463_check_curcmap(rc, cursorp)
417 struct ramdac_cookie *rc;
418 struct wsdisplay_cursor *cursorp;
419 {
420 int count;
421
422 if ((u_int)cursorp->cmap.index > 2 ||
423 ((u_int)cursorp->cmap.index +
424 (u_int)cursorp->cmap.count) > 2)
425 return (EINVAL);
426 count = cursorp->cmap.count;
427 if (!uvm_useracc(cursorp->cmap.red, count, B_READ) ||
428 !uvm_useracc(cursorp->cmap.green, count, B_READ) ||
429 !uvm_useracc(cursorp->cmap.blue, count, B_READ))
430 return (EFAULT);
431 return (0);
432 }
433
434 void
435 bt463_set_curcmap(rc, cursorp)
436 struct ramdac_cookie *rc;
437 struct wsdisplay_cursor *cursorp;
438 {
439 struct bt463data *data = (struct bt463data *)rc;
440 int count, index;
441
442 /* can't fail; parameters have already been checked. */
443 count = cursorp->cmap.count;
444 index = cursorp->cmap.index;
445 copyin(cursorp->cmap.red, &data->curcmap_r[index], count);
446 copyin(cursorp->cmap.green, &data->curcmap_g[index], count);
447 copyin(cursorp->cmap.blue, &data->curcmap_b[index], count);
448 data->changed |= DATA_CURCMAP_CHANGED;
449 data->ramdac_sched_update(data->cookie, bt463_update);
450 }
451
452 int
453 bt463_get_curcmap(rc, cursorp)
454 struct ramdac_cookie *rc;
455 struct wsdisplay_cursor *cursorp;
456 {
457 struct bt463data *data = (struct bt463data *)rc;
458 int error;
459
460 cursorp->cmap.index = 0; /* DOCMAP */
461 cursorp->cmap.count = 2;
462 if (cursorp->cmap.red != NULL) {
463 error = copyout(data->curcmap_r, cursorp->cmap.red, 2);
464 if (error)
465 return (error);
466 }
467 if (cursorp->cmap.green != NULL) {
468 error = copyout(data->curcmap_g, cursorp->cmap.green, 2);
469 if (error)
470 return (error);
471 }
472 if (cursorp->cmap.blue != NULL) {
473 error = copyout(data->curcmap_b, cursorp->cmap.blue, 2);
474 if (error)
475 return (error);
476 }
477 return (0);
478 }
479
480
481 /*****************************************************************************/
482
483 /*
484 * Internal functions.
485 */
486
487 #ifdef BT463_DEBUG
488 int bt463_store(void *v)
489 {
490 struct bt463data *data = (struct bt463data *)v;
491
492 data->changed = DATA_ALL_CHANGED;
493 data->ramdac_sched_update(data->cookie, bt463_update);
494 printf("Scheduled bt463 store\n");
495
496 return 0;
497 }
498
499
500 int bt463_readback(void *v)
501 {
502 struct bt463data *data = (struct bt463data *)v;
503
504 data->ramdac_sched_update(data->cookie, bt463_copyback);
505 printf("Scheduled bt463 copyback\n");
506 return 0;
507 }
508
509 int
510 bt463_debug(v)
511 void *v;
512 {
513 struct bt463data *data = (struct bt463data *)v;
514 int i;
515 u_int8_t val;
516
517 printf("BT463 main regs:\n");
518 for (i = 0x200; i < 0x20F; i ++) {
519 val = BTRREG(data, i);
520 printf(" $%04x %02x\n", i, val);
521 }
522
523 printf("BT463 revision register:\n");
524 val = BTRREG(data, 0x220);
525 printf(" $%04x %02x\n", 0x220, val);
526
527 printf("BT463 window type table (from softc):\n");
528
529 for (i = 0; i < BT463_NWTYPE_ENTRIES; i++) {
530 printf("%02x %06x\n", i, data->window_type[i]);
531 }
532
533 return 0;
534 }
535
536 void
537 bt463_copyback(p)
538 void *p;
539 {
540 struct bt463data *data = (struct bt463data *)p;
541 int i;
542
543 for (i = 0; i < BT463_NWTYPE_ENTRIES; i++) {
544 bt463_wraddr(data, BT463_IREG_WINDOW_TYPE_TABLE + i);
545 data->window_type[i] = (BTRNREG(data) & 0xff); /* B0-7 */
546 data->window_type[i] |= (BTRNREG(data) & 0xff) << 8; /* B8-15 */
547 data->window_type[i] |= (BTRNREG(data) & 0xff) << 16; /* B16-23 */
548 }
549 }
550 #endif
551
552 inline void
553 bt463_wraddr(data, ireg)
554 struct bt463data *data;
555 u_int16_t ireg;
556 {
557 data->ramdac_wr(data->cookie, BT463_REG_ADDR_LOW, ireg & 0xff);
558 data->ramdac_wr(data->cookie, BT463_REG_ADDR_HIGH, (ireg >> 8) & 0xff);
559 }
560
561 void
562 bt463_update(p)
563 void *p;
564 {
565 struct bt463data *data = (struct bt463data *)p;
566 int i, v;
567
568 if (console_data != NULL) {
569 /* The cookie passed in from sched_update is incorrect. Use the
570 * right one.
571 */
572 data = console_data;
573 }
574
575 v = data->changed;
576
577 /* The Bt463 won't accept window type data except during a blanking
578 * interval, so we do this early in the interrupt.
579 * Blanking the screen might also be a good idea, but it can cause
580 * unpleasant flashing and is hard to do from this side of the
581 * ramdac interface.
582 */
583 if (v & DATA_WTYPE_CHANGED) {
584 /* spit out the window type data */
585 for (i = 0; i < BT463_NWTYPE_ENTRIES; i++) {
586 bt463_wraddr(data, BT463_IREG_WINDOW_TYPE_TABLE + i);
587 BTWNREG(data, (data->window_type[i]) & 0xff); /* B0-7 */
588 BTWNREG(data, (data->window_type[i] >> 8) & 0xff); /* B8-15 */
589 BTWNREG(data, (data->window_type[i] >> 16) & 0xff); /* B16-23 */
590 }
591 }
592
593 if (v & DATA_CURCMAP_CHANGED) {
594 bt463_wraddr(data, BT463_IREG_CURSOR_COLOR_0);
595 /* spit out the cursor data */
596 for (i = 0; i < 2; i++) {
597 BTWNREG(data, data->curcmap_r[i]);
598 BTWNREG(data, data->curcmap_g[i]);
599 BTWNREG(data, data->curcmap_b[i]);
600 }
601 }
602
603 if (v & DATA_CMAP_CHANGED) {
604 bt463_wraddr(data, BT463_IREG_CPALETTE_RAM);
605 /* spit out the colormap data */
606 for (i = 0; i < BT463_NCMAP_ENTRIES; i++) {
607 data->ramdac_wr(data->cookie, BT463_REG_CMAP_DATA,
608 data->cmap_r[i]);
609 data->ramdac_wr(data->cookie, BT463_REG_CMAP_DATA,
610 data->cmap_g[i]);
611 data->ramdac_wr(data->cookie, BT463_REG_CMAP_DATA,
612 data->cmap_b[i]);
613 }
614 }
615
616 data->changed = 0;
617 }
618
619 int bt463_set_cursor (rc, cur)
620 struct ramdac_cookie *rc;
621 struct wsdisplay_cursor *cur;
622 {
623 struct bt463data *data = (struct bt463data *)rc;
624 return tga_builtin_set_cursor(data->cookie, cur);
625 }
626
627 int bt463_get_cursor (rc, cur)
628 struct ramdac_cookie *rc;
629 struct wsdisplay_cursor *cur;
630 {
631 struct bt463data *data = (struct bt463data *)rc;
632 return tga_builtin_get_cursor(data->cookie, cur);
633 }
634
635 int bt463_set_curpos (rc, cur)
636 struct ramdac_cookie *rc;
637 struct wsdisplay_curpos *cur;
638 {
639 struct bt463data *data = (struct bt463data *)rc;
640 return tga_builtin_set_curpos(data->cookie, cur);
641 }
642
643 int bt463_get_curpos (rc, cur)
644 struct ramdac_cookie *rc;
645 struct wsdisplay_curpos *cur;
646 {
647 struct bt463data *data = (struct bt463data *)rc;
648 return tga_builtin_get_curpos(data->cookie, cur);
649 }
650
651 int bt463_get_curmax (rc, cur)
652 struct ramdac_cookie *rc;
653 struct wsdisplay_curpos *cur;
654 {
655 struct bt463data *data = (struct bt463data *)rc;
656 return tga_builtin_get_curmax(data->cookie, cur);
657 }
658