Deleted Added
full compact
vesa.c (108284) vesa.c (109623)
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/i386/isa/vesa.c 108284 2002-12-26 13:20:58Z davidxu $
26 * $FreeBSD: head/sys/i386/isa/vesa.c 109623 2003-01-21 08:56:16Z alfred $
27 */
28
29#include "opt_vga.h"
30#include "opt_vesa.h"
31
32#ifndef VGA_NO_MODE_CHANGE
33
34#include <sys/param.h>

--- 654 unchanged lines hidden (view full) ---

689 continue;
690 }
691#endif
692
693 /* expand the array if necessary */
694 if (modes >= vesa_vmode_max) {
695 vesa_vmode_max += MODE_TABLE_DELTA;
696 p = malloc(sizeof(*vesa_vmode)*(vesa_vmode_max + 1),
27 */
28
29#include "opt_vga.h"
30#include "opt_vesa.h"
31
32#ifndef VGA_NO_MODE_CHANGE
33
34#include <sys/param.h>

--- 654 unchanged lines hidden (view full) ---

689 continue;
690 }
691#endif
692
693 /* expand the array if necessary */
694 if (modes >= vesa_vmode_max) {
695 vesa_vmode_max += MODE_TABLE_DELTA;
696 p = malloc(sizeof(*vesa_vmode)*(vesa_vmode_max + 1),
697 M_DEVBUF, M_WAITOK);
697 M_DEVBUF, 0);
698#if VESA_DEBUG > 1
699 printf("vesa_bios_init(): modes:%d, vesa_mode_max:%d\n",
700 modes, vesa_vmode_max);
701#endif
702 if (modes > 0) {
703 bcopy(vesa_vmode, p, sizeof(*vesa_vmode)*modes);
704 free(vesa_vmode, M_DEVBUF);
705 }

--- 630 unchanged lines hidden (view full) ---

1336 return 1;
1337 if (!(vesa_adp_info->v_flags & V_DAC8) || !VESA_MODE(adp->va_mode))
1338 return 1;
1339
1340 bits = vesa_bios_get_dac();
1341 if (bits <= 6)
1342 return 1;
1343
698#if VESA_DEBUG > 1
699 printf("vesa_bios_init(): modes:%d, vesa_mode_max:%d\n",
700 modes, vesa_vmode_max);
701#endif
702 if (modes > 0) {
703 bcopy(vesa_vmode, p, sizeof(*vesa_vmode)*modes);
704 free(vesa_vmode, M_DEVBUF);
705 }

--- 630 unchanged lines hidden (view full) ---

1336 return 1;
1337 if (!(vesa_adp_info->v_flags & V_DAC8) || !VESA_MODE(adp->va_mode))
1338 return 1;
1339
1340 bits = vesa_bios_get_dac();
1341 if (bits <= 6)
1342 return 1;
1343
1344 r = malloc(count*3, M_DEVBUF, M_WAITOK);
1344 r = malloc(count*3, M_DEVBUF, 0);
1345 g = r + count;
1346 b = g + count;
1347 error = vesa_bios_save_palette2(base, count, r, g, b, bits);
1348 if (error == 0) {
1349 copyout(r, red, count);
1350 copyout(g, green, count);
1351 copyout(b, blue, count);
1352 if (trans != NULL) {

--- 20 unchanged lines hidden (view full) ---

1373 int error;
1374
1375 if ((base < 0) || (base >= 256) || (base + count > 256))
1376 return 1;
1377 if (!(vesa_adp_info->v_flags & V_DAC8) || !VESA_MODE(adp->va_mode)
1378 || ((bits = vesa_bios_set_dac(8)) <= 6))
1379 return 1;
1380
1345 g = r + count;
1346 b = g + count;
1347 error = vesa_bios_save_palette2(base, count, r, g, b, bits);
1348 if (error == 0) {
1349 copyout(r, red, count);
1350 copyout(g, green, count);
1351 copyout(b, blue, count);
1352 if (trans != NULL) {

--- 20 unchanged lines hidden (view full) ---

1373 int error;
1374
1375 if ((base < 0) || (base >= 256) || (base + count > 256))
1376 return 1;
1377 if (!(vesa_adp_info->v_flags & V_DAC8) || !VESA_MODE(adp->va_mode)
1378 || ((bits = vesa_bios_set_dac(8)) <= 6))
1379 return 1;
1380
1381 r = malloc(count*3, M_DEVBUF, M_WAITOK);
1381 r = malloc(count*3, M_DEVBUF, 0);
1382 g = r + count;
1383 b = g + count;
1384 copyin(red, r, count);
1385 copyin(green, g, count);
1386 copyin(blue, b, count);
1387
1388 error = vesa_bios_load_palette2(base, count, r, g, b, bits);
1389 free(r, M_DEVBUF);

--- 264 unchanged lines hidden ---
1382 g = r + count;
1383 b = g + count;
1384 copyin(red, r, count);
1385 copyin(green, g, count);
1386 copyin(blue, b, count);
1387
1388 error = vesa_bios_load_palette2(base, count, r, g, b, bits);
1389 free(r, M_DEVBUF);

--- 264 unchanged lines hidden ---