scvidctl.c (174985) | scvidctl.c (181905) |
---|---|
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 * 8 * Redistribution and use in source and binary forms, with or without --- 14 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> | 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 * 8 * Redistribution and use in source and binary forms, with or without --- 14 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> |
31__FBSDID("$FreeBSD: head/sys/dev/syscons/scvidctl.c 174985 2007-12-29 23:26:59Z wkoszek $"); | 31__FBSDID("$FreeBSD: head/sys/dev/syscons/scvidctl.c 181905 2008-08-20 08:31:58Z ed $"); |
32 33#include "opt_compat.h" 34#include "opt_syscons.h" 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/signalvar.h> --- 196 unchanged lines hidden (view full) --- 236 if (tp == NULL) 237 return 0; 238 DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n", 239 tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize)); 240 if (tp->t_winsize.ws_col != scp->xsize 241 || tp->t_winsize.ws_row != scp->ysize) { 242 tp->t_winsize.ws_col = scp->xsize; 243 tp->t_winsize.ws_row = scp->ysize; | 32 33#include "opt_compat.h" 34#include "opt_syscons.h" 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/signalvar.h> --- 196 unchanged lines hidden (view full) --- 236 if (tp == NULL) 237 return 0; 238 DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n", 239 tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize)); 240 if (tp->t_winsize.ws_col != scp->xsize 241 || tp->t_winsize.ws_row != scp->ysize) { 242 tp->t_winsize.ws_col = scp->xsize; 243 tp->t_winsize.ws_row = scp->ysize; |
244 if (tp->t_pgrp != NULL) { 245 PGRP_LOCK(tp->t_pgrp); 246 pgsignal(tp->t_pgrp, SIGWINCH, 1); 247 PGRP_UNLOCK(tp->t_pgrp); 248 } | 244 245 tty_signal_pgrp(tp, SIGWINCH); |
249 } 250 251 return 0; 252} 253 254int 255sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode) 256{ --- 46 unchanged lines hidden (view full) --- 303 scp->status &= ~UNKNOWN_MODE; 304 305 if (tp == NULL) 306 return 0; 307 if (tp->t_winsize.ws_xpixel != scp->xpixel 308 || tp->t_winsize.ws_ypixel != scp->ypixel) { 309 tp->t_winsize.ws_xpixel = scp->xpixel; 310 tp->t_winsize.ws_ypixel = scp->ypixel; | 246 } 247 248 return 0; 249} 250 251int 252sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode) 253{ --- 46 unchanged lines hidden (view full) --- 300 scp->status &= ~UNKNOWN_MODE; 301 302 if (tp == NULL) 303 return 0; 304 if (tp->t_winsize.ws_xpixel != scp->xpixel 305 || tp->t_winsize.ws_ypixel != scp->ypixel) { 306 tp->t_winsize.ws_xpixel = scp->xpixel; 307 tp->t_winsize.ws_ypixel = scp->ypixel; |
311 if (tp->t_pgrp != NULL) { 312 PGRP_LOCK(tp->t_pgrp); 313 pgsignal(tp->t_pgrp, SIGWINCH, 1); 314 PGRP_UNLOCK(tp->t_pgrp); 315 } | 308 309 tty_signal_pgrp(tp, SIGWINCH); |
316 } 317 318 return 0; 319#endif /* SC_NO_MODE_CHANGE */ 320} 321 322int 323sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, --- 146 unchanged lines hidden (view full) --- 470#endif /* SC_PIXEL_MODE */ 471} 472 473#define fb_ioctl(a, c, d) \ 474 (((a) == NULL) ? ENODEV : \ 475 vidd_ioctl((a), (c), (caddr_t)(d))) 476 477int | 310 } 311 312 return 0; 313#endif /* SC_NO_MODE_CHANGE */ 314} 315 316int 317sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, --- 146 unchanged lines hidden (view full) --- 464#endif /* SC_PIXEL_MODE */ 465} 466 467#define fb_ioctl(a, c, d) \ 468 (((a) == NULL) ? ENODEV : \ 469 vidd_ioctl((a), (c), (caddr_t)(d))) 470 471int |
478sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread *td) | 472sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) |
479{ 480 scr_stat *scp; 481 video_adapter_t *adp; 482 video_info_t info; 483 video_adapter_info_t adp_info; 484 int error; 485 int s; 486#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ 487 defined(COMPAT_FREEBSD4) || defined(COMPAT_43) 488 int ival; 489#endif 490 | 473{ 474 scr_stat *scp; 475 video_adapter_t *adp; 476 video_info_t info; 477 video_adapter_info_t adp_info; 478 int error; 479 int s; 480#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ 481 defined(COMPAT_FREEBSD4) || defined(COMPAT_43) 482 int ival; 483#endif 484 |
491 scp = SC_STAT(tp->t_dev); | 485 scp = SC_STAT(tp); |
492 if (scp == NULL) /* tp == SC_MOUSE */ 493 return ENOIOCTL; 494 adp = scp->sc->adp; 495 if (adp == NULL) /* shouldn't happen??? */ 496 return ENODEV; 497 498 switch (cmd) { 499 --- 391 unchanged lines hidden --- | 486 if (scp == NULL) /* tp == SC_MOUSE */ 487 return ENOIOCTL; 488 adp = scp->sc->adp; 489 if (adp == NULL) /* shouldn't happen??? */ 490 return ENODEV; 491 492 switch (cmd) { 493 --- 391 unchanged lines hidden --- |