20 Dec, 2011

1 commit


21 Jul, 2011

1 commit

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

12 May, 2011

1 commit

  • This just adds the refcount and the new registration lock logic. It
    does not (for example) actually change the read/write/ioctl routines to
    actually use the frame buffer that was opened: those function still end
    up alway susing whatever the current frame buffer is at the time of the
    call.

    Without this, if something holds the frame buffer open over a
    framebuffer switch, the close() operation after the switch will access a
    fb_info that has been free'd by the unregistering of the old frame
    buffer.

    (The read/write/ioctl operations will normally not cause problems,
    because they will - illogically - pick up the new fbcon instead. But a
    switch that happens just as one of those is going on might see problems
    too, the window is just much smaller: one individual op rather than the
    whole open-close sequence.)

    This use-after-free is apparently fairly easily triggered by the Ubuntu
    11.04 boot sequence.

    Acked-by: Tim Gardner
    Tested-by: Daniel J Blueman
    Tested-by: Anca Emanuel
    Cc: Bruno Prémont
    Cc: Alan Cox
    Cc: Paul Mundt
    Cc: Dave Airlie
    Cc: Andy Whitcroft
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

31 Mar, 2011

1 commit


17 Mar, 2011

1 commit

  • change from original version -- by advice of Paul Mundt
    1. remove videomemorysize definitions
    2. remove unifb_enable and unifb_setup
    3. use dev_warn instead of printk in fb driver
    4. remove judgement for FB_ACCEL_PUV3_UNIGFX
    5. adjust clk_get and clk_set_rate calls
    6. add resources definitions
    7. remove unifb_option
    8. adjust register for platform_device
    9. adjust unifb_ops position and unifb_regs assignment position

    Signed-off-by: Guan Xuetao
    Acked-by: Arnd Bergmann

    GuanXuetao
     

22 Dec, 2010

1 commit


17 Nov, 2010

1 commit

  • There is an integer overflow in fb_set_user_cmap() because cmap->len * 2
    can wrap. It's basically harmless. Your terminal will be messed up
    until you type reset.

    This patch does three things to fix the bug.

    First, it checks the return value of fb_copy_cmap() in fb_alloc_cmap().
    That is enough to fix address the overflow.

    Second it checks for the integer overflow in fb_set_user_cmap().

    Lastly I wanted to cap "cmap->len" in fb_set_user_cmap() much lower
    because it gets used to determine the size of allocation. Unfortunately
    no one knows what the limit should be. Instead what this patch does
    is makes the allocation happen with GFP_KERNEL instead of GFP_ATOMIC
    and lets the kmalloc() decide what values of cmap->len are reasonable.
    To do this, the patch introduces a function called fb_alloc_cmap_gfp()
    which is like fb_alloc_cmap() except that it takes a GFP flag.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Paul Mundt

    Dan Carpenter
     

15 Nov, 2010

2 commits


28 Oct, 2010

1 commit

  • fb_{read,write} access the framebuffer using lots of fb_{read,write}l's
    but don't check that the file position is aligned which can cause problems
    on some architectures which do not support unaligned accesses.

    Since the operations are essentially memcpy_{from,to}io, new
    fb_memcpy_{from,to}fb macros have been defined and these are used instead.

    For Sparc, fb_{read,write} macros use sbus_{read,write}, so this defines
    new sbus_memcpy_{from,to}io functions the same as memcpy_{from,to}io but
    using sbus_{read,write}b instead of {read,write}b.

    Signed-off-by: James Hogan
    Acked-by: David S. Miller
    Acked-by: Florian Tobias Schandinat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Hogan
     

11 Aug, 2010

1 commit

  • 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
     

05 Aug, 2010

1 commit

  • Add fb ops to handle enter/exit of the kernel debugger. If present, the
    fb core will register them with KGDB and they'll be called when the
    debugger is entered and exited. The new functions are responsible for
    switching to an appropriate debug framebuffer and restoring the
    interrupted state at exit time.

    Signed-off-by: Jesse Barnes
    Signed-off-by: Jason Wessel

    Jesse Barnes
     

20 Jul, 2010

1 commit


01 Jul, 2010

1 commit

  • When I added the flags I must have been using a 25 line terminal and missed the following flags.

    The collided with flag has one user in staging despite being in-tree for 5 years.

    I'm happy to push this via my drm tree unless someone really wants to do it.

    Signed-off-by: Dave Airlie
    Cc: stable@kernel.org

    Dave Airlie
     

28 May, 2010

1 commit


25 May, 2010

1 commit

  • FBIO_WAITFORVSYNC is currently implemented by matroxfb, atyfb, intelfb and
    more. All of them keep redefining the same FBIO_WAITFORVSYNC macro over
    and over again, so move it to linux/fb.h and clean up those duplicate
    defines.

    Signed-off-by: Grazvydas Ignotas
    Cc: Ville Syrjala
    Cc: Grant Likely
    Cc: Maik Broemme
    Cc: Petr Vandrovec
    Cc: Benjamin Herrenschmidt
    Cc: Krzysztof Helt
    Cc: "Hiremath, Vaibhav"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     

18 May, 2010

