tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next head: 209dfdfaae8fa671821b778b77e8295e6d9a47d0 commit: 202571ff39473c6831c4300276127bdb8c34c6b7 [663/675] drm/amdgpu: Set pasid for compute vm reproduce: make htmldocs All warnings (new ones prefixed by >>): WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org) mm/mempool.c:228: warning: Function parameter or member 'pool' not described in 'mempool_init' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev' include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev' include/net/mac80211.h:2282: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw' include/net/mac80211.h:2282: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw' include/net/mac80211.h:955: warning: Function parameter or member 'control.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.is_valid_ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.status_driver_data' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.avg_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info' net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info' kernel/sched/fair.c:3760: warning: Function parameter or member 'flags' not described in 'attach_entity_load_avg' include/linux/device.h:93: warning: bad line: this bus. include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf' include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf' include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array' include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' include/linux/iio/hw-consumer.h:1: warning: no structured comments found include/linux/device.h:94: warning: bad line: this bus. include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry' include/linux/regulator/driver.h:227: warning: Function parameter or member 'resume_early' not described in 'regulator_ops' drivers/regulator/core.c:4465: warning: Excess function parameter 'state' description in 'regulator_suspend_late' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb' arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb' drivers/usb/dwc3/gadget.c:510: warning: Excess function parameter 'dwc' description in 'dwc3_gadget_start_config' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3055: warning: Excess function parameter 'dev' description in 'amdgpu_vm_get_task_info' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:488: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param' >> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:2745: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3056: warning: Function parameter or member 'adev' not described in 'amdgpu_vm_get_task_info' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3056: warning: Excess function parameter 'dev' description in 'amdgpu_vm_get_task_info' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver' include/drm/drm_panel.h:98: warning: Function parameter or member 'link' not described in 'drm_panel' drivers/gpu/drm/i915/i915_vma.h:48: warning: cannot understand function prototype: 'struct i915_vma ' drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found include/drm/tinydrm/tinydrm.h:34: warning: Function parameter or member 'fb_dirty' not described in 'tinydrm_device' drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'crtc_state' not described in 'mipi_dbi_enable_flush' drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'plane_state' not described in 'mipi_dbi_enable_flush' include/linux/skbuff.h:852: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'skb_mstamp' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member '__unused' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'pfmemalloc' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:852: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:234: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:493: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'sk_backlog.len' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'sk_backlog.head' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'sk_wq_raw' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock' include/net/sock.h:493: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock' net/core/datagram.c:835: warning: Function parameter or member 'events' not described in 'datagram_poll_mask' include/linux/netdevice.h:1997: warning: Function parameter or member 'adj_list.upper' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'adj_list.lower' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'switchdev_ops' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'name_assign_type' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'mpls_ptr' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'xdp_prog' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:1997: warning: Function parameter or member 'qdisc_hash' not described in 'net_device' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state' include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state' sound/soc/soc-core.c:2787: warning: Excess function parameter 'legacy_dai_naming' description in 'snd_soc_register_dais' include/linux/rcupdate.h:571: ERROR: Unexpected indentation. include/linux/rcupdate.h:575: ERROR: Unexpected indentation. include/linux/rcupdate.h:579: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:581: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:581: WARNING: Inline literal start-string without end-string. lib/reed_solomon/reed_solomon.c:287: ERROR: Unknown target name: "gfp". include/linux/wait.h:110: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/wait.h:113: ERROR: Unexpected indentation. include/linux/wait.h:115: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/time/hrtimer.c:1129: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/signal.c:327: WARNING: Inline literal start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/video/fbdev/core/modedb.c:647: WARNING: Inline strong start-string without end-string. drivers/ata/libata-core.c:5943: ERROR: Unknown target name: "hw". drivers/message/fusion/mptbase.c:5054: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1892: WARNING: Definition list ends without a blank line; unexpected unindent. include/linux/mtd/rawnand.h:1446: WARNING: Inline strong start-string without end-string. include/linux/mtd/rawnand.h:1448: WARNING: Inline strong start-string without end-string. include/linux/regulator/driver.h:279: ERROR: Unknown target name: "regulator_regmap_x_voltage". Documentation/driver-api/soundwire/locking.rst:50: ERROR: Inconsistent literal block quoting. Documentation/driver-api/soundwire/locking.rst:51: WARNING: Line block ends without a blank line. Documentation/driver-api/soundwire/locking.rst:55: WARNING: Inline substitution_reference start-string without end-string. Documentation/driver-api/soundwire/locking.rst:56: WARNING: Line block ends without a blank line. Documentation/driver-api/soundwire/stream.rst:177: WARNING: Explicit markup ends without a blank line; unexpected unindent. vim +2745 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c d38ceaf9 Alex Deucher 2015-04-20 2721 d38ceaf9 Alex Deucher 2015-04-20 2722 /** b236fa1d Felix Kuehling 2018-03-15 2723 * amdgpu_vm_make_compute - Turn a GFX VM into a compute VM b236fa1d Felix Kuehling 2018-03-15 2724 * 7fc48e59 Andrey Grodzovsky 2018-06-11 2725 * @adev: amdgpu_device pointer 7fc48e59 Andrey Grodzovsky 2018-06-11 2726 * @vm: requested vm 7fc48e59 Andrey Grodzovsky 2018-06-11 2727 * b236fa1d Felix Kuehling 2018-03-15 2728 * This only works on GFX VMs that don't have any BOs added and no b236fa1d Felix Kuehling 2018-03-15 2729 * page tables allocated yet. b236fa1d Felix Kuehling 2018-03-15 2730 * b236fa1d Felix Kuehling 2018-03-15 2731 * Changes the following VM parameters: b236fa1d Felix Kuehling 2018-03-15 2732 * - use_cpu_for_update b236fa1d Felix Kuehling 2018-03-15 2733 * - pte_supports_ats b236fa1d Felix Kuehling 2018-03-15 2734 * - pasid (old PASID is released, because compute manages its own PASIDs) b236fa1d Felix Kuehling 2018-03-15 2735 * b236fa1d Felix Kuehling 2018-03-15 2736 * Reinitializes the page directory to reflect the changed ATS b236fa1d Felix Kuehling 2018-03-15 2737 * setting. May leave behind an unused shadow BO for the page b236fa1d Felix Kuehling 2018-03-15 2738 * directory when switching from SDMA updates to CPU updates. b236fa1d Felix Kuehling 2018-03-15 2739 * 7fc48e59 Andrey Grodzovsky 2018-06-11 2740 * Returns: 7fc48e59 Andrey Grodzovsky 2018-06-11 2741 * 0 for success, -errno for errors. b236fa1d Felix Kuehling 2018-03-15 2742 */ 202571ff Oak Zeng 2018-08-27 2743 int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned int pasid) b236fa1d Felix Kuehling 2018-03-15 2744 { b236fa1d Felix Kuehling 2018-03-15 @2745 bool pte_support_ats = (adev->asic_type == CHIP_RAVEN); b236fa1d Felix Kuehling 2018-03-15 2746 int r; b236fa1d Felix Kuehling 2018-03-15 2747 b236fa1d Felix Kuehling 2018-03-15 2748 r = amdgpu_bo_reserve(vm->root.base.bo, true); b236fa1d Felix Kuehling 2018-03-15 2749 if (r) b236fa1d Felix Kuehling 2018-03-15 2750 return r; b236fa1d Felix Kuehling 2018-03-15 2751 b236fa1d Felix Kuehling 2018-03-15 2752 /* Sanity checks */ b236fa1d Felix Kuehling 2018-03-15 2753 if (!RB_EMPTY_ROOT(&vm->va.rb_root) || vm->root.entries) { b236fa1d Felix Kuehling 2018-03-15 2754 r = -EINVAL; 202571ff Oak Zeng 2018-08-27 2755 goto unreserve_bo; 202571ff Oak Zeng 2018-08-27 2756 } 202571ff Oak Zeng 2018-08-27 2757 202571ff Oak Zeng 2018-08-27 2758 if (pasid) { 202571ff Oak Zeng 2018-08-27 2759 unsigned long flags; 202571ff Oak Zeng 2018-08-27 2760 202571ff Oak Zeng 2018-08-27 2761 spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags); 202571ff Oak Zeng 2018-08-27 2762 r = idr_alloc(&adev->vm_manager.pasid_idr, vm, pasid, pasid + 1, 202571ff Oak Zeng 2018-08-27 2763 GFP_ATOMIC); 202571ff Oak Zeng 2018-08-27 2764 spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags); 202571ff Oak Zeng 2018-08-27 2765 202571ff Oak Zeng 2018-08-27 2766 if (r == -ENOSPC) 202571ff Oak Zeng 2018-08-27 2767 goto unreserve_bo; 202571ff Oak Zeng 2018-08-27 2768 r = 0; b236fa1d Felix Kuehling 2018-03-15 2769 } b236fa1d Felix Kuehling 2018-03-15 2770 b236fa1d Felix Kuehling 2018-03-15 2771 /* Check if PD needs to be reinitialized and do it before b236fa1d Felix Kuehling 2018-03-15 2772 * changing any other state, in case it fails. b236fa1d Felix Kuehling 2018-03-15 2773 */ b236fa1d Felix Kuehling 2018-03-15 2774 if (pte_support_ats != vm->pte_support_ats) { b236fa1d Felix Kuehling 2018-03-15 2775 r = amdgpu_vm_clear_bo(adev, vm, vm->root.base.bo, b236fa1d Felix Kuehling 2018-03-15 2776 adev->vm_manager.root_level, b236fa1d Felix Kuehling 2018-03-15 2777 pte_support_ats); b236fa1d Felix Kuehling 2018-03-15 2778 if (r) 202571ff Oak Zeng 2018-08-27 2779 goto free_idr; b236fa1d Felix Kuehling 2018-03-15 2780 } b236fa1d Felix Kuehling 2018-03-15 2781 b236fa1d Felix Kuehling 2018-03-15 2782 /* Update VM state */ b236fa1d Felix Kuehling 2018-03-15 2783 vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode & b236fa1d Felix Kuehling 2018-03-15 2784 AMDGPU_VM_USE_CPU_FOR_COMPUTE); b236fa1d Felix Kuehling 2018-03-15 2785 vm->pte_support_ats = pte_support_ats; b236fa1d Felix Kuehling 2018-03-15 2786 DRM_DEBUG_DRIVER("VM update mode is %s\n", b236fa1d Felix Kuehling 2018-03-15 2787 vm->use_cpu_for_update ? "CPU" : "SDMA"); c8c5e569 Andrey Grodzovsky 2018-06-12 2788 WARN_ONCE((vm->use_cpu_for_update & !amdgpu_gmc_vram_full_visible(&adev->gmc)), b236fa1d Felix Kuehling 2018-03-15 2789 "CPU update of VM recommended only for large BAR system\n"); b236fa1d Felix Kuehling 2018-03-15 2790 b236fa1d Felix Kuehling 2018-03-15 2791 if (vm->pasid) { b236fa1d Felix Kuehling 2018-03-15 2792 unsigned long flags; b236fa1d Felix Kuehling 2018-03-15 2793 b236fa1d Felix Kuehling 2018-03-15 2794 spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags); b236fa1d Felix Kuehling 2018-03-15 2795 idr_remove(&adev->vm_manager.pasid_idr, vm->pasid); b236fa1d Felix Kuehling 2018-03-15 2796 spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags); b236fa1d Felix Kuehling 2018-03-15 2797 202571ff Oak Zeng 2018-08-27 2798 /* Free the original amdgpu allocated pasid 202571ff Oak Zeng 2018-08-27 2799 * Will be replaced with kfd allocated pasid 202571ff Oak Zeng 2018-08-27 2800 */ 202571ff Oak Zeng 2018-08-27 2801 amdgpu_pasid_free(vm->pasid); b236fa1d Felix Kuehling 2018-03-15 2802 vm->pasid = 0; b236fa1d Felix Kuehling 2018-03-15 2803 } b236fa1d Felix Kuehling 2018-03-15 2804 202571ff Oak Zeng 2018-08-27 2805 if (pasid) 202571ff Oak Zeng 2018-08-27 2806 vm->pasid = pasid; 202571ff Oak Zeng 2018-08-27 2807 202571ff Oak Zeng 2018-08-27 2808 goto unreserve_bo; 202571ff Oak Zeng 2018-08-27 2809 202571ff Oak Zeng 2018-08-27 2810 free_idr: 202571ff Oak Zeng 2018-08-27 2811 if (pasid) { 202571ff Oak Zeng 2018-08-27 2812 unsigned long flags; 202571ff Oak Zeng 2018-08-27 2813 202571ff Oak Zeng 2018-08-27 2814 spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags); 202571ff Oak Zeng 2018-08-27 2815 idr_remove(&adev->vm_manager.pasid_idr, pasid); 202571ff Oak Zeng 2018-08-27 2816 spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags); 202571ff Oak Zeng 2018-08-27 2817 } 202571ff Oak Zeng 2018-08-27 2818 unreserve_bo: b236fa1d Felix Kuehling 2018-03-15 2819 amdgpu_bo_unreserve(vm->root.base.bo); b236fa1d Felix Kuehling 2018-03-15 2820 return r; b236fa1d Felix Kuehling 2018-03-15 2821 } b236fa1d Felix Kuehling 2018-03-15 2822 :::::: The code at line 2745 was first introduced by commit :::::: b236fa1d339670cc997b68c31be57855bbabc126 drm/amdgpu: Add helper to turn an existing VM into a compute VM :::::: TO: Felix Kuehling <Felix.Kuehling@xxxxxxx> :::::: CC: Oded Gabbay <oded.gabbay@xxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel