09 Dec, 2006

3 commits

  • Fix some possible unaligned accesses when accessing fields of 'image'
    pointer. Indeed this pointer was obtained by allocating a block of memory
    that embeds a temporary array plus an image structure. The temporary
    buffer was located at the start of the allocated block and depending on its
    size, the image structure which comes right after can be unaligned.

    For example when using mini fonts (4x6) (cursor's width is 4 and its height
    is 6) the temporary buf size is 6 bytes.

    Therefore this patch moves the image structure to the start of the block
    and moves the temporary buffer right after. It makes 'image' pointer
    always aligned and since the tempo buf is a buffer of char, it's always
    correctly aligned as well.

    It also fixes the file header alignement.

    Signed-off-by: Franck Bui-Huu
    Cc: James Simmons
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Franck Bui-Huu
     
  • - annotate some variables from vgacon.c and fbmem.c as __read_mostly
    - move the mask[] array in fb_set_logo_truepalette() into the .rodata section

    Signed-off-by: Helge Deller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Helge Deller
     
  • - move some structs and arrays to the read-only (.rodata) section

    [akpm@osdl.org: build fix]
    Signed-off-by: Helge Deller
    Acked-by: James Simmons
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Helge Deller
     

22 Nov, 2006

1 commit


05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

03 Oct, 2006

4 commits


27 Sep, 2006

1 commit


23 Sep, 2006

1 commit

  • In

    |Author: James Simmons
    |Date: Thu Mar 13 22:37:08 2003 -0800
    |
    | [FBCON] Cursor handling clean up. I nuked several static variables.

    we have

    -static void fbcon_vbl_handler(int irq, void *dummy, struct pt_regs *fp)
    +static void fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp)

    and 3 years later a couple of instances missed back then still remains
    there.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

01 Aug, 2006

1 commit

  • WARNING: drivers/video/console/mdacon.o - Section mismatch: reference to .init.text: from .text between 'mdacon_startup' (at offset 0x123) and 'mdacon_init'
    WARNING: drivers/video/console/mdacon.o - Section mismatch: reference to .init.text: from .text between 'mdacon_startup' (at offset 0x18b) and 'mdacon_init'

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

    Frederik Deweerdt
     

11 Jul, 2006

