1. 24 Oct, 2010 5 commits
  2. 23 Sep, 2010 5 commits
    • Florian Tobias Schandinat's avatar
      viafb: rename output devices · a2aa9f9f
      Florian Tobias Schandinat authored
      
      Now it looks like we finally know enough about the output devices to give
      them proper names. As VIA_96 is often referred to as DVP0 rename it to
      VIA_DVP0. As VIA_6C and VIA_93 seem to exist only on CLE266 and "replace"
      DVP0 and DVP1 there rename them to VIA_LDVP0 and VIA_LDVP1 (L as legacy).
      The proc names were changed accordingly which should be harmless as they
      were just introduced and not beyond RFC state.
      This patch should make things a bit more comfortable and less scary.
      Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Acked-by: default avatarJonathan Corbet <corbet@lwn.net>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      a2aa9f9f
    • Florian Tobias Schandinat's avatar
      viafb: add a mapping of supported output devices · dd7a0b08
      Florian Tobias Schandinat authored
      
      This patch maps supported output devices to IGP versions. This list may
      contain errors as most of it is derived of the driver source but it should
      be correct enough to provide a good help. The devices are exported via a
      proc entry in the same format as those showing the output devices per IGA.
      Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Acked-by: default avatarJonathan Corbet <corbet@lwn.net>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      dd7a0b08
    • Florian Tobias Schandinat's avatar
      viafb: introduce per output device power management · 6f9422d4
      Florian Tobias Schandinat authored
      
      This patch moves common parts of dvi.c, lcd.c and vt1636.c to hw.c to
      start a per output device power management. There should be no runtime
      changes aside that this patch enables the proc interface to enable/disable
      devices when needed which greatly increases the chances that changes to
      the output device configuration will work. However the power management is
      not yet complete so it might fail on some configurations. As this area is
      quite complex and touches undocumented things there is a slight chance of
      regressions.
      Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      6f9422d4
    • Florian Tobias Schandinat's avatar
      viafb: add interface for output device configuration · 2a918392
      Florian Tobias Schandinat authored
      
      This patch extends the proc entry to contain a possibility to view and
      change the output devices for each IGA. This is useful for debugging
      output problems as it provides a reliable way to query which low level
      devices are active after VIAs output device configuration nightmare
      happended. It's as well suitable for daily use as one can change the
      output configuration on the fly for example to connect a projector.
      At the moment it's still unstable. The reason is that we have to handle
      a bunch of undocumented output devices (those without a proper name) and
      that this patch is the first step to collect and verify the needed
      information. Basically the only configuration change that is expected to
      work at the moment is switching output devices between IGA1 and IGA2.
      Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Acked-by: default avatarJonathan Corbet <corbet@lwn.net>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      2a918392
    • Florian Tobias Schandinat's avatar
      viafb: propagate __init and __devinit · f4ab2f7a
      Florian Tobias Schandinat authored
      
      There are a lot of init functions which are not marked as such.
      Fix this.
      Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      f4ab2f7a
  3. 23 Jul, 2010 4 commits
  4. 27 May, 2010 1 commit
    • Julia Lawall's avatar
      drivers/video/via: use memdup_user · a51faabc
      Julia Lawall authored
      Use memdup_user when user data is immediately copied into the
      allocated region.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/
      
      )
      
      // <smpl>
      @@
      expression from,to,size,flag;
      position p;
      identifier l1,l2;
      @@
      
      -  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
      +  to = memdup_user(from,size);
         if (
      -      to==NULL
      +      IS_ERR(to)
                       || ...) {
         <+... when != goto l1;
      -  -ENOMEM
      +  PTR_ERR(to)
         ...+>
         }
      -  if (copy_from_user(to, from, size) != 0) {
      -    <+... when != goto l2;
      -    -EFAULT
      -    ...+>
      -  }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a51faabc
  5. 11 May, 2010 1 commit
  6. 07 May, 2010 5 commits
  7. 27 Apr, 2010 1 commit
    • Harald Welte's avatar
      viafb: rework the I2C support in the VIA framebuffer driver · 277d32a3
      Harald Welte authored
      
      This patch changes the way how the various I2C busses are used internally
      inside the viafb driver:  Previosuly, only a single i2c_adapter was created,
      even though two different hardware I2C busses are accessed: A structure member
      in a global variable was modified to indicate the bus to be used.
      
      Now, all existing hardware busses are registered with the i2c core, and the
      viafb_i2c_{read,write}byte[s]() function take the adapter number as function
      call parameter, rather than referring to the global structure member.
      
      [jc: even more painful merge with mainline changes ->2.6.34]
      [jc: painful merge with OLPC changes]
      
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: ScottFang@viatech.com.cn
      Cc: JosephChan@via.com.tw
      Signed-off-by: default avatarHarald Welte <HaraldWelte@viatech.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      277d32a3
  8. 20 Apr, 2010 3 commits
    • Jonathan Corbet's avatar
      viafb: Unmap the frame buffer on initialization error · 1b1f8cd2
      Jonathan Corbet authored
      
      This was part of Harald's "make viafb a first-class citizen using
      pci_driver" patch, but somehow got dropped when that patch went into
      mainline.
      
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: ScottFang@viatech.com.cn
      Cc: JosephChan@via.com.tw
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      1b1f8cd2
    • Harald Welte's avatar
      viafb: use proper pci config API · b72a5070
      Harald Welte authored
      
      This patch alters viafb to use the proper Linux in-kernel API to access
      PCI configuration space, rather than poking at I/O ports by itself.
      
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: ScottFang@viatech.com.cn
      Cc: JosephChan@via.com.tw
      Signed-off-by: default avatarHarald Welte <HaraldWelte@viatech.com>
      b72a5070
    • Harald Welte's avatar
      viafb: Fix various resource leaks during module_init() · 109771a6
      Harald Welte authored
      
      The current code executed from module_init() in viafb does not have
      proper error checking and [partial] resoure release paths in case
      an error happens half way through driver initialization.
      
      This patch adresses the most obvious of those issues, such as a
      leftover i2c bus if module_init (and thus module load) fails.
      
      [jc: fixed merge conflicts]
      [jc: also restored -ENOMEM return on ioremap() fail]
      
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: ScottFang@viatech.com.cn
      Cc: JosephChan@via.com.tw
      Signed-off-by: default avatarHarald Welte <HaraldWelte@viatech.com>
      109771a6
  9. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  10. 12 Mar, 2010 12 commits
  11. 16 Jan, 2010 2 commits