01 Jul, 2009

1 commit

  • Add a mutex to avoid a circular locking problem between the mm layer
    semaphore and fbdev ioctl mutex through the fb_mmap() call.

    Also, add mutex to all places where smem_start and smem_len fields change
    so the mutex inside the fb_mmap() is actually used. Changing of these
    fields before calling the framebuffer_register() are not mutexed.

    This is 2.6.31 material. It removes one lockdep (fb_mmap() and
    register_framebuffer()) but there is still another one (fb_release() and
    register_framebuffer()). It also cleans up handling of the smem_start and
    smem_len fields used by mutexed section of the fb_mmap().

    Signed-off-by: Krzysztof Helt
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     

17 Jun, 2009

2 commits

  • Signed-off-by: Mike Frysinger
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • With KMS we have ran into an issue where we really want the KMS fb driver
    to be the one running the console, so panics etc can be shown by switching
    out of X etc.

    However with vesafb/efifb built-in, we end up with those on fb0 and the
    KMS fb driver on fb1, driving the same piece of hw, so this adds an fb
    info flag to denote a firmware fbdev, and adds a new aperture base/size
    range which can be compared when the hw drivers are installed to see if
    there is a conflict with a firmware driver, and if there is the firmware
    driver is unregistered and the hw driver takes over.

    It uses new aperture_base/size members instead of comparing on the fix
    smem_start/length, as smem_start/length might for example only cover the
    first 1MB of the PCI aperture, and we could allocate the kms fb from 8MB
    into the aperture, thus they would never overlap.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Dave Airlie
    Acked-by: Peter Jones
    Cc: Geert Uytterhoeven
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Airlie
     

14 Apr, 2009

1 commit

  • The documentation about the meaning of the color component bitfield
    lengths in pseudocolor modes is inconsistent. Fix it, so that it
    indicates the correct interpretation everywhere, i.e. that 1 << length is
    the number of palette entries.

    Signed-off-by: Michal Januszewski
    Acked-by: Krzysztof Helt
    Cc:
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Januszewski
     

01 Apr, 2009

2 commits

  • Before:

    text data bss dec hex filename
    3648 2910 32 6590 19be drivers/video/backlight/backlight.o
    3226 2812 32 6070 17b6 drivers/video/backlight/lcd.o
    30990 16688 8480 56158 db5e drivers/video/console/fbcon.o
    15488 8400 24 23912 5d68 drivers/video/fbmem.o

    After:

    text data bss dec hex filename
    3537 2870 32 6439 1927 drivers/video/backlight/backlight.o
    3131 2772 32 5935 172f drivers/video/backlight/lcd.o
    30876 16648 8480 56004 dac4 drivers/video/console/fbcon.o
    15506 8400 24 23930 5d7a drivers/video/fbmem.o

    Cc: Andrea Righi
    Cc: Geert Uytterhoeven
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Add an accelerator constant so almost all Cirrus are recognized as
    accelerators by the fbset command.

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

    Krzysztof Helt
     

06 Feb, 2009

1 commit

  • Avoid calling copy_from/to_user() with fb_info->lock mutex held in fbmem
    ioctl().

    fb_mmap() is called under mm->mmap_sem (A) held, that also acquires
    fb_info->lock (B); fb_ioctl() takes fb_info->lock (B) and does
    copy_from/to_user() that might acquire mm->mmap_sem (A), causing a
    deadlock.

    NOTE: it doesn't push down the fb_info->lock in each own driver's
    fb_ioctl(), so there are still potential deadlocks elsewhere.

    Signed-off-by: Andrea Righi
    Cc: Dave Jones
    Cc: "Rafael J. Wysocki"
    Cc: Johannes Weiner
    Cc: Krzysztof Helt
    Cc: Harvey Harrison
    Cc: Stefan Richter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Righi
     

16 Jan, 2009

1 commit


22 Dec, 2008

1 commit


20 Oct, 2008

1 commit

  • Change lock_kernel()/unlock_kernel() to local fb mutex. Each frame buffer
    instance has its own mutex.

    The one line try_to_load() function is unrolled to request_module() in two
    places for readability.

    [righi.andrea@gmail.com: fb: fix NULL pointer BUG dereference in fb_open()]
    Signed-off-by: Krzysztof Helt
    Signed-off-by: Andrea Righi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     