3 commits

  • let vga16fb claim 0xA0000+0x10000 region as its aperture;
    drm drivers don't use it, so we have to detect it and kick
    vga16fb manually - but only if drm is driving the primary card

    Signed-off-by: Marcin Slusarz
    Cc: James Simmons
    Cc: Dave Airlie
    Cc: Ben Skeggs
    Signed-off-by: Dave Airlie

    Marcin Slusarz
     
  • Currently vesafb/efifb/... is kicked when hardware driver is registering
    framebuffer. To do it hardware must be fully functional, so there's a short
    window between start of initialisation and framebuffer registration when
    two drivers touch the hardware. Unfortunately sometimes it breaks nouveau
    initialisation.

    Fix it by kicking firmware driver(s) before we start touching the hardware.

    Reported-by: Didier Spaier
    Tested-by: Didier Spaier
    Signed-off-by: Marcin Slusarz
    Cc: Ben Skeggs
    Cc: Peter Jones
    Cc: Andrew Morton
    Signed-off-by: Dave Airlie

    Marcin Slusarz
     
  • It removes a hack from nouveau code which had to detect which
    region to pass to kick vesafb/efifb.

    Signed-off-by: Marcin Slusarz
    Cc: Eric Anholt
    Cc: Ben Skeggs
    Cc: Thomas Hellstrom
    Cc: Dave Airlie
    Cc: Peter Jones
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Dave Airlie

    Marcin Slusarz
     

01 Mar, 2010

1 commit

  • Many new laptops now come with 2 gpus, one to be used for low power
    modes and one for gaming/on-ac applications. These GPUs are typically
    wired to the laptop panel and VGA ports via a multiplexer unit which
    is controlled via ACPI methods.

    4 combinations of systems typically exist - with 2 ACPI methods.
    Intel/ATI - Lenovo W500/T500 - use ATPX ACPI method
    ATI/ATI - some ASUS - use ATPX ACPI Method
    Intel/Nvidia - - use _DSM ACPI method
    Nvidia/Nvidia - - use _DSM ACPI method.

    TODO:
    This patch adds support for the ATPX method and initial bits
    for the _DSM methods that need to written by someone with
    access to the hardware.
    Add a proper non-debugfs interface - need to get some proper
    testing first.

    v2: add power up/down support for both devices
    on W500 puts i915/radeon into D3 and cuts power to radeon.

    v3: redo probing methods, no DMI list, drm devices call to
    register with switcheroo, it tries to find an ATPX method on
    any device and once there is two devices + ATPX it inits the
    switcher.

    v4: ATPX msg handling using buffers - should work on more machines

    v5: rearchitect after more mjg59 discussion - move ATPX handling to
    radeon driver.

    v6: add file headers + initial nouveau bits (to be filled out).

    v7: merge delayed switcher code.

    v8: avoid suspend/resume of gpu that is off

    v9: rearchitect - mjg59 is always right. - move all ATPX code to
    radeon, should allow simpler DSM also proper ATRM handling

    v10: add ATRM support for radeon BIOS, add mutex to lock vgasr_priv

    v11: fix bug in resuming Intel for 2nd time.

    v12: start fixing up nvidia code blindly.

    v13: blindly guess at finishing nvidia code

    v14: remove radeon audio hacks - fix up intel resume more like upstream

    v15: clean up printks + remove unnecessary igd/dis pointers

    mount debugfs

    /sys/kernel/debug/vgaswitcheroo/switch - should exist if ATPX detected
    + 2 cards.

    DIS - immediate change to discrete
    IGD - immediate change to IGD
    DDIS - delayed change to discrete
    DIGD - delayed change to IGD
    ON - turn on not in use
    OFF - turn off not in use

    Tested on W500 (Intel/ATI) and T500 (Intel/ATI)

    Signed-off-by: Dave Airlie

    Dave Airlie
     

11 Dec, 2009

1 commit


04 Dec, 2009

1 commit


12 Nov, 2009

1 commit

  • Remove fb_save_state() and fb_restore_state operations from frame buffer layer.
    They are used only in two drivers:
    1. savagefb - and cause bug #11248
    2. uvesafb

    Usage of these operations is misunderstood in both drivers so kill these
    operations, fix the bug #11248 and avoid confusion in the future.

    Tested on Savage 3D/MV card and the patch fixes the bug #11248.

    The frame buffer layer uses these funtions during switch between graphics
    and text mode of the console, but these drivers saves state before
    switching of the frame buffer (in the fb_open) and after releasing it (in
    the fb_release). This defeats the purpose of these operations.

    Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11248

    Signed-off-by: Krzysztof Helt
    Reported-by: Jochen Hein
    Tested-by: Jochen Hein
    Cc: Geert Uytterhoeven
    Cc: Michal Januszewski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     

12 Sep, 2009

1 commit

  • Add ID 99 for PXA3xx frame buffers and report it in the pxa frame buffer
    conditionally, depending on a new flag in struct pxafb_mach_info.

    Signed-off-by: Daniel Mack
    Cc: linux-fbdev-devel@lists.sourceforge.net
    Cc: Dennis Oliver Kropp
    Cc: Sven Neumann
    Cc: Guennadi Liakhovetski
    Signed-off-by: Eric Miao

    Daniel Mack
     

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

2 commits