Deleted Added
full compact
scvidctl.c (132107) scvidctl.c (146736)
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The DragonFly Project
6 * by Sascha Wildner <saw@online.de>
7 *
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 * notice, this list of conditions and the following disclaimer as
10 * the first lines of this file unmodified.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the

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

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
27#include <sys/cdefs.h>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer as
13 * the first lines of this file unmodified.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the

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

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
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
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/syscons/scvidctl.c 132107 2004-07-13 16:06:19Z stefanf $");
31__FBSDID("$FreeBSD: head/sys/dev/syscons/scvidctl.c 146736 2005-05-29 08:43:44Z delphij $");
29
30#include "opt_syscons.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/conf.h>
35#include <sys/signalvar.h>
36#include <sys/tty.h>

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

362 if (xsize <= 0)
363 xsize = info.vi_width/8;
364 if (ysize <= 0)
365 ysize = info.vi_height/fontsize;
366
367 if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
368 return EINVAL;
369
32
33#include "opt_syscons.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/conf.h>
38#include <sys/signalvar.h>
39#include <sys/tty.h>

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

365 if (xsize <= 0)
366 xsize = info.vi_width/8;
367 if (ysize <= 0)
368 ysize = info.vi_height/fontsize;
369
370 if ((info.vi_width < xsize*8) || (info.vi_height < ysize*fontsize))
371 return EINVAL;
372
370 /* only 16 color, 4 plane modes are supported XXX */
371 if ((info.vi_depth != 4) || (info.vi_planes != 4))
372 return ENODEV;
373
374 /*
373 /*
375 * set_pixel_mode() currently does not support video modes whose
376 * memory size is larger than 64K. Because such modes require
377 * bank switching to access the entire screen. XXX
374 * We currently support the following graphic modes:
375 *
376 * - 4 bpp planar modes whose memory size does not exceed 64K
377 * - 15, 16, 24 and 32 bpp linear modes
378 */
378 */
379 if (info.vi_width*info.vi_height/8 > info.vi_window_size)
379
380 if (info.vi_mem_model == V_INFO_MM_PLANAR) {
381 if (info.vi_planes != 4)
382 return ENODEV;
383
384 /*
385 * A memory size >64K requires bank switching to access the entire
386 * screen. XXX
387 */
388
389 if (info.vi_width * info.vi_height / 8 > info.vi_window_size)
390 return ENODEV;
391 } else if (info.vi_mem_model == V_INFO_MM_DIRECT) {
392 if ((info.vi_depth != 15) && (info.vi_depth != 16) &&
393 (info.vi_depth != 24) && (info.vi_depth != 32))
394 return ENODEV;
395 } else
380 return ENODEV;
381
382 /* stop screen saver, etc */
383 s = spltty();
384 if ((error = sc_clean_up(scp))) {
385 splx(s);
386 return error;
387 }

--- 456 unchanged lines hidden ---
396 return ENODEV;
397
398 /* stop screen saver, etc */
399 s = spltty();
400 if ((error = sc_clean_up(scp))) {
401 splx(s);
402 return error;
403 }

--- 456 unchanged lines hidden ---