21 Aug, 2008

1 commit

  • Fixes kernel BUG at lib/radix-tree.c:473.

    Previously the handler was incidentally provided by tmpfs but this was
    removed with:

    commit 14fcc23fdc78e9d32372553ccf21758a9bd56fa1
    Author: Hugh Dickins
    Date: Mon Jul 28 15:46:19 2008 -0700

    tmpfs: fix kernel BUG in shmem_delete_inode

    relying on this behaviour was incorrect in any case and the BUG also
    appeared when the device node was on an ext3 filesystem.

    v2: override a_ops at open() time rather than mmap() time to minimise
    races per AKPM's concerns.

    Signed-off-by: Ian Campbell
    Cc: Jaya Kumar
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Cc: Hugh Dickins
    Cc: Johannes Weiner
    Cc: Jeremy Fitzhardinge
    Cc: Kel Modderman
    Cc: Markus Armbruster
    Cc: Krzysztof Helt
    Cc: [14fcc23fd is in 2.6.25.14 and 2.6.26.1]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Campbell
     

25 Jul, 2008

2 commits

  • Currently, linux/major.h defines a GRAPHDEV_MAJOR (29) that nobody uses,
    and linux/fb.h defines the real FB_MAJOR (also 29), that only fbmem.c
    needs. Drop GRAPHDEV_MAJOR from major.h, move FB_MAJOR definition from
    fb.h to major.h, and fix fbmem.c to use major.h's definition.

    Signed-off-by: Philippe De Muyter
    Cc: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Philippe De Muyter
     
  • This patch replaces deprecated constant FB_ACCELF_TEXT with
    FBINFO_HWACCEL_DISABLED and adds constants for Trident families of
    accelerators.

    The FBINFO_HWACCEL_DISABLED is correctly used so noaccel parameter works
    now.

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

    Krzysztof Helt
     

28 Apr, 2008

1 commit

  • Add support for the framebuffers with non-native endianness. This is done via
    FBINFO_FOREIGN_ENDIAN flag that will be used by the drivers. Depending on the
    host endianness this flag will be overwritten by FBINFO_BE_MATH internal flag,
    or cleared.

    Tested to work on MPC8360E-RDK (BE) + Fujitsu MINT framebuffer (LE).

    Signed-off-by: Anton Vorontsov
    Cc: "Antonino A. Daplas"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc:
    Cc: Clemens Koller
    Cc: Krzysztof Helt
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

17 Oct, 2007

3 commits

  • Move the extern declaration for global_mode_option to and rename
    the variable to fb_mode_option.

    Signed-off-by: Geert Uytterhoeven
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • Intel FB: allow odd- and even-field-first in interlaced modes, and
    proper sync to vertical retrace

    Signed-off-by: Krzysztof Halasa
    Cc: "Antonino A. Daplas"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Halasa
     
  • Allow generic frame-buffer code to correctly write texts and blit images for
    1, 2 and 4 bit per pixel frame-buffer organizations when pixels in bytes are
    organized to in opposite order than bytes in long type.

    Overhead should be reasonable. If option is not selected, than compiler
    should eliminate completely all overhead.

    The feature is disabled at compile time if CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is
    not set.

    [adaplas]
    Convert helper functions to macros if feature is not enabled.

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

    Pavel Pisa
     

18 Jul, 2007

2 commits

  • Signed-off-by: Trilok Soni
    Cc: Tony Lindgren
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Imre Deak
     
  • This allows for proper console unregistration via the VT layer, and updates
    the FB layer to use it. This makes debugging new console drivers much easier,
    since you can properly clean them up before unloading.

    [adaplas]
    unregister_framebuffer() is typically called as part of the driver's
    module_exit(). Doing so otherwise will freeze the machine as the VT layer is
    holding reference counts on fbcon, and fbcon on the driver. With this change,
    it allows unregister_framebuffer() to be called safely anywhere as needed.

    Additions from the original: If multiple drivers are used by fbcon, and if
    one of them unregisters, a driver will take over the consoles vacated by the
    outgoing one (via set_con2fb_map). Once only the outgoing driver remains,
    then fbcon will unbind from the VT layer (if CONFIG_HW_CONSOLE_UNBINDING is
    set to y).

    It is important that these drivers implement fb_open() and fb_release()
    just to ensure that no other process is using the driver. Likewise, these
    drivers _must_ check the return value of unregister_framebuffer().

    [akpm@linux-foundation.org: make fbcon_unbind() stub inline]
    Signed-off-by: Jesse Barnes
    Signed-off-by: Antonino Daplas
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesse Barnes
     

01 Jun, 2007

1 commit

  • Move the forward declaration of fb_class from drivers/video/console/fbcon.h to
    , together with the other forward declarations related to
    drivers/video/fbmem.c.

    This kills the following sparse warning:
    | drivers/video/fbmem.c:1363:14: warning: symbol 'fb_class' was not declared. Should it be static?

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

    Geert Uytterhoeven
     

10 May, 2007

1 commit


09 May, 2007

8 commits

  • Check if the mode can properly display the screen. This will be needed by
    drivers where the capability is not constant with each mode. The function
    fb_set_var() will query fbcon the requirement, then it will query the driver
    (via a new hook fb_get_caps()) its capability. If the driver's capability
    cannot handle fbcon's requirement, then fb_set_var() will fail.

    For example, if a particular driver supports 2 modes where:

    mode1 = can only display 8x16 bitmaps
    mode2 = can display any bitmap

    then if current mode = mode2 and current font = 12x22

    fbset /* mode1 cannot handle 12x22 */
    fbset will fail

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

    Antonino A. Daplas
     
  • Add a tile method, fb_get_tilemax(), that returns the maximum length of
    the tile map (or font map). This is needed by s3fb which can only handle
    256 characters.

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

    Antonino A. Daplas
     
  • A few drivers are not capable of blitting rectangles of any dimension.
    vga16fb can only blit 8-pixel wide rectangles, while s3fb (in tileblitting
    mode) can only blit 8x16 rectangles. For example, loading a 12x22 font in
    vga16fb will result in a corrupt display.

    Advertise this limitation/capability in info->pixmap.blit_x and blit_y. These
    fields are 32-bit arrays (font max is 32x32 only), ie, if bit 7 is set, then
    width/height of 7+1 is supported.

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

    Antonino A. Daplas
     
  • The functions fb_read() and fb_write in fbmem.c assume that the framebuffer
    is in IO memory. However, we have 3 drivers (hecubafb, arcfb, and vfb)
    where the framebuffer is allocated from system RAM (via vmalloc). Using
    __raw_read/__raw_write (fb_readl/fb_writel) for these drivers is
    illegal, especially in other platforms.

    Create file read and write methods for these types of drivers. These are
    named fb_sys_read() and fb_sys_write().

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

    Antonino A. Daplas
     
  • It is unnecessary to pass struct file to fb_read() and fb_write() in struct
    fb_ops. For consistency with the other methods, pass struct fb_info instead.

    Signed-off-by: Antonino Daplas
    Acked-by: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonino A. Daplas
     
  • The generic drawing functions (cfbimgblt, cfbcopyarea, cfbfillrect) assume
    that the framebuffer is in IO memory. However, we have 3 drivers (hecubafb,
    arcfb, and vfb) where the framebuffer is allocated from system RAM (via
    vmalloc). Using _raw_read/write and family for these drivers (as used in
    the cfb* functions) is illegal, especially in other platforms.

    Create 3 new drawing functions, based almost entirely from the original
    except that the framebuffer memory is assumed to be in system RAM.
    These are named as sysimgblt, syscopyarea, and sysfillrect.

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

    Antonino A. Daplas
     
  • There are cases when we do not want to wait on the delay for automatically
    updating the "real" framebuffer, this implements a simple ->fsync() hook
    for explicitly flushing the deferred I/O work. The ->page_mkwrite()
    handler will rearm the work queue normally.

    (akpm: nuke unneeded ifdefs, forward-delcare struct dentry)

    Signed-off-by: Paul Mundt
    Cc: Jaya Kumar
    Acked-by: Antonino Daplas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     
  • This implements deferred IO support in fbdev. Deferred IO is a way to delay
    and repurpose IO. This implementation is done using mm's page_mkwrite and
    page_mkclean hooks in order to detect, delay and then rewrite IO. This
    functionality is used by hecubafb.

    [adaplas]
    This is useful for graphics hardware with no directly addressable/mappable
    framebuffer. Implementing this will allow the "framebuffer" to be accesible
    from user space via mmap().

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

    Jaya Kumar
     

