1. 06 Sep, 2013 1 commit
    • Siarhei Siamashka's avatar
      sunxi: Only enable scaler for the layer when it is really necessary · 64a0d642
      Siarhei Siamashka authored
      
      
      Now the scaler is enabled for the sunxi disp layer only when we want
      to use it for YUV format with XV. Whenever the layer is configured
      for RGB format or deactivated, the scaler gets disabled.
      
      This should make the driver more friendly to the other potential
      scaled layer users. The total number of available scalers is only
      2 for Allwinner A10 and only 1 for Allwinner A13.
      
      The potential drawback is that now we may get an error when trying
      to enable the scaler (if somebody else has used up all the available
      scalers) instead of always having it reserved and ready for use.
      Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
      64a0d642
  2. 20 Jul, 2013 1 commit
    • Harm Hanemaaijer's avatar
      Fix XV border artifacts when using gstreamer 1.0 · 0a3dbfba
      Harm Hanemaaijer authored
      Since version 1.0, gstreamer (when using xvimagesink) often
      allocates a larger XV image for the video with padding on all
      four sides and then calls XvPutImage() to render a part of this
      image. With the current XV implementation this results in
      artifacts on the borders of the image, with a green bar at the
      bottom.
      
      I am observing this when playing a 1280x720 video on a 1920x1080
      screen at 32bpp, the size of the video window doesn't matter.
      
      This problem seems to be an exaggeration of the one described in
      https://bugzilla.gnome.org/show_bug.cgi?id=685305
      
      .
      
      The solution appears to be to use the source area dimensions as
      requested in the XvPutImage() call, as opposed to the dimensions
      of the originally allocated image, and to honour the offsets
      (src_x, src_y) when setting the source region on the display
      controller. With this relatively simple change, the problem seems
      to go away, and gstreamer 1.0 (which is faster than gstreamer 0.10
      due to a zero-copy strategy) provides an acceptable solution for
      video playback.
      Signed-off-by: default avatarHarm Hanemaaijer <fgenfb@yahoo.com>
      0a3dbfba
  3. 11 Jul, 2013 1 commit
  4. 07 Jun, 2013 1 commit
    • Siarhei Siamashka's avatar
      G2D: Fallback to NEON optimized CPU backend for unsupported blits · cc8e2c79
      Siarhei Siamashka authored
      
      
      The G2D driver only supports framebuffer->framebuffer blits and
      also can't be used to accelerate dragging windows to the right
      (without hacking the kernel driver to do two-pass blit there).
      This patch adds fallback to NEON optimized CPU backend instead
      of resorting to use poorly performing fbBlt in these cases.
      
      Note: we assume that ioctls normally do not fail (even if they
            do, the slow old style fallback to fbBlt is not the worst
            thing to worry about).
      Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
      cc8e2c79
  5. 02 Jun, 2013 2 commits
    • Harm Hanemaaijer's avatar
      G2D: Implement "double speed" 16bpp blits · 98f1b119
      Harm Hanemaaijer authored
      
      
      When source and destination coordinates allow it, a 16bpp screen-to-
      screen blit is divided into up to three segments: two optional one
      pixel wide edges and an  aligned middle segment that is copied in
      32-bit mode.
      
      This patch adds the low-level function sunxi_g2d_blit_r5g6b5_in_three
      and adds logic to the general blit function to use it for 16bpp to
      16bpp blits if the source and destination coordinates allow it. This
      patch automatically enables the use of this optimization in the
      sunxi G2D X driver. The area threshold for using G2D for
      16bpp-to-16bpp blits was introduced in a previous patch.
      
      Benchmarks:
      
      1920x1080x16bpp@60Hz, ShadowFB disabled:
      
      x11perf -scroll100
      Before:
       350000 trep @   0.0881 msec ( 11400.0/sec): Scroll 100x100 pixels
      After:
       350000 trep @   0.0819 msec ( 12200.0/sec): Scroll 100x100 pixels
      
      x11perf -scroll500
      Before:
        20000 trep @   1.3547 msec (   738.0/sec): Scroll 500x500 pixels
      After:
        35000 trep @   0.8005 msec (  1250.0/sec): Scroll 500x500 pixels
      Signed-off-by: default avatarHarm Hanemaaijer <fgenfb@yahoo.com>
      98f1b119
    • Harm Hanemaaijer's avatar
      G2D: Implement an area threshold for using G2D blits. · b3c2fd2c
      Harm Hanemaaijer authored
      
      
      Due to the overhead of G2D for small screen-to-screen blits, CPU blits
      are faster for small areas. This patch introduces are threshold below
      which CPU blits are triggered. It is currently set to 1000 for 32bpp
      and 2500 for 16bpp based on test results.
      
      Some benchmarks:
      
      1920x1080x16bppx60Hz, ShadowFB disabled:
      
      x11perf -scroll10
      
      Before:
      1500000 trep @   0.0239 msec ( 41800.0/sec): Scroll 10x10 pixels
      After:
      2500000 trep @   0.0110 msec ( 90900.0/sec): Scroll 10x10 pixels
      
      x11perf -copywinwin10
      
      Before:
      1200000 trep @   0.0247 msec ( 40500.0/sec): Copy 10x10 from window to window
      After:
      1800000 trep @   0.0146 msec ( 68600.0/sec): Copy 10x10 from window to window
      Signed-off-by: default avatarHarm Hanemaaijer <fgenfb@yahoo.com>
      b3c2fd2c
  6. 28 Mar, 2013 1 commit
  7. 26 Mar, 2013 1 commit
    • Siarhei Siamashka's avatar
      G2D: Now sunxi_x_g2d.c code does not require sunxi disp anymore · 1cd5f084
      Siarhei Siamashka authored
      
      
      The sunxi_x_g2d.c file contains the midlayer code for hooking the
      G2D optimized blit into xserver. But in fact it does not strictly
      need to depend on anything sunxi specific.
      
      So now we introduce a simple "blt2d_i" interface struct which
      specifically provides a pointer to the accelerated blit function.
      And just use this interface struct instead of the whole "sunxi_disp_t".
      This allows to easily reuse the same code for other non-G2D or even
      non-sunxi blit implementations in the future.
      Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
      1cd5f084
  8. 21 Mar, 2013 1 commit
    • Siarhei Siamashka's avatar
      G2D: accelerate CopyArea between different pixmaps in framebuffer · cc1b1410
      Siarhei Siamashka authored
      
      
      Now source and destination pixmaps don't need to be the same for
      using G2D acceleration (as long as both of them are allocated in
      the framebuffer). This allows using G2D to copy pixels from DRI2
      buffers to the framebuffer on the fallback path (when the window
      of an OpenGL ES application is partially overlapped by some other
      windows). Though it only works when composite extension is
      disabled, for example by adding the following to xorg.conf:
      
          Section "Extensions"
              Option "Composite" "Disable"
          EndSection
      
      If composite extension is enabled, windows have backing pixmaps, and
      we have a longer chain of copies:
      
         DRI2 buffer -> backing pixmap -> framebuffer
      
      Because backing pixmap is not allocated in a physically contiguous
      memory, it can't be copied using G2D yet.
      Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
      cc1b1410
  9. 19 Mar, 2013 1 commit
  10. 14 Mar, 2013 1 commit
  11. 13 Mar, 2013 1 commit
    • Siarhei Siamashka's avatar
      Added ioctl wrappers for simple G2D fill and blit operations · df534b22
      Siarhei Siamashka authored
      
      
      The existing kernel driver from Allwinner for G2D accelerator
      is quite bad because ioctls are synchronous and blocking the
      caller thread, compromise security (basically it is a backdoor
      for copying data in memory between any arbitrary physical
      addresses) and have high overhead (each individual fill or
      blit operation needs an ioctl). But we need to start with
      something, so use this stuff as a placeholder.
      
      The g2d_driver.h header file is taken from linux-sunxi-3.4
      Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
      df534b22
  12. 12 Mar, 2013 1 commit
  13. 18 Feb, 2013 1 commit
    • Siarhei Siamashka's avatar
      Add support for hardware ARGB cursors up to 32x32 size · 06ae9b68
      Siarhei Siamashka authored
      
      
      Actually they are converted to 32x32 with 256 color palette. In the
      case if we have more than 256 unique colors, the color components
      of the pixels are reduced from 8-bit to 7-bit, then to 6-bit if
      necessary and so on (until we reduce the number of unique colors
      so that they can fit the palette). In the worst case we may
      theoretically end up with just 2 bits per A, R, G and B channels,
      but in practice 7 or 6 bits seem to be enough.
      Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
      06ae9b68
  14. 20 Jan, 2013 1 commit
    • Siarhei Siamashka's avatar
      Added supplementary wrapper functions for sunxi display controller ioctls · bf7c7a6c
      Siarhei Siamashka authored
      Note: the header file "sunxi_disp_ioctl.h" is GPL licensed. So until
      it is gets a MIT/X11 replacement, the DDX driver is GPL licensed as
      a whole. The individual source files still have their own license.
      Also in order to avoid any possible confusion, the MIT/X11 license
      header from COPYING has been added to "fbdev.c" and "fbdev_priv.h".
      bf7c7a6c