2 commits

  • screen_info.h doesn't have anything to do with the tty layer and shouldn't be
    included by tty.h. This patches removes the include and modifies all users to
    directly include screen_info.h. struct screen_info is mainly used to
    communicate with the console drivers in drivers/video/console. Note that this
    patch touches every arch and I have no way of testing it. If there is a
    mistake the worst thing that will happen is a compile error.

    [akpm@osdl.org: fix arm build]
    [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
     
  • 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
     

01 Jul, 2006

1 commit


28 Jun, 2006

1 commit


27 Jun, 2006

10 commits

  • Do not mark sticon_startup() as __init

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

    Antonino A. Daplas
     
  • Do not mark promcon_startup() and promcon_init_unimap() as __init

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

    Antonino A. Daplas
     
  • - move register ioremap from newport_startup() to newport_console_init()
    - fonts are freed multiple times, do it only once

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

    Antonino A. Daplas
     
  • Do not mark mdacon_startup __init.

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

    Antonino A. Daplas
     
  • The class device "fbcon" does not need to be a device file. Do not create one
    by passing a major and minor number of zero to
    class_device_create()/destroy().

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

    Antonino A. Daplas
     
  • The control for binding/unbinding is moved from fbcon to the console layer.
    Thus the fbcon sysfs attributes, attach and detach, are also gone.

    1. Add a notifier event that tells fbcon if a framebuffer driver has been
    unregistered. If no registered driver remains, fbcon will unregister
    itself from the console layer.

    2. Replaced calls to give_up_console() with unregister_con_driver().

    3. Still use take_over_console() instead of register_con_driver() to
    maintain compatibility

    4. Respect the parameter first_fb_vc and last_fb_vc instead of using 0 and
    MAX_NR_CONSOLES - 1. These parameters are settable by the user.

    5. When fbcon is completely unbound from the console layer, fbcon will
    also release (iow, decrement module reference counts to zero) all fbdev
    drivers. In other words, a bind or unbind request from the console layer
    will propagate down to the framebuffer drivers.

    6. If fbcon is not bound to the console, it will ignore all notifier
    events (except driver registration and unregistration) and all sysfs
    requests.

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

    Antonino A. Daplas
     
  • Add the ability to detach and attach the framebuffer console to and from the
    vt layer. This is done by echo'ing any value to sysfs attributes located in
    class/graphics/fbcon. The two attributes are:

    attach - bind fbcon to the vt layer
    detach - unbind fbcon from the vt layer

    Once fbcon is detached from the vt layer, fbcon can be unloaded if compiled as
    a module. This feature is quite useful for developers who work on the
    framebuffer or console subsystem. This is also useful for users who want to
    go to text mode or graphics mode without having to reboot.

    Directly unloading the fbcon module is not possible because the vt layer
    increments the module reference count for all bound consoles. Detaching fbcon
    decrements the module reference count to zero so unloading becomes possible.

    Detaching fbcon may interfere with X and/or DRM.

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

    Antonino A. Daplas
     
  • To detach fbcon, it must also clean up all resources it allocated. This was
    never done before because fbcon cannot be unloaded.

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

    Antonino A. Daplas
     
  • In order for this feature to work, an interface will be needed. The most
    appropriate is sysfs. However, the framebuffer console has no sysfs entry
    yet. This will create a sysfs class device entry for fbcon under
    /sys/class/graphics.

    Add a class_device entry 'fbcon' under class 'graphics'. Console-specific
    attributes which where previously under class/graphics/fb[x] are moved to
    class/graphics/fbcon. These attributes, 'con_rotate' and 'con_rotate_all',
    are also renamed to 'rotate' and 'rotate_all' respectively.

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

    Antonino A. Daplas
     
  • One of the limitations of the framebuffer console system is its inablity to
    unload or detach itself from the console layer. And once it loads, it also
    locks in framebuffer drivers preventing their unload. Although the con2fbmap
    utility does provide a means to unload individual drivers, it requires that at
    least one framebuffer driver is loaded for use by fbcon.

    With this change, it is possible to detach fbcon from the console layer. If it
    is detached, it will reattach the boot console driver (which is permanently
    loaded) back to the console layer so the system can continue to work. As a
    consequence, fbcon will also decrement its reference count of individual
    framebuffer drivers, allowing all of these drivers to be unloaded even if
    fbcon is still loaded.

    Unless you use drivers that restores the display to text mode (rivafb and
    i810fb, for example), detaching fbcon does require assistance from userspace
    tools (ie, vbetools) for text mode to be restored completely. Without the
    help of these tools, fbcon will leave the VGA console corrupted. The methods
    that can be used will be described in Documentation/fb/fbcon.txt.

    Because the vt layer also increments the module reference count for each
    console driver, fbcon cannot be directly unloaded. It must be detached first
    prior to unload.

    Similarly, fbcon can be reattached to the console layer without having to
    reload the module. A nice feature if fbcon is compiled statically.

    Attaching and detaching fbcon is done via sysfs attributes. A class device
    entry for fbcon is created in /sys/class/graphics. The two attributes that
    controls this feature are detach and attach. Two other attributes that are
    piggybacked under /sys/class/graphics/fb[n] that are fbcon-specific,
    'con_rotate' and 'con_rotate_all' are moved to fbcon. They are renamed as
    'rotate' and 'rotate_all' respectively.

    Overall, this feature is a great help for developers working in the
    framebuffer or console layer. There is not need to continually reboot the
    kernel for every small change. It is also useful for regular users who wants
    to choose between a graphical console or a text console without having to
    reboot.

    Example usage for x86:

    /* start in text mode */
    modprobe xxxfb
    modprobe fbcon
    /* graphical mode with fbcon using xxxfb */
    echo 1 > /sys/class/graphics/fbcon/detach
    /* back to text mode, will produce corrupt display unless vbetool is used */
    rmmod xxxfb
    modprobe yyyfb
    /* back to graphical mode with fbcon using yyyfb */

    Before trying out this feature, please read Documentation/fb/fbcon.txt.

    This patch:

    In order for fbcon to detach itself from the console layer, vgacon, which is a
    boot console driver, must be fixed so it can retake the console multiple
    times, not just during init. The following needs to be done:

    - remove __init from the vgacon_startup, this is called again by
    take_over_console().

    - vc->rows and vc->cols are set manually by vgacon during init. After init,
    vc_resize() can be used

    - make sure the scrollback_buffer is not reallocated

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

    Antonino A. Daplas
     

23 Jun, 2006

1 commit

  • VGA_MAP_MEM translates to ioremap() on some architectures. It makes sense
    to do this to vga_vram_base, because we're going to access memory between
    vga_vram_base and vga_vram_end.

    But it doesn't really make sense to map starting at vga_vram_end, because
    we aren't going to access memory starting there. On ia64, which always has
    to be different, ioremapping vga_vram_end gives you something completely
    incompatible with ioremapped vga_vram_start, so vga_vram_size ends up being
    nonsense.

    As a bonus, we often know the size up front, so we can use ioremap()
    correctly, rather than giving it a zero size.

    Signed-off-by: Bjorn Helgaas
    Cc: "Antonino A. Daplas"
    Cc: "Luck, Tony"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     

09 Jun, 2006

1 commit

  • From: Malcom Parsons

    When scrolling up in SCROLL_PAN_REDRAW mode with a large limited scroll
    region, the bottom few lines have to be redrawn. Without this patch, the
    wrong text is drawn into these lines, corrupting the display.

    Observed in 2.6.14 when running an IRC client in the Nintendo DS linux
    port.

    I haven't tested if scrolling down has the same problem.

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

    Malcom Parsons
     

01 Jun, 2006

1 commit

  • From: David Hollister

    After the system boots with the logo, if the first action is a scrollback, the
    screen may become garbled. This patch ensures that the softback_curr value is
    updated along with softback_in following the scrollback.

    Signed-off-by: David Hollister
    Signed-off-by: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Hollister
     

01 Apr, 2006

2 commits

  • The current display was not saved during initialization. This leads to hard
    to track console corruption, such as a misplaced cursor, which is correctible
    by switching consoles. Fix this minor bug.

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

    Antonino A. Daplas
     
  • The boot cmdline is parsed in parse_early_param() and
    parse_args(,unknown_bootoption).

    And __setup() is used in obsolete_checksetup().

    start_kernel()
    -> parse_args()
    -> unknown_bootoption()
    -> obsolete_checksetup()

    If __setup()'s callback (->setup_func()) returns 1 in
    obsolete_checksetup(), obsolete_checksetup() thinks a parameter was
    handled.

    If ->setup_func() returns 0, obsolete_checksetup() tries other
    ->setup_func(). If all ->setup_func() that matched a parameter returns 0,
    a parameter is seted to argv_init[].

    Then, when runing /sbin/init or init=app, argv_init[] is passed to the app.
    If the app doesn't ignore those arguments, it will warning and exit.

    This patch fixes a wrong usage of it, however fixes obvious one only.

    Signed-off-by: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    OGAWA Hirofumi
     

31 Mar, 2006

1 commit


28 Mar, 2006

4 commits

  • Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
    duplicates of ARRAY_SIZE. Some coding style and trailing whitespaces are
    also fixed.

    Compile-tested where possible (some are other arch or BROKEN)

    Signed-off-by: Tobias Klauser
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     
  • There are more sparse warnings but fixing those will require some more work
    than I want to do without hardware for testing at hand.

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

    Ralf Baechle
     
  • The scrollback buffer of the VGA console is located in VGA RAM. This RAM
    is fixed in size and is very small. To make the scrollback buffer larger,
    it must be placed instead in System RAM.

    This patch adds this feature. The feature and the size of the buffer are
    made as a kernel config option. Besides consuming kernel memory, this
    feature will slow down the console by approximately 20%.

    Signed-off-by: Antonino Daplas
    Signed-off-by: Jiri Slaby
    Cc: Jindrich Makovicka
    Cc: Martin Mares
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonino A. Daplas
     
  • This corrects cursor resize on ega boards: registers are write-only, so we
    shouldn't even try to read them. And on ega, 31/30 produces a flat cursor.
    Using 31/31 is better: except with 32 pixels high fonts, it shouldn't show
    up.

    Signed-off-by: Samuel Thibault
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     

25 Feb, 2006

1 commit

  • EGA boards suck: they mostly have write-only registers. This is
    particularly problematic for the overflow register: for being able to write
    to it, we would have to handle vertical sync & such too, which (I'd say)
    would potentially break a lot of configurations. Instead, just disabling
    vertical resize for EGA boards is just nice enough (horizontal resize still
    works).

    Fixes http://bugzilla.kernel.org/show_bug.cgi?id=6106

    Signed-off-by: Samuel Thibault
    Cc: Rafal Olearski
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Samuel Thibault
     

23 Jan, 2006

1 commit

  • Helge,
    o Convert a bunch of kmalloc/memset uses to kzalloc.
    o pci.c: Add some __read_mostly annotations.
    o pci.c: Move constant pci_post_reset_delay to asm/pci.h
    o grfioctl.h: Add A4450A to comment of CRT_ID_VISUALIZE_EG.
    o Add some consts to perf.c/perf_images.h

    Matthew,
    o sticore.c: Add some consts to suppress compile warnings.

    Signed-off-by: Helge Deller
    Signed-off-by: Matthew Wilcox
    Signed-off-by: Kyle McMartin

    Helge Deller
     

11 Jan, 2006

2 commits

  • This patch contains the possible cleanups including the following:
    - every file should #include the headers containing the prototypes for
    it's global functions
    - make needlessly global functions static
    - kyro/STG4000Interface.h: #include video/kyro.h and linux/pci.h
    instead of a manual "struct pci_dev"
    - i810_main.{c,h}: prototypes for static functions belong to the
    C file

    Signed-off-by: Adrian Bunk
    Acked-by: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • - replace kmalloc with kzalloc
    - remove repeated define (FONTCHHCNT)
    - remove unneeded local variable (redraw) in ypan_{up|down}_redraw
    - add and delete cursor timer in fbcon_switch() if old_info != info

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

    Antonino A. Daplas