11 Aug, 2010

3 commits

  • This takes all the tty references through the expected interface points so
    we can refcount them.

    Signed-off-by: Alan Cox
    Cc: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • The vt layer isn't safely handling reference counts to tty object on the input
    side. Add a tty port structure to the vt layer in order to implement this using
    the standard helpers.

    Signed-off-by: Alan Cox
    Cc: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • Jesse's initial patch commit said:

    "At panic time (i.e. when oops_in_progress is set) we should try a bit
    harder to update the screen and make sure output gets to the VT, since
    some drivers are capable of flipping back to it.

    So make sure we try to unblank and update the display if called from a
    panic context."

    I've enhanced this to add a flag to the vc that console layer can set to
    indicate they want this behaviour to occur. This also adds support to
    fbcon for that flag and adds an fb flag for drivers to indicate they want
    to use the support. It enables this for KMS drivers.

    Signed-off-by: Dave Airlie
    Signed-off-by: Jesse Barnes
    Acked-by: James Simmons
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Jesse Barnes
     

17 Jul, 2009

1 commit

  • Bootmem is not used for the vt screen buffer anymore as slab is now
    available at the time the console is initialized.

    Get rid of the now superfluous distinction between slab and bootmem,
    it's always slab.

    This also fixes a kmalloc leak which Catalin described thusly:

    Commit a5f4f52e ("vt: use kzalloc() instead of the bootmem allocator")
    replaced the alloc_bootmem() with kzalloc() but didn't set vc_kmalloced to
    1 and the memory block is later leaked. The corresponding kmemleak trace:

    unreferenced object 0xdf828000 (size 8192):
    comm "swapper", pid 0, jiffies 4294937296
    backtrace:
    [] __save_stack_trace+0x17/0x1c
    [] log_early+0x55/0x84
    [] kmemleak_alloc+0x33/0x3c
    [] __kmalloc+0xd7/0xe4
    [] con_init+0xbf/0x1b8
    [] console_init+0x11/0x20
    [] start_kernel+0x137/0x1e4

    Signed-off-by: Johannes Weiner
    Reviewed-by: Pekka Enberg
    Tested-by: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

15 Oct, 2008

1 commit

  • This reverts commit c9e587abfdec2c2aaa55fab83bcb4972e2f84f9b, and the
    subsequent commits that fixed it up:

    - afa9b649 "fbcon: prevent cursor disappearance after switching to 512
    character font"

    - d850a2fa "vt/fbcon: fix background color on line feed"

    - 7fe3915a "vt/fbcon: update scrl_erase_char after 256/512-glyph font
    switch"

    by request of Alan Cox. Quoth Alan:
    "Unfortunately it's wrong and its been causing breakages because
    various apps like ncurses expect our previous (and correct)
    behaviour."

    Alexander sent out a similar patch.

    Requested-by: Alan Cox
    Tested-by: Jan Engelhardt
    Cc: Alexander V. Lukyanov
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

29 Apr, 2008

1 commit

  • A command that causes a line feed while a background color is active,
    such as

    perl -e 'print "x" x 60, "\e[44m", "x" x 40, "\e[0m\n"'
    and
    perl -e 'print "x" x 40, "\e[44m\n", "x" x 40, "\e[0m\n"'

    causes the line that was started as a result of the line feed to be completely
    filled with the currently active background color instead of the default
    color.

    When scrolling, part of the current screen is memcpy'd/memmove'd to the new
    region, and the new line(s) that will appear as a result are cleared using
    memset. However, the lines are cleared with vc->vc_video_erase_char, causing
    them to be colored with the currently active background color. This is
    different from X11 terminal emulators which always paint the new lines with
    the default background color (e.g. `xterm -bg black`).

    The clear operation (\e[1J and \e[2J) also use vc_video_erase_char, so a new
    vc->vc_scrl_erase_char is introduced with contains the erase character used
    for scrolling, which is built from vc->vc_def_color instead of vc->vc_color.

    Signed-off-by: Jan Engelhardt
    Cc: "Antonino A. Daplas"
    Cc: "H. Peter Anvin"
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Engelhardt
     

17 Oct, 2007

1 commit

  • Various console drivers are able to resize the screen via the con_resize()
    hook. This hook is also visible in userspace via the TIOCWINSZ, VT_RESIZE and
    VT_RESIZEX ioctl's. One particular utility, SVGATextMode, expects that
    con_resize() of the VGA console will always return success even if the
    resulting screen is not compatible with the hardware. However, this
    particular behavior of the VGA console, as reported in Kernel Bugzilla Bug
    7513, can cause undefined behavior if the user starts with a console size
    larger than 80x25.

    To work around this problem, add an extra parameter to con_resize(). This
    parameter is ignored by drivers except for vgacon. If this parameter is
    non-zero, then the resize request came from a VT_RESIZE or VT_RESIZEX ioctl
    and vgacon will always return success. If this parameter is zero, vgacon will
    return -EINVAL if the requested size is not compatible with the hardware. The
    latter is the more correct behavior.

    With this change, SVGATextMode should still work correctly while in-kernel and
    stty resize calls can expect correct behavior from vgacon.

    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonino A. Daplas
     

09 Jun, 2007

1 commit


09 May, 2007

1 commit


12 Feb, 2007

1 commit

  • This does several things.
    - It moves looking up of the current foreground console into process
    context where we can safely take the semaphore that protects this
    operation.
    - It uses the new flavor of work queue processing.
    - This generates a factor of do_SAK, __do_SAK that runs immediately.
    - This calls __do_SAK with the console semaphore held ensuring nothing
    else happens to the console while we process the SAK operation.
    - With the console SAK processing moved into process context this
    patch removes the xchg operations that I used to attempt to attomically
    update struct pid, because of the strange locking used in the SAK processing.
    With SAK using the normal console semaphore nothing special is needed.

    Cc: Oleg Nesterov
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

02 Oct, 2006

1 commit

  • I took a good hard look at the locking and it appears the locking on vt_pid
    is the console semaphore. Every modified path is called under the console
    semaphore except reset_vc when it is called from fn_SAK or do_SAK both of
    which appear to be in interrupt context. In addition I need to be careful
    because in the presence of an oops the console_sem may be arbitrarily
    dropped.

    Which leads me to conclude the current locking is inadequate for my needs.

    Given the weird cases we could hit because of oops printing instead of
    introducing an extra spin lock to protect the data and keep the pid to
    signal and the signal to send in sync, I have opted to use xchg on just the
    struct pid * pointer instead.

    Due to console_sem we will stay in sync between vt_pid and vt_mode except
    for a small window during a SAK, or oops handling. SAK handling should
    kill any user space process that care, and oops handling we are broken
    anyway. Besides the worst that can happen is that I try to send the wrong
    signal.

    Signed-off-by: Eric W. Biederman
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

11 Jul, 2006

1 commit

  • MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a
    function of the VT layer than the TTY one. Moving these to vt.h and vt_kern.h
    allows all of the framebuffer and VT console drivers to remove their
    dependency on tty.h.

    [akpm@osdl.org: fix alpha build]
    Signed-off-by: Jon Smirl
    Signed-off-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jon Smirl
     

07 Nov, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds