1. 05 6月, 2015 1 次提交
    • F
      drm/qxl: Move main reference counter to GEM object instead of TTM ones · e07154e2
      Frediano Ziglio 提交于
      qxl_bo structure has two reference counters, one in the GEM object and
      another in the TTM object. The GEM object keep a counter to the TTM object
      so when GEM counter reached zero the TTM counter (using qxl_bo_unref) was
      decremented. The qxl object is fully freed (both GEM and TTM part are cleaned)
      when the TTM counter reach zero.
      One issue was that surface idr structure has no owning on qxl_bo objects however
      it contains a pointer to qxl_bo object. This caused some nasty race condition
      for instance qxl_bo object was reaped even after counter was already zero.
      This patch fix these races moving main counter (the one used by qxl_bo_(un)ref)
      to GEM object which cleanup routine (qxl_gem_object_free) remove the idr pointer
      (using qxl_surface_evict) when the counters are still valid.
      Signed-off-by: NFrediano Ziglio <fziglio@redhat.com>
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e07154e2
  2. 30 9月, 2014 1 次提交
  3. 02 9月, 2014 1 次提交
  4. 27 8月, 2014 1 次提交
  5. 16 3月, 2014 2 次提交
    • D
      drm: init TTM dev_mapping in ttm_bo_device_init() · 44d847b7
      David Herrmann 提交于
      With dev->anon_inode we have a global address_space ready for operation
      right from the beginning. Therefore, there is no need to do a delayed
      setup with TTM. Instead, set dev_mapping during initialization in
      ttm_bo_device_init() and remove any "if (dev_mapping)" conditions.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      44d847b7
    • D
      drm: use anon-inode instead of relying on cdevs · 6796cb16
      David Herrmann 提交于
      DRM drivers share a common address_space across all character-devices of a
      single DRM device. This allows simple buffer eviction and mapping-control.
      However, DRM core currently waits for the first ->open() on any char-dev
      to mark the underlying inode as backing inode of the device. This delayed
      initialization causes ugly conditions all over the place:
        if (dev->dev_mapping)
          do_sth();
      
      To avoid delayed initialization and to stop reusing the inode of the
      char-dev, we allocate an anonymous inode for each DRM device and reset
      filp->f_mapping to it on ->open().
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      6796cb16
  6. 19 8月, 2013 1 次提交
  7. 24 7月, 2013 2 次提交
    • D
      qxl: convert qxl driver to proper use for reservations · 8002db63
      Dave Airlie 提交于
      The recent addition of lockdep support to reservations and their subsequent
      use by TTM showed up a number of potential problems with the way qxl was using
      TTM objects.
      
      a) it was allocating objects, and reserving them later without validating
      underneath the reservation, which meant in extreme conditions the objects could
      be evicted before the reservation ever used them.
      
      b) it was reserving objects straight after allocating them, but with no
      ability to back off should the reservations fail. It now allocates the necessary
      objects then does a complete reservation pass on them to avoid deadlocks.
      
      c) it had two lists per release tracking objects, unnecessary complicating
      the reservation process.
      
      This patch removes the dual object tracking, adds reservations ticket support
      to the release and fence object handling. It then ports the internal fb
      drawing code and the userspace facing ioctl to use the new interfaces properly,
      along with cleanup up the error path handling in some codepaths.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8002db63
    • D
      qxl: allow creation of pre-pinned objects and use for releases. · 4f49ec92
      Dave Airlie 提交于
      In order to fix an issue with reservations we need to create the releases
      as pre-pinned objects, this changes the placement interface and bo creation
      interface to allow creating pinned objects to save nested reservations later.
      
      This is just a stepping stone to main fix which follows to actually fix how
      qxl deals with reservations.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      4f49ec92
  8. 05 7月, 2013 2 次提交
  9. 16 4月, 2013 1 次提交
    • D
      drm/qxl: fix smatch warnings · 62c8ba7c
      Dave Airlie 提交于
      drivers/gpu/drm/qxl/qxl_display.c:99 qxl_alloc_client_monitors_config() error: dereferencing freed memory 'qdev->client_monitors_config'
      drivers/gpu/drm/qxl/qxl_object.c:66 qxl_ttm_placement_from_domain() warn: bitwise AND condition is false here
      drivers/gpu/drm/qxl/qxl_ioctl.c:353 qxl_clientcap_ioctl() warn: buffer overflow 'qdev->rom->client_capabilities' 58 <= 58
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      62c8ba7c
  10. 12 4月, 2013 1 次提交
    • D
      drm: add new QXL driver. (v1.4) · f64122c1
      Dave Airlie 提交于
      QXL is a paravirtual graphics device used by the Spice virtual desktop
      interface.
      
      The drivers uses GEM and TTM to manage memory, the qxl hw fencing however
      is quite different than normal TTM expects, we have to keep track of a number
      of non-linear fence ids per bo that we need to have released by the hardware.
      
      The releases are freed from a workqueue that wakes up and processes the
      release ring.
      
      releases are suballocated from a BO, there are 3 release categories, drawables,
      surfaces and cursor cmds. The hw also has 3 rings for commands, cursor and release handling.
      
      The hardware also have a surface id tracking mechnaism and the driver encapsulates it completely inside the kernel, userspace never sees the actual hw surface
      ids.
      
      This requires a newer version of the QXL userspace driver, so shouldn't be
      enabled until that has been placed into your distro of choice.
      
      Authors: Dave Airlie, Alon Levy
      
      v1.1: fixup some issues in the ioctl interface with padding
      v1.2: add module device table
      v1.3: fix nomodeset, fbcon leak, dumb bo create, release ring irq,
            don't try flush release ring (broken hw), fix -modesetting.
      v1.4: fbcon cpu usage reduction + suitable accel flags.
      Signed-off-by: NAlon Levy <alevy@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      f64122c1