aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-01-02 08:43:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:36 -0500
commitfc6f6238226e6d1248e1967eae2bf556eaf3ac17 (patch)
tree07cef0fafd30bd622dac1db4751e10734773c863 /drivers/char/vt.c
parenta47d545f5782cbde871b50bdf4a83379ed2da222 (diff)
pty: simplify resize
We have special case logic for resizing pty/tty pairs. We also have a per driver resize method so for the pty case we should use it. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 639e126b2bff..80014213fb53 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -819,8 +819,8 @@ static inline int resize_screen(struct vc_data *vc, int width, int height,
819 * ctrl_lock of the tty IFF a tty is passed. 819 * ctrl_lock of the tty IFF a tty is passed.
820 */ 820 */
821 821
822static int vc_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, 822static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
823 struct vc_data *vc, unsigned int cols, unsigned int lines) 823 unsigned int cols, unsigned int lines)
824{ 824{
825 unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0; 825 unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
826 unsigned int old_cols, old_rows, old_row_size, old_screen_size; 826 unsigned int old_cols, old_rows, old_row_size, old_screen_size;
@@ -932,7 +932,7 @@ static int vc_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
932 ws.ws_row = vc->vc_rows; 932 ws.ws_row = vc->vc_rows;
933 ws.ws_col = vc->vc_cols; 933 ws.ws_col = vc->vc_cols;
934 ws.ws_ypixel = vc->vc_scan_lines; 934 ws.ws_ypixel = vc->vc_scan_lines;
935 tty_do_resize(tty, real_tty, &ws); 935 tty_do_resize(tty, &ws);
936 } 936 }
937 937
938 if (CON_IS_VISIBLE(vc)) 938 if (CON_IS_VISIBLE(vc))
@@ -954,13 +954,12 @@ static int vc_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
954 954
955int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int rows) 955int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int rows)
956{ 956{
957 return vc_do_resize(vc->vc_tty, vc->vc_tty, vc, cols, rows); 957 return vc_do_resize(vc->vc_tty, vc, cols, rows);
958} 958}
959 959
960/** 960/**
961 * vt_resize - resize a VT 961 * vt_resize - resize a VT
962 * @tty: tty to resize 962 * @tty: tty to resize
963 * @real_tty: tty if a pty/tty pair
964 * @ws: winsize attributes 963 * @ws: winsize attributes
965 * 964 *
966 * Resize a virtual terminal. This is called by the tty layer as we 965 * Resize a virtual terminal. This is called by the tty layer as we
@@ -971,14 +970,13 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int rows)
971 * termios_mutex and the tty ctrl_lock in that order. 970 * termios_mutex and the tty ctrl_lock in that order.
972 */ 971 */
973 972
974int vt_resize(struct tty_struct *tty, struct tty_struct *real_tty, 973int vt_resize(struct tty_struct *tty, struct winsize *ws)
975 struct winsize *ws)
976{ 974{
977 struct vc_data *vc = tty->driver_data; 975 struct vc_data *vc = tty->driver_data;
978 int ret; 976 int ret;
979 977
980 acquire_console_sem(); 978 acquire_console_sem();
981 ret = vc_do_resize(tty, real_tty, vc, ws->ws_col, ws->ws_row); 979 ret = vc_do_resize(tty, vc, ws->ws_col, ws->ws_row);
982 release_console_sem(); 980 release_console_sem();
983 return ret; 981 return ret;
984} 982}