1. 30 Jul, 2018 1 commit
  2. 20 Mar, 2018 1 commit
  3. 26 Nov, 2016 1 commit
  4. 05 Nov, 2016 1 commit
  5. 20 Jul, 2016 5 commits
    • Rob Clark's avatar
      freedreno: support growable cmdstream buffers · 419a154d
      Rob Clark authored
      
      
      The issue that userspace needed to solve is that there is ~two orders of
      magnitude size difference in cmdstream buffers (both for gmem commands
      and for draw commands), and that the previous practice of allocating
      worst-case sizes is quite wasteful.  Previously a submit would be
      constructed (for example) like:
      
        CMD  TARGET  DESCRIPTION
         g0    N     gmem/tiling commands
         b0    Y     binning commands
         d0    Y     draw commands
      
      Which, after the one non-IB-target cmd buffer is inserted into the
      kernel controlled ringbuffer, looks like (not to scale):
      
               b0:           d0:
              +-----+       +-----+
         IB1  | ... |       | ... |
              +-----+       +-----+
               ^             ^
               |             |
               +-----+       +-+---------+
               g0:   |         |         |
              +----+----+----+----+----+----+----
         IB0  | .. | IB | .. | IB | .. | IB | ...
              +----+----+----+----+----+----+----
               ^              tile0     tile1
               |
               +-----------+
        userspace          |
        ~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        kernel             |
                     ----+----+----
         ringbuffer  ... | IB | ...
                     ----+----+----
      
      Now, multiple physical cmdstream buffers per fd_ringbuffer are supported,
      so this becomes:
      
        CMD  TARGET  DESCRIPTION
         g0    N
         ...   N     gmem/tiling commands
         gN    N
         b0    Y
         ...   Y     binning commands
         bN    Y
         d0    Y
         ...   Y     draw commands
         dN    Y
      
      Which, after the non-IB-target cmd buffers (g0..gN) are inserted into
      the kernel controlled ringbuffer, looks like:
      
                   b0:      b1            d0:      d1
                  +-----+  +-----+        +-----+  +-----+
             IB1  | ... |  | ... | ...    | ... |  | ... | ...
                  +-----+  +-----+        +-----+  +-----+
                   ^        ^              ^        ^
                   |        |              |        |
                   |        +-+            |  +-----+------+
                   +-----+    |            |  |            |
                         |    |         +--+----------+    |
                   g0:   |    |         |     |       |    |
                  +----+----+----+----+----+----+---+----+----+----
             IB0  | .. | IB | IB | .. | IB | IB |.. | IB | IB |...
                  +----+----+----+----+----+----+---+----+----+----
                   ^                   tile0         tile1
                   | to b0  to b1
                   |   |      |          to|d0    to|d1
                   |   |      +----+       |      +-+-----------+
                   |   |           |       |      |             |
                   |   +------+    |       +-+-------------+    |
                   |    g1:   |    |         |    |        |    |
                   |   +----+----+----+----+----+----+---+----+----+----
             IB0   |   | .. | IB | IB | .. | IB | IB |.. | IB | IB |...
                   |   +----+----+----+----+----+----+---+----+----+----
                   |    ^                   tileX         tileY
                   |    |
                   |    +-----------+
                   +-----------+    |
            userspace          |    |
            ~~~~~~~~~~~~~~~~~~~|~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            kernel             |    |
                         ----+----+----+----
             ringbuffer  ... | IB | IB | ...
                         ----+----+----+----
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      419a154d
    • Rob Clark's avatar
      freedreno: fix potential leak at free · 19b82b98
      Rob Clark authored
      
      
      If user has emit'd reloc's, and then resets or deletes the ring, we want
      to drop the ref's that the ring holds to the bo's to avoid a leak.
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      19b82b98
    • Rob Clark's avatar
      freedreno: ocd · 9e697c74
      Rob Clark authored
      
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      9e697c74
    • Rob Clark's avatar
      freedreno: add simpler ring-reloc · 2ca73c66
      Rob Clark authored
      
      
      Provide a way to insert a reference (ie. OUT_IB()) to a target ring,
      executing all the cmds in the target ring from the start.
      
      Sometimes the ringmarker stuff is just overkill.  And it will won't
      really work properly once we support multiple physical cmdstream buffers
      per fd_ringbuffer.  So in the future the old ringmarker related APIs
      will be deprecated in a few releases.
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      2ca73c66
    • Rob Clark's avatar
      freedreno: rework internal ring->emit_reloc_ring() · 73db0a04
      Rob Clark authored
      
      
      No need for it to deal with ringmarkers.
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      73db0a04
  6. 28 Apr, 2015 1 commit
    • Emil Velikov's avatar
      drm: remove drm_public macro · 0f8da825
      Emil Velikov authored
      
      
      Some compilers (like the Oracle Studio), require that the function
      declaration must be annotated with the same visibility attribute as the
      definition. As annotating functions with drm_public is no longer
      required just remove the macro.
      
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Thierry Reding <treding@nvidia.com>
      Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
      0f8da825
  7. 28 Sep, 2014 1 commit
  8. 14 Aug, 2014 1 commit
  9. 19 Feb, 2014 1 commit
  10. 07 Jan, 2014 1 commit
  11. 28 Aug, 2013 1 commit
  12. 15 May, 2013 1 commit
  13. 25 Apr, 2013 1 commit
    • Rob Clark's avatar
      freedreno: add synchronization between mesa and ddx · b3a3a778
      Rob Clark authored
      
      
      Super-cheezy way to synchronization between mesa and ddx..  the
      SET_ACTIVE ioctl gives us a way to stash a 32b # w/ a GEM bo, and
      GET_BUFINFO gives us a way to retrieve it.  We use this to stash
      the timestamp of the last ISSUEIBCMDS on the buffer.
      
      To avoid an obscene amount of syscalls, we:
       1) Only set the timestamp for buffers w/ an flink name, ie.
          only buffers shared across processes.  This is enough to
          catch the DRI2 buffers.
       2) Only set the timestamp for buffers submitted to the 3d ring
          and only check the timestamps on buffers submitted to the
          2d ring.  This should be enough to handle synchronizing of
          presentation blit.  We could do synchronization in the other
          direction too, but that would be problematic if we are using
          the 3d ring from DDX, since client side wouldn't know this.
      
      The waiting on timestamp happens before flush, and setting of
      timestamp happens after flush.  It is transparent to the user
      of libdrm_freedreno as all the tracking of buffers happens via
      _emit_reloc()..
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      b3a3a778
  14. 13 Apr, 2013 1 commit
  15. 14 Feb, 2013 1 commit
    • Rob Clark's avatar
      freedreno: add freedreno DRM · 41fc2cc8
      Rob Clark authored
      
      
      The libdrm_freedreno helper layer for use by xf86-video-freedreno,
      fdre (freedreno r/e library and tests for driving gpu), and eventual
      gallium driver for the Adreno GPU.  This uses the msm gpu driver
      from QCOM's android kernel tree.
      
      Note that current msm kernel driver is a bit strange.  It provides a
      DRM interface for GEM, which is basically sufficient to have DRI2
      working.  But it does not provide KMS.  And interface to 2d and 3d
      cores is via different other devices (/dev/kgsl-*).  This is not
      quite how I'd write a DRM driver, but at this stage it is useful for
      xf86-video-freedreno and fdre (and eventual gallium driver) to be
      able to work on existing kernel driver from QCOM, to allow to
      capture cmdstream dumps from the binary blob drivers without having
      to reboot.  So libdrm_freedreno attempts to hide most of the crazy.
      The intention is that when there is a proper kernel driver, it will
      be mostly just changes in libdrm_freedreno to adapt the gallium
      driver and xf86-video-freedreno (ignoring the fbdev->KMS changes).
      
      So don't look at freedreno as an example of how to write a libdrm
      module or a DRM driver.. it is just an attempt to paper over a non-
      standard kernel driver architecture.
      
      v1: original
      v2: hold ref's to pending bo's (because qcom's kernel driver doesn't),
          various bug fixes, add ringbuffer markers so we can emit IB's to
          portion of ringbuffer (so that gallium driver can use a single
          ringbuffer for both tile cmds and draw cmds.
      Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
      41fc2cc8