| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: igsfb.c,v 1.53 2016/07/14 04:00:45 msaitoh Exp $ */ | | 1 | /* $NetBSD: igsfb.c,v 1.54 2017/01/25 15:51:07 jakllsch Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2002, 2003 Valeriy E. Ushakov | | 4 | * Copyright (c) 2002, 2003 Valeriy E. Ushakov |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | */ | | 28 | */ |
29 | | | 29 | |
30 | /* | | 30 | /* |
31 | * Integraphics Systems IGA 168x and CyberPro series. | | 31 | * Integraphics Systems IGA 168x and CyberPro series. |
32 | */ | | 32 | */ |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.53 2016/07/14 04:00:45 msaitoh Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.54 2017/01/25 15:51:07 jakllsch Exp $"); |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/kernel.h> | | 38 | #include <sys/kernel.h> |
39 | #include <sys/device.h> | | 39 | #include <sys/device.h> |
40 | #include <sys/malloc.h> | | 40 | #include <sys/malloc.h> |
41 | #include <sys/ioctl.h> | | 41 | #include <sys/ioctl.h> |
42 | | | 42 | |
43 | #include <sys/bus.h> | | 43 | #include <sys/bus.h> |
44 | | | 44 | |
45 | #include <dev/wscons/wsdisplayvar.h> | | 45 | #include <dev/wscons/wsdisplayvar.h> |
46 | #include <dev/wscons/wsconsio.h> | | 46 | #include <dev/wscons/wsconsio.h> |
47 | #include <dev/wsfont/wsfont.h> | | 47 | #include <dev/wsfont/wsfont.h> |
| @@ -379,30 +379,31 @@ igsfb_init_cmap(struct igsfb_devconfig * | | | @@ -379,30 +379,31 @@ igsfb_init_cmap(struct igsfb_devconfig * |
379 | | | 379 | |
380 | p = rasops_cmap; /* "ANSI" color map */ | | 380 | p = rasops_cmap; /* "ANSI" color map */ |
381 | | | 381 | |
382 | /* init software copy */ | | 382 | /* init software copy */ |
383 | for (i = 0; i < IGS_CMAP_SIZE; ++i, p += 3) { | | 383 | for (i = 0; i < IGS_CMAP_SIZE; ++i, p += 3) { |
384 | dc->dc_cmap.r[i] = p[0]; | | 384 | dc->dc_cmap.r[i] = p[0]; |
385 | dc->dc_cmap.g[i] = p[1]; | | 385 | dc->dc_cmap.g[i] = p[1]; |
386 | dc->dc_cmap.b[i] = p[2]; | | 386 | dc->dc_cmap.b[i] = p[2]; |
387 | } | | 387 | } |
388 | | | 388 | |
389 | /* propagate to the device */ | | 389 | /* propagate to the device */ |
390 | igsfb_update_cmap(dc, 0, IGS_CMAP_SIZE); | | 390 | igsfb_update_cmap(dc, 0, IGS_CMAP_SIZE); |
391 | | | 391 | |
392 | /* set overscan color (XXX: use defattr's background?) */ | | 392 | /* set overscan color */ |
393 | igs_ext_write(iot, ioh, IGS_EXT_OVERSCAN_RED, 0); | | 393 | p = &rasops_cmap[WSDISPLAY_BORDER_COLOR * 3]; |
394 | igs_ext_write(iot, ioh, IGS_EXT_OVERSCAN_GREEN, 0); | | 394 | igs_ext_write(iot, ioh, IGS_EXT_OVERSCAN_RED, p[0]); |
395 | igs_ext_write(iot, ioh, IGS_EXT_OVERSCAN_BLUE, 0); | | 395 | igs_ext_write(iot, ioh, IGS_EXT_OVERSCAN_GREEN, p[1]); |
| | | 396 | igs_ext_write(iot, ioh, IGS_EXT_OVERSCAN_BLUE, p[2]); |
396 | } | | 397 | } |
397 | | | 398 | |
398 | | | 399 | |
399 | static void | | 400 | static void |
400 | igsfb_init_wsdisplay(void *cookie, struct vcons_screen *scr, int existing, | | 401 | igsfb_init_wsdisplay(void *cookie, struct vcons_screen *scr, int existing, |
401 | long *defattr) | | 402 | long *defattr) |
402 | { | | 403 | { |
403 | struct igsfb_devconfig *dc = cookie; | | 404 | struct igsfb_devconfig *dc = cookie; |
404 | struct rasops_info *ri = &scr->scr_ri; | | 405 | struct rasops_info *ri = &scr->scr_ri; |
405 | int wsfcookie; | | 406 | int wsfcookie; |
406 | | | 407 | |
407 | if (scr == &dc->dc_console) { | | 408 | if (scr == &dc->dc_console) { |
408 | if (ri->ri_flg == 0) { | | 409 | if (ri->ri_flg == 0) { |