1. 02 9月, 2014 1 次提交
  2. 01 9月, 2014 2 次提交
  3. 27 8月, 2014 1 次提交
  4. 08 7月, 2014 2 次提交
  5. 04 4月, 2014 1 次提交
  6. 16 3月, 2014 1 次提交
    • 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
  7. 13 3月, 2014 1 次提交
    • R
      drm/ttm: don't oops if no invalidate_caches() · 9ef7506f
      Rob Clark 提交于
      A few of the simpler TTM drivers (cirrus, ast, mgag200) do not implement
      this function.  Yet can end up somehow with an evicted bo:
      
        BUG: unable to handle kernel NULL pointer dereference at           (null)
        IP: [<          (null)>]           (null)
        PGD 16e761067 PUD 16e6cf067 PMD 0
        Oops: 0010 [#1] SMP
        Modules linked in: bnep bluetooth rfkill fuse ip6t_rpfilter ip6t_REJECT ipt_REJECT xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter ip_tables sg btrfs zlib_deflate raid6_pq xor dm_queue_length iTCO_wdt iTCO_vendor_support coretemp kvm dcdbas dm_service_time microcode serio_raw pcspkr lpc_ich mfd_core i7core_edac edac_core ses enclosure ipmi_si ipmi_msghandler shpchp acpi_power_meter mperf nfsd auth_rpcgss nfs_acl lockd uinput sunrpc dm_multipath xfs libcrc32c ata_generic pata_acpi sr_mod cdrom
         sd_mod usb_storage mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit lpfc drm_kms_helper ttm crc32c_intel ata_piix bfa drm ixgbe libata i2c_core mdio crc_t10dif ptp crct10dif_common pps_core scsi_transport_fc dca scsi_tgt megaraid_sas bnx2 dm_mirror dm_region_hash dm_log dm_mod
        CPU: 16 PID: 2572 Comm: X Not tainted 3.10.0-86.el7.x86_64 #1
        Hardware name: Dell Inc. PowerEdge R810/0H235N, BIOS 0.3.0 11/14/2009
        task: ffff8801799dabc0 ti: ffff88016c884000 task.ti: ffff88016c884000
        RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
        RSP: 0018:ffff88016c885ad8  EFLAGS: 00010202
        RAX: ffffffffa04e94c0 RBX: ffff880178937a20 RCX: 0000000000000000
        RDX: 0000000000000000 RSI: 0000000000240004 RDI: ffff880178937a00
        RBP: ffff88016c885b60 R08: 00000000000171a0 R09: ffff88007cf171a0
        R10: ffffea0005842540 R11: ffffffff810487b9 R12: ffff880178937b30
        R13: ffff880178937a00 R14: ffff88016c885b78 R15: ffff880179929400
        FS:  00007f81ba2ef980(0000) GS:ffff88007cf00000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 0000000000000000 CR3: 000000016e763000 CR4: 00000000000007e0
        DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
        DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
        Stack:
         ffffffffa0306fae ffff8801799295c0 0000000000260004 0000000000000001
         ffff88016c885b60 ffffffffa0307669 00ff88007cf17738 ffff88017cf17700
         ffff880178937a00 ffff880100000000 ffff880100000000 0000000079929400
        Call Trace:
         [<ffffffffa0306fae>] ? ttm_bo_handle_move_mem+0x54e/0x5b0 [ttm]
         [<ffffffffa0307669>] ? ttm_bo_mem_space+0x169/0x340 [ttm]
         [<ffffffffa0307bd7>] ttm_bo_move_buffer+0x117/0x130 [ttm]
         [<ffffffff81130001>] ? perf_event_init_context+0x141/0x220
         [<ffffffffa0307cb1>] ttm_bo_validate+0xc1/0x130 [ttm]
         [<ffffffffa04e7377>] mgag200_bo_pin+0x87/0xc0 [mgag200]
         [<ffffffffa04e56c4>] mga_crtc_cursor_set+0x474/0xbb0 [mgag200]
         [<ffffffff811971d2>] ? __mem_cgroup_commit_charge+0x152/0x3b0
         [<ffffffff815c4182>] ? mutex_lock+0x12/0x2f
         [<ffffffffa0201433>] drm_mode_cursor_common+0x123/0x170 [drm]
         [<ffffffffa0205231>] drm_mode_cursor_ioctl+0x41/0x50 [drm]
         [<ffffffffa01f5ca2>] drm_ioctl+0x502/0x630 [drm]
         [<ffffffff815cbab4>] ? __do_page_fault+0x1f4/0x510
         [<ffffffff8101cb68>] ? __restore_xstate_sig+0x218/0x4f0
         [<ffffffff811b4445>] do_vfs_ioctl+0x2e5/0x4d0
         [<ffffffff8124488e>] ? file_has_perm+0x8e/0xa0
         [<ffffffff811b46b1>] SyS_ioctl+0x81/0xa0
         [<ffffffff815d05d9>] system_call_fastpath+0x16/0x1b
        Code:  Bad RIP value.
        RIP  [<          (null)>]           (null)
         RSP <ffff88016c885ad8>
        CR2: 0000000000000000
      Signed-off-by: NRob Clark <rclark@redhat.com>
      Reviewed-by: NJérôme Glisse <jglisse@redhat.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      Cc: stable@vger.kernel.org
      9ef7506f
  8. 08 1月, 2014 1 次提交
  9. 20 11月, 2013 1 次提交
    • T
      drm/ttm: Remove set_need_resched from the ttm fault handler · c58f009e
      Thomas Hellstrom 提交于
      Addresses
      "[BUG] completely bonkers use of set_need_resched + VM_FAULT_NOPAGE".
      
      In the first occurence it was used to try to be nice while releasing the
      mmap_sem and retrying the fault to work around a locking inversion.
      The second occurence was never used.
      
      There has been some discussion whether we should change the locking order to
      mmap_sem -> bo_reserve. This patch doesn't address that issue, and leaves
      that locking order undefined. The solution that we release the mmap_sem if
      tryreserve fails and wait for the buffer to become unreserved is something
      we want in any case, and follows how the core vm system waits for pages
      to be come unlocked while releasing the mmap_sem.
      
      The code also outlines what needs to be changed if we want to establish the
      locking order as mmap_sem -> bo::reserve.
      
      One slight issue that remains with this code is that the fault handler might
      be prone to starvation if another thread countinously reserves the buffer.
      IMO that usage pattern is highly unlikely.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      c58f009e
  10. 06 11月, 2013 2 次提交
  11. 07 8月, 2013 1 次提交
  12. 25 7月, 2013 2 次提交
    • D
      drm/vma: provide drm_vma_node_unmap() helper · 51335df9
      David Herrmann 提交于
      Instead of unmapping the nodes in TTM and GEM users manually, we provide
      a generic wrapper which does the correct thing for all vma-nodes.
      
      v2: remove bdev->dev_mapping test in ttm_bo_unmap_virtual_unlocked() as
      ttm_mem_io_free_vm() does nothing in that case (io_reserved_vm is 0).
      v4: Fix docbook comments
      v5: use drm_vma_node_size()
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      51335df9
    • D
      drm/ttm: convert to unified vma offset manager · 72525b3f
      David Herrmann 提交于
      Use the new vma-manager infrastructure. This doesn't change any
      implementation details as the vma-offset-manager is nearly copied 1-to-1
      from TTM.
      
      The vm_lock is moved into the offset manager so we can drop it from TTM.
      During lookup, we use the vma locking helpers to take a reference to the
      found object.
      In all other scenarios, locking stays the same as before. We always
      guarantee that drm_vma_offset_remove() is called only during destruction.
      Hence, helpers like drm_vma_node_offset_addr() are always safe as long as
      the node has a valid offset.
      
      This also drops the addr_space_offset member as it is a copy of vm_start
      in vma_node objects. Use the accessor functions instead.
      
      v4:
       - remove vm_lock
       - use drm_vma_offset_lock_lookup() to protect lookup (instead of vm_lock)
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Martin Peres <martin.peres@labri.fr>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      72525b3f
  13. 02 7月, 2013 1 次提交
  14. 28 6月, 2013 4 次提交
  15. 21 1月, 2013 1 次提交
  16. 15 1月, 2013 3 次提交
  17. 20 12月, 2012 1 次提交
    • M
      drm/ttm: fix delayed ttm_bo_cleanup_refs_and_unlock delayed handling · 0953e76e
      Maarten Lankhorst 提交于
      Fix regression introduced by 85b144f8
      "drm/ttm: call ttm_bo_cleanup_refs with reservation and lru lock held, v3"
      
      Slowpath ttm_bo_cleanup_refs_and_unlock accidentally tried to increase
      refcount on &bo->sync_obj instead of bo->sync_obj.
      
      The compiler didn't complain since sync_obj_ref takes a void pointer,
      so it was still valid c.
      
      This could result in lockups, memory corruptions, and warnings like
      these when graphics card VRAM usage is high:
      
      ------------[ cut here ]------------
      WARNING: at include/linux/kref.h:42 radeon_fence_ref+0x2c/0x40()
      Hardware name: System Product Name
      Pid: 157, comm: X Not tainted 3.7.0-rc7-00520-g85b144f8-dirty #174
      Call Trace:
      [<ffffffff81058c84>] ? warn_slowpath_common+0x74/0xb0
      [<ffffffff8129273c>] ? radeon_fence_ref+0x2c/0x40
      [<ffffffff8125e95c>] ? ttm_bo_cleanup_refs_and_unlock+0x18c/0x2d0
      [<ffffffff8125f17c>] ? ttm_mem_evict_first+0x1dc/0x2a0
      [<ffffffff81264452>] ? ttm_bo_man_get_node+0x62/0xb0
      [<ffffffff8125f4ce>] ? ttm_bo_mem_space+0x28e/0x340
      [<ffffffff8125fb0c>] ? ttm_bo_move_buffer+0xfc/0x170
      [<ffffffff810de172>] ? kmem_cache_alloc+0xb2/0xc0
      [<ffffffff8125fc15>] ? ttm_bo_validate+0x95/0x110
      [<ffffffff8125ff7c>] ? ttm_bo_init+0x2ec/0x3b0
      [<ffffffff8129419a>] ? radeon_bo_create+0x18a/0x200
      [<ffffffff81293e80>] ? radeon_bo_clear_va+0x40/0x40
      [<ffffffff812a5342>] ? radeon_gem_object_create+0x92/0x160
      [<ffffffff812a575c>] ? radeon_gem_create_ioctl+0x6c/0x150
      [<ffffffff812a529f>] ? radeon_gem_object_free+0x2f/0x40
      [<ffffffff81246b60>] ? drm_ioctl+0x420/0x4f0
      [<ffffffff812a56f0>] ? radeon_gem_pwrite_ioctl+0x20/0x20
      [<ffffffff810f53a4>] ? do_vfs_ioctl+0x2e4/0x4e0
      [<ffffffff810e5588>] ? vfs_read+0x118/0x160
      [<ffffffff810f55ec>] ? sys_ioctl+0x4c/0xa0
      [<ffffffff810e5851>] ? sys_read+0x51/0xa0
      [<ffffffff814b0612>] ? system_call_fastpath+0x16/0x1b
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Acked-by: NPaul Menzel <paulepanter@users.sourceforge.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0953e76e
  18. 10 12月, 2012 5 次提交
  19. 28 11月, 2012 1 次提交
  20. 20 11月, 2012 6 次提交
  21. 07 11月, 2012 1 次提交
  22. 23 10月, 2012 1 次提交
    • T
      drm/ttm: Fix a theoretical race in ttm_bo_cleanup_refs() · b8e902f2
      Thomas Hellstrom 提交于
      In theory, that function could release the lru lock between
      checking for bo on ddestroy list and a successful reserve if the bo
      was already reserved, and the function was called with waiting reserves
      allowed.
      However, all current reservers of a bo on the ddestroy list would
      atomically take the bo off the list after a successful reserve so this
      race should not have been hit, so no need to backport for stable.
      
      This patch also fixes a case found by Maarten Lankhorst where
      ttm_mem_evict_first called with no_wait_gpu would incorrectly
      spin waiting for bo idle if trying to evict a busy buffer that
      also sits on the ddestroy list.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b8e902f2