20 Feb, 2007

2 commits

  • fb_info->bl_mutex is badly thought out and the backlight class doesn't
    need it if the framebuffer/backlight register/unregister order is
    consistent, particularly after the backlight locking fixes.

    Fix the drivers to use the order:

    backlight_device_register()
    register_framebuffer()
    unregister_framebuffer()
    backlight_device_unregister()

    and turn bl_mutex into a lock for the bl_curve data only.

    Signed-off-by: Richard Purdie

    Richard Purdie
     
  • The backlight class wants notification whenever the console is blanked
    but doesn't get this when hardware blanking fails and software blanking
    is used. Changing FB_EVENT_BLANK to report both would be a behaviour
    change which could confuse the console layer so add a new event for
    software blanking and have the backlight class listen for both.

    Signed-off-by: Richard Purdie

    Richard Purdie
     

13 Feb, 2007

2 commits

  • fbdev modedb: make more input and output pointer parameters const

    Signed-off-by: Geert Uytterhoeven
    Cc: James Simmons
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • Add a driver for S3 Trio / S3 Virge. Driver is tested with most versions
    of S3 Trio and with S3 Virge/DX, on i386.

    (akpm: We kind-of have support for this hardware already, but...

    virgefb.c
    - amiga/zorro specific,
    - broken (according to Kconfig),
    - uses obsolete/nonexistent interface (struct display_switch)
    - recent Adrian Bunk's patch removes this driver

    S3triofb.c
    - ppc/openfirmware specific
    - minimal functionality
    - broken (according to Kconfig),
    - uses obsolete/nonexistent interface (struct display_switch)
    )

    Signed-off-by: Ondrej Zajicek
    Cc: James Simmons
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ondrej Zajicek
     

14 Dec, 2006

1 commit


09 Dec, 2006

1 commit

  • - Mark the default colormaps read-only, as nobody should be allowed to
    modify them

    - Additionally mark color values as __read_mostly since they will only be
    modified (very seldom) by fb_invert_cmaps()

    - Add named C99-initializers in fb_cmap structs and use the ARRAY_SIZE()
    macro

    Signed-off-by: Helge Deller
    Acked-by: James Simmons
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Helge Deller
     

02 Dec, 2006

1 commit


03 Oct, 2006

2 commits

  • Check the return value of device_create_file(). If return is 'fail', remove
    attributes by calling device_remove_file().

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

    Antonino A. Daplas
     
  • Adds functionality to read the EDID information over the DDC bus in a generic
    way. This code is based on the DDC implementation in the radeon driver.

    [adaplas]
    - separate from fbmon.c and place in new file fb_ddc.c
    - remove dependency to CONFIG_I2C and CONFIG_I2C_ALGOBIT, otherwise, feature
    will not compile if i2c support is compiled as a module
    - feature is selectable only by drivers needing it. It must have a
    'select FB_DDC if xxx' in Kconfig
    - change printk's to dev_*, the i2c people prefers it

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

    Dennis Munsie
     

15 Aug, 2006

1 commit


01 Aug, 2006

1 commit

  • The backlight and lcd subsystems can be notified by the framebuffer layer
    of blanking events. However, these subsystems, as a whole, can function
    independently from the framebuffer layer. But in order to enable to the
    lcd and backlight subsystems, the framebuffer has to be compiled also,
    effectively sucking in a huge amount of unneeded code.

    To prevent dependency problems, separate out the framebuffer notification
    mechanism from the framebuffer layer and permanently link it to the kernel.

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

    Antonino A. Daplas