1. 08 5月, 2010 1 次提交
  2. 28 4月, 2010 1 次提交
    • H
      viafb: rework the I2C support in the VIA framebuffer driver · 277d32a3
      Harald Welte 提交于
      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: NHarald Welte <HaraldWelte@viatech.com>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      277d32a3
  3. 13 3月, 2010 3 次提交
  4. 23 9月, 2009 11 次提交
    • F
      viafb: hardware acceleration initialization cleanup · 31de59d5
      Florian Tobias Schandinat 提交于
      The main motivation of this patch was to merge the three initialization
      functions in one and clean it up. However as some changes in other code
      areas where needed to do it right some small other changes were made.
      
      Changes to viafb_par:
      
      io_virt renamed as engine_mmio and moved to shared
      VQ_start renamed as vq_vram_addr and moved to shared
      VQ_end removed as it is easily recalculatable
      
      vq_vram_addr is not strictly needed but keep it to track where we
      allocated video memory.  The memory allocated for the virtual queue was
      shrunk to VQ_SIZE as VQ_SIZE+CURSOR_SIZE looked like a bug to me.  But to
      be honest I don't have the faintest idea what virtual queues are for in
      the graphic hardware and whether the driver needs them in any way.  I only
      know that they aren't directly accessed by the driver and so the only
      potential current use would be as hardware internal buffers.  For now keep
      them to avoid regressions and only remove the double cursor allocation.
      
      The most changes were caused by renames and the mentioned structure
      changes so the chance of regressions is pretty low.  The meaning of
      viafb_accel changed slightly as previously it was changed back and forth
      in the code and allowed to enable the hardware acceleration by software if
      previously disabled.  The new behaviour is that viafb_accel=0 always
      prevents hardware acceleration.  With viafb_accel!=0 the acceleration can
      be freely choosen by set_var.  This means viafb_accel is a diagnostic tool
      and if someone has to use viafb_accel=0 the driver needs to be fixed.
      
      As this is mostly a code cleanup no regressions beside the slightly change
      of viafb_accel is expected.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31de59d5
    • F
      viafb: improve pitch handling · 2d6e8851
      Florian Tobias Schandinat 提交于
      Split the pitch handling up and replaces the calculation from virtual xres
      and bpp with fix.line_length which already contains the pitch and does not
      add any constrains for the virtual resolution.
      
      Also add a bit to the second pitch which the documentation mentions but
      which was ignored by the driver.
      
      Although it is a bit unclear what the right pitch for some LCD modes is
      this patch should have no negative runtime impact.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2d6e8851
    • F
      viafb: cleanup viafb_cursor · 5016af53
      Florian Tobias Schandinat 提交于
      Clean the hardware cursor handling up.
      
      The most notable change is that it no longer buffers the values in
      viacursor but uses the ones in cursor instead as they are guaranteed to be
      always valid.
      
      Furthermore it uses local instead global variables where possible, moves
      the cursor variable in shared as only one hardware cursor is supported and
      returns an error if memory allocation fails.  Last but not least it fixes
      a too small buffer (as u32 has only 4 and not 32 bytes) but this did not
      produce any known problems.
      
      This is mostly a code cleanup, no negative runtime changes are expected.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5016af53
    • F
      viafb: 2D engine rewrite · c3e25673
      Florian Tobias Schandinat 提交于
      This patch is a completly rewritten 2D engine.  The engine is no longer in
      a default state but reinitialized every time to allow usage for both
      framebuffers regardless of their settings.
      
      The whole engine handling is concentrated in a big function which takes 16
      parameters.  Although the number of parameters is worryingly it is good to
      have a single funtion to deal with this stuff as it allows to easily
      support different engines and avoids some code duplication.
      
      On the way support for the new 2D engine in VX800 was added.  As the with
      less code duplication but it is probably better to duplicate the code as
      this way is easier to walk if VIA ever decides to release a new engine
      which changes anything the driver touches.
      
      The engine support for VX800 gives a notable boost in speed.  There are no
      known regressions but as this patch changes paths I do neither have the
      hardware nor documentation to check and has the possibility to put the
      system in a critical state heavy testing is appreciated.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c3e25673
    • F
      viafb: improve viafb_par · c4df5489
      Florian Tobias Schandinat 提交于
      This patch introduces viafb_shared and is the beginning of a smooth
      transition to use it.
      
      viafb_shared should contain all general, non-surface specific data that
      should be shared along all viafb framebuffers while viafb_par should only
      contain things that are specific to each surface or in other words extend
      fb_info.  This change is intended to clean the dual/multi framebuffer
      handling up.
      
      This removes the annoyance that viafbinfo1->par points to a different
      structure than viaparinfo1.
      
      As the last change is fundamental it is difficult to ensure that all parts
      of the driver do not depend on the previous brokenness but the chance of
      regressions is very low.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c4df5489
    • F
      viafb: another small cleanup of viafb_par · 68fa9208
      Florian Tobias Schandinat 提交于
      This removes the completly useless io variable as well as the temporary
      used variables mmio_base and mmio_len in favor to use directly the fb_info
      variables.
      
      This is a code cleanup only, no runtime change expected.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      68fa9208
    • F
      viafb: remove unused video device stuff · b852abc2
      Florian Tobias Schandinat 提交于
      Remove everything related to video devices from the driver as it did not
      influence the driver operation.  This patch does change the userspace
      behaviour as it removes two IOCTLs and one module parameter.  But this is
      good as it removes useless stuff and helps the user to figure out the
      options that do affect the driver behaviour (which are still too many).
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b852abc2
    • F
      viafb: clean up virtual memory handling · db88e382
      Florian Tobias Schandinat 提交于
      Clean the handling of ioremapped video memory up.  The following changes
      were made:
      
      info->screen_base - viafb_FB_MM
      (VRAM offset calculation) was replaced by
      info->fix.smem_start - viafbinfo->fix.smem_start
      which is essentially the same calculation but done with physical instead
      virtual addresses.
      
      *->fbmem_virt
      was replaced by
      viafbinfo->screen_base
      This is true for viafbinfo and viafbinfo1 as the par pointers are equal.
      
      An early initialization of viafbinfo1->fix.smem* was removed as done later
      in viafb_setup_fixinfo.
      
      This patch highlights that the only usage of the ioremapped video memory
      in the driver is for hardware cursor handling.  Even if it has to hold the
      used virtual screen mapped for old-fashioned read/write calls (vs.
      mmap'ed) a lot virtual memory could be saved by only ioremapping on
      demand.
      
      Code cleanup, no runtime changes expected.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      db88e382
    • F
      viafb: clean up duoview · b008c64b
      Florian Tobias Schandinat 提交于
      Clean the duoview handling up by replacing the varible with the funtion in
      the only place where it is used.  This is a code cleanup only, no runtime
      change expected.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b008c64b
    • F
      viafb: remove duplicated mode information · 13147f29
      Florian Tobias Schandinat 提交于
      Remove the mode information from viafbdev.c and uses the one of viamode.c
      instead.  This is possible because horizontal and vertical address are the
      same as horizontal and vertical resolution.  The reduced blanking modes in
      the table are no problem because they have a higher index than the normal
      modes and therefore always the normal modes are selected just as the old
      behaviour.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      13147f29
    • F
      viafb: merge viafb_update_viafb_par in viafb_update_fix · 81228a36
      Florian Tobias Schandinat 提交于
      Shrink and merge viafb_update_viafb_par.  This removes a lot of duplicated
      data in viafb_par.  Use the relevant data of fb_info instead.  On the way
      it removes an inconsistency in handling a second framebuffer which only
      worked because viafbinfo1->par is modified to point to the same viafb_par
      as viafbinfo->par.
      
      Code cleanup only, no runtime change expected.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Cc: Harald Welte <laforge@gnumonks.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      81228a36
  5. 08 8月, 2009 1 次提交
    • F
      viafb: fix rmmod bug · 52159444
      Florian Tobias Schandinat 提交于
      This fixes a bug caused by changing pointers (viafb_mode, viafb_mode1)
      assigned by module_param.  It reduces driver complexity by not needlessly
      changing these vars as they are only read once and removing now
      superfluous code.
      
      On unpatched kernels loading viafb with viafb_mode or viafb_mode1 option
      used and afterwards unloading it results in:
      
      kernel BUG at mm/slub.c:2926!
      invalid opcode: 0000 [#1] PREEMPT
      last sysfs file: /sys/devices/virtual/block/loop0/removable
      Modules linked in: snd_hda_codec_realtek snd_hda_intel snd_hda_codec
      snd_hwdep snd_pcm rtl8187 snd_timer eeprom_93cx6 mmc_block snd soundcore
      via_sdmmc fb snd_page_alloc i2c_algo_bit i2c_viapro ehci_hcd uhci_hcd
      cfbcopyarea mmc_core cfbimgblt cfbfillrect video output [last unloaded:
      viafb]
      
        Pid: 3355, comm: rmmod Not tainted (2.6.31-rc1 #0)
        EIP: 0060:[<c106a759>] EFLAGS: 00010246 CPU: 0
        EIP is at kfree+0x80/0xda
        EAX: c17c2da0 EBX: dc7edbdc ECX: 0000010f EDX: 00000000
        ESI: c102c700 EDI: dc7ed8fa EBP: d703ff2c ESP: d703ff20
         DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
        Process rmmod (pid: 3355, ti=d703e000 task=db1412c0 task.ti=d703e000)
        Stack:
         dc7edbdc 00000014 00000016 d703ff40 c102c700 dc7f45d4 dc7f45d4 00000880
         d703ff4c c103e571 00000000 d703ffac c103e751 66616976 da140062 db89ba80
         00000328 d702edf8 db89ba80 d703ff9c c105d0f0 00000200 da14f898 00000014
        Call Trace:
         [<c102c700>] ? destroy_params+0x1e/0x2b
         [<c103e571>] ? free_module+0xa2/0xd7
         [<c103e751>] ? sys_delete_module+0x1ab/0x1da
         [<c105d0f0>] ? do_munmap+0x20a/0x225
         [<c10029b4>] ? sysenter_do_call+0x12/0x26
        Code: 10 76 7a 8d 87 00 00 00 40 c1 e8 0c c1 e0 05 03 05 1c 87 41 c1 66 83 38 00 79 03 8b 40 0c 8b 10 84 d2 78 12 66 f7 c2 00 c0 75 04 <0f> 0b eb fe e8 6f 5a fe ff eb 47 8b 55 04 8b 58 0c 9c 5e fa 3b
        EIP: [<c106a759>] kfree+0x80/0xda SS:ESP 0068:d703ff20
      
      This is caused by the current code changing the pointers assigned by
      module_param.  During unload it tries to free the memory the pointers
      point at which is now part of an internal structure.
      
      The patch simply avoids changing the pointers.  This is okay as they are
      read only once during the initialization process.
      Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Scott Fang <ScottFang@viatech.com.cn>
      Cc: Joseph Chan <JosephChan@via.com.tw>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      52159444
  6. 17 10月, 2008 1 次提交