Deleted Added
full compact
scvidctl.c (83366) scvidctl.c (91140)
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
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 AUTHOR 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 <yokota@zodiac.mech.utsunomiya-u.ac.jp>
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 AUTHOR 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/dev/syscons/scvidctl.c 83366 2001-09-12 08:38:13Z julian $
26 * $FreeBSD: head/sys/dev/syscons/scvidctl.c 91140 2002-02-23 11:12:57Z tanimura $
27 */
28
29#include "opt_syscons.h"
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/conf.h>
34#include <sys/signalvar.h>
35#include <sys/tty.h>
36#include <sys/kernel.h>
37#include <sys/fbio.h>
38#include <sys/consio.h>
27 */
28
29#include "opt_syscons.h"
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/conf.h>
34#include <sys/signalvar.h>
35#include <sys/tty.h>
36#include <sys/kernel.h>
37#include <sys/fbio.h>
38#include <sys/consio.h>
39#include <sys/filedesc.h>
40#include <sys/lock.h>
41#include <sys/sx.h>
42#include <sys/mutex.h>
43#include <sys/proc.h>
39
40#include <dev/fb/fbreg.h>
41#include <dev/syscons/syscons.h>
42
43SET_DECLARE(scrndr_set, const sc_renderer_t);
44
45/* for compatibility with previous versions */
46/* 3.0-RELEASE used the following structure */

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

223 if (tp == NULL)
224 return 0;
225 DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n",
226 tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize));
227 if (tp->t_winsize.ws_col != scp->xsize
228 || tp->t_winsize.ws_row != scp->ysize) {
229 tp->t_winsize.ws_col = scp->xsize;
230 tp->t_winsize.ws_row = scp->ysize;
44
45#include <dev/fb/fbreg.h>
46#include <dev/syscons/syscons.h>
47
48SET_DECLARE(scrndr_set, const sc_renderer_t);
49
50/* for compatibility with previous versions */
51/* 3.0-RELEASE used the following structure */

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

228 if (tp == NULL)
229 return 0;
230 DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n",
231 tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize));
232 if (tp->t_winsize.ws_col != scp->xsize
233 || tp->t_winsize.ws_row != scp->ysize) {
234 tp->t_winsize.ws_col = scp->xsize;
235 tp->t_winsize.ws_row = scp->ysize;
231 pgsignal(tp->t_pgrp, SIGWINCH, 1);
236 if (tp->t_pgrp != NULL) {
237 PGRP_LOCK(tp->t_pgrp);
238 pgsignal(tp->t_pgrp, SIGWINCH, 1);
239 PGRP_UNLOCK(tp->t_pgrp);
240 }
232 }
233
234 return 0;
235}
236
237int
238sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
239{

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

286 scp->status &= ~UNKNOWN_MODE;
287
288 if (tp == NULL)
289 return 0;
290 if (tp->t_winsize.ws_xpixel != scp->xpixel
291 || tp->t_winsize.ws_ypixel != scp->ypixel) {
292 tp->t_winsize.ws_xpixel = scp->xpixel;
293 tp->t_winsize.ws_ypixel = scp->ypixel;
241 }
242
243 return 0;
244}
245
246int
247sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode)
248{

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

295 scp->status &= ~UNKNOWN_MODE;
296
297 if (tp == NULL)
298 return 0;
299 if (tp->t_winsize.ws_xpixel != scp->xpixel
300 || tp->t_winsize.ws_ypixel != scp->ypixel) {
301 tp->t_winsize.ws_xpixel = scp->xpixel;
302 tp->t_winsize.ws_ypixel = scp->ypixel;
294 pgsignal(tp->t_pgrp, SIGWINCH, 1);
303 if (tp->t_pgrp != NULL) {
304 PGRP_LOCK(tp->t_pgrp);
305 pgsignal(tp->t_pgrp, SIGWINCH, 1);
306 PGRP_UNLOCK(tp->t_pgrp);
307 }
295 }
296
297 return 0;
298#endif /* SC_NO_MODE_CHANGE */
299}
300
301int
302sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,

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

418 scp->status &= ~UNKNOWN_MODE;
419
420 if (tp == NULL)
421 return 0;
422 if (tp->t_winsize.ws_col != scp->xsize
423 || tp->t_winsize.ws_row != scp->ysize) {
424 tp->t_winsize.ws_col = scp->xsize;
425 tp->t_winsize.ws_row = scp->ysize;
308 }
309
310 return 0;
311#endif /* SC_NO_MODE_CHANGE */
312}
313
314int
315sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize,

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

431 scp->status &= ~UNKNOWN_MODE;
432
433 if (tp == NULL)
434 return 0;
435 if (tp->t_winsize.ws_col != scp->xsize
436 || tp->t_winsize.ws_row != scp->ysize) {
437 tp->t_winsize.ws_col = scp->xsize;
438 tp->t_winsize.ws_row = scp->ysize;
426 pgsignal(tp->t_pgrp, SIGWINCH, 1);
439 if (tp->t_pgrp != NULL) {
440 PGRP_LOCK(tp->t_pgrp);
441 pgsignal(tp->t_pgrp, SIGWINCH, 1);
442 PGRP_UNLOCK(tp->t_pgrp);
443 }
427 }
428
429 return 0;
430#endif /* SC_PIXEL_MODE */
431}
432
433#define fb_ioctl(a, c, d) \
434 (((a) == NULL) ? ENODEV : \

--- 391 unchanged lines hidden ---
444 }
445
446 return 0;
447#endif /* SC_PIXEL_MODE */
448}
449
450#define fb_ioctl(a, c, d) \
451 (((a) == NULL) ? ENODEV : \

--- 391 unchanged lines hidden ---