1. 10 8月, 2014 9 次提交
  2. 22 7月, 2014 1 次提交
  3. 26 3月, 2014 1 次提交
    • A
      support for platform devices · 420b9469
      Alexandre Courbot 提交于
      Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead
      of PCI to which Nouveau is tightly dependent. This patch allows Nouveau
      to handle platform devices by:
      
      - abstracting PCI-dependent functions that were typically used for
        resource querying and page mapping,
      - introducing a nv_device_is_pci() function that allows to make
        PCI-dependent code conditional,
      - providing a nouveau_drm_platform_probe() function that takes a GPU
        platform device to be probed.
      
      Core code as well as engine/subdev drivers are updated wherever possible
      to make use of these functions. Some older drivers are too dependent on
      PCI to be properly updated, but all newer code on which future chips may
      depend should at least be runnable with platform devices.
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      420b9469
  4. 18 2月, 2014 1 次提交
  5. 23 1月, 2014 6 次提交
  6. 14 11月, 2013 2 次提交
  7. 08 11月, 2013 2 次提交
  8. 09 10月, 2013 1 次提交
    • D
      drm/nouveau: embed gem object in nouveau_bo · 55fb74ad
      David Herrmann 提交于
      There is no reason to keep the gem object separately allocated. nouveau is
      the last user of gem_obj->driver_private, so if we embed it, we can get
      rid of 8bytes per gem-object.
      
      The implementation follows the radeon driver. bo->gem is only valid, iff
      the bo was created via the gem helpers _and_ iff the user holds a valid
      gem reference. That is, as the gem object holds a reference to the
      nouveau_bo. If you use nouveau_ref() to gain a bo reference, you are not
      guaranteed to also hold a gem reference. The gem object might get
      destroyed after the last user drops the gem-ref via
      drm_gem_object_unreference(). Use drm_gem_object_reference() to gain a
      gem-reference.
      
      For debugging, we can use bo->gem.filp != NULL to test whether a gem-bo is
      valid. However, this shouldn't be used for real functionality to avoid
      gem-internal dependencies.
      
      Note that the implementation follows the previous style. However, we no
      longer can check for bo->gem != NULL to test for a valid gem object. This
      wasn't done before, so we should be safe now.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Reviewed-by: NBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      55fb74ad
  9. 27 8月, 2013 1 次提交
    • D
      drm: verify vma access in TTM+GEM drivers · acb46527
      David Herrmann 提交于
      GEM does already a good job in tracking access to gem buffers via handles
      and drm_vma access management. However, TTM drivers currently do not
      verify this during mmap().
      
      TTM provides the verify_access() callback to test this. So fix all drivers
      to actually call into gem+vma to verify access instead of always returning
      0.
      
      All drivers assume that user-space can only get access to TTM buffers via
      GEM handles. So whenever the verify_access() callback is called from
      ttm_bo_mmap(), the buffer must have a valid embedded gem object. This is
      true for all TTM+GEM drivers. But that's why this patch doesn't touch pure
      TTM drivers (ie, vmwgfx).
      
      v2: Switch to drm_vma_node_verify_access() to correctly return -EACCES if
          access was denied.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      acb46527
  10. 30 7月, 2013 1 次提交
    • M
      drm/nouveau: fix size check for cards without vm · 35095f75
      Maarten Lankhorst 提交于
      Op 24-07-13 17:55, Dan Carpenter schreef:
      > Hello Maarten Lankhorst,
      >
      > This is a semi-automatic email about new static checker warnings.
      >
      > The patch 0108bc80: "drm/nouveau: do not allow negative sizes for
      > now" from Jul 7, 2013, leads to the following Smatch complaint:
      >
      > drivers/gpu/drm/nouveau/nouveau_bo.c:222 nouveau_bo_new()
      > 	 warn: variable dereferenced before check 'drm->client.base.vm' (see line 201)
      >
      > drivers/gpu/drm/nouveau/nouveau_bo.c
      >    200		int type = ttm_bo_type_device;
      >    201		int max_size = INT_MAX & ~((1 << drm->client.base.vm->vmm->lpg_shift) - 1);
      >                                                  ^^^^^^^^^^^^^^^^^^^
      > New dereference.
      >
      >    202
      >    203		if (size <= 0 || size > max_size) {
      >    204			nv_warn(drm, "skipped size %x\n", (u32)size);
      >    205			return -EINVAL;
      >    206		}
      >    207
      >    208		if (sg)
      >    209			type = ttm_bo_type_sg;
      >    210
      >    211		nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL);
      >    212		if (!nvbo)
      >    213			return -ENOMEM;
      >    214		INIT_LIST_HEAD(&nvbo->head);
      >    215		INIT_LIST_HEAD(&nvbo->entry);
      >    216		INIT_LIST_HEAD(&nvbo->vma_list);
      >    217		nvbo->tile_mode = tile_mode;
      >    218		nvbo->tile_flags = tile_flags;
      >    219		nvbo->bo.bdev = &drm->ttm.bdev;
      >    220
      >    221		nvbo->page_shift = 12;
      >    222		if (drm->client.base.vm) {
      >                     ^^^^^^^^^^^^^^^^^^^
      > Old check.
      >
      >    223			if (!(flags & TTM_PL_FLAG_TT) && size > 256 * 1024)
      >    224				nvbo->page_shift = drm->client.base.vm->vmm->lpg_shift;
      >
      > regards,
      > dan carpenter
      
      8<-----
      Commit 0108bc80: "drm/nouveau: do not allow negative sizes for now" broke
      older nvidia gpu's that lack a vm. Add an explicit check to handle this.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reported-by: Nkonrad wilk <konrad.wilk@oracle.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      35095f75
  11. 10 7月, 2013 4 次提交
  12. 08 7月, 2013 1 次提交
  13. 01 7月, 2013 2 次提交
  14. 11 3月, 2013 1 次提交
  15. 20 2月, 2013 1 次提交
  16. 15 2月, 2013 1 次提交
  17. 05 2月, 2013 1 次提交
  18. 20 1月, 2013 1 次提交
    • D
      drm/nouveau: try to protect nbo->pin_refcount · 0ae6d7bc
      Daniel Vetter 提交于
      ... by moving the bo_pin/bo_unpin manipulation of the pin_refcount
      under the protection of the ttm reservation lock. pin/unpin seems
      to get called from all over the place, so atm this is completely racy.
      
      After this patch there are only a few places in cleanup functions
      left which access ->pin_refcount without locking. But I'm hoping that
      those are safe and some other code invariant guarantees that this
      won't blow up.
      
      In any case, I only need to fix up pin/unpin to make ->pageflip work
      safely, so let's keep it at that.
      
      Add a comment to the header to explain the new locking rule.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0ae6d7bc
  19. 04 1月, 2013 1 次提交
  20. 10 12月, 2012 1 次提交
    • M
      drm/ttm: remove no_wait_reserve, v3 · 97a875cb
      Maarten Lankhorst 提交于
      All items on the lru list are always reservable, so this is a stupid
      thing to keep. Not only that, it is used in a way which would
      guarantee deadlocks if it were ever to be set to block on reserve.
      
      This is a lot of churn, but mostly because of the removal of the
      argument which can be nested arbitrarily deeply in many places.
      
      No change of code in this patch except removal of the no_wait_reserve
      argument, the previous patch removed the use of no_wait_reserve.
      
      v2:
       - Warn if -EBUSY is returned on reservation, all objects on the list
         should be reservable. Adjusted patch slightly due to conflicts.
      v3:
       - Focus on no_wait_reserve removal only.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      97a875cb
  21. 20 11月, 2012 1 次提交