Prior to making the syncobj lookup lockless, update the idr to the new XArray API.
Based on a patch by Matthew Wilcox willy@infradead.org Signed-off-by: Chris Wilson chris@chris-wilson.co.uk --- drivers/gpu/drm/drm_syncobj.c | 64 ++++++++++------------------------- include/drm/drm_file.h | 7 ++-- 2 files changed, 21 insertions(+), 50 deletions(-)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 1438dcb3ebb1..4fc71dc9fc43 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -86,14 +86,13 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, { struct drm_syncobj *syncobj;
- spin_lock(&file_private->syncobj_table_lock); + xa_lock(&file_private->syncobjs);
- /* Check if we currently have a reference on the object */ - syncobj = idr_find(&file_private->syncobj_idr, handle); + syncobj = xa_load(&file_private->syncobjs, handle); if (syncobj) drm_syncobj_get(syncobj);
- spin_unlock(&file_private->syncobj_table_lock); + xa_unlock(&file_private->syncobjs);
return syncobj; } @@ -366,23 +365,14 @@ int drm_syncobj_get_handle(struct drm_file *file_private, { int ret;
- /* take a reference to put in the idr */ drm_syncobj_get(syncobj);
- idr_preload(GFP_KERNEL); - spin_lock(&file_private->syncobj_table_lock); - ret = idr_alloc(&file_private->syncobj_idr, syncobj, 1, 0, GFP_NOWAIT); - spin_unlock(&file_private->syncobj_table_lock); - - idr_preload_end(); - - if (ret < 0) { + ret = xa_alloc(&file_private->syncobjs, handle, syncobj, + xa_limit_32b, GFP_KERNEL); + if (ret < 0) drm_syncobj_put(syncobj); - return ret; - }
- *handle = ret; - return 0; + return ret; } EXPORT_SYMBOL(drm_syncobj_get_handle);
@@ -406,10 +396,7 @@ static int drm_syncobj_destroy(struct drm_file *file_private, { struct drm_syncobj *syncobj;
- spin_lock(&file_private->syncobj_table_lock); - syncobj = idr_remove(&file_private->syncobj_idr, handle); - spin_unlock(&file_private->syncobj_table_lock); - + syncobj = xa_erase(&file_private->syncobjs, handle); if (!syncobj) return -EINVAL;
@@ -492,20 +479,12 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private, return -EINVAL; }
- /* take a reference to put in the idr */ syncobj = f.file->private_data; drm_syncobj_get(syncobj);
- idr_preload(GFP_KERNEL); - spin_lock(&file_private->syncobj_table_lock); - ret = idr_alloc(&file_private->syncobj_idr, syncobj, 1, 0, GFP_NOWAIT); - spin_unlock(&file_private->syncobj_table_lock); - idr_preload_end(); - - if (ret > 0) { - *handle = ret; - ret = 0; - } else + ret = xa_alloc(&file_private->syncobjs, handle, syncobj, + xa_limit_32b, GFP_KERNEL); + if (ret < 0) drm_syncobj_put(syncobj);
fdput(f); @@ -575,17 +554,7 @@ static int drm_syncobj_export_sync_file(struct drm_file *file_private, void drm_syncobj_open(struct drm_file *file_private) { - idr_init_base(&file_private->syncobj_idr, 1); - spin_lock_init(&file_private->syncobj_table_lock); -} - -static int -drm_syncobj_release_handle(int id, void *ptr, void *data) -{ - struct drm_syncobj *syncobj = ptr; - - drm_syncobj_put(syncobj); - return 0; + xa_init_flags(&file_private->syncobjs, XA_FLAGS_ALLOC1); }
/** @@ -599,9 +568,12 @@ drm_syncobj_release_handle(int id, void *ptr, void *data) void drm_syncobj_release(struct drm_file *file_private) { - idr_for_each(&file_private->syncobj_idr, - &drm_syncobj_release_handle, file_private); - idr_destroy(&file_private->syncobj_idr); + struct drm_syncobj *syncobj; + unsigned long index; + + xa_for_each(&file_private->syncobjs, index, syncobj) + drm_syncobj_put(syncobj); + xa_destroy(&file_private->syncobjs); }
int diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 67af60bb527a..c6efb5f83fcf 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -33,6 +33,7 @@ #include <linux/types.h> #include <linux/completion.h> #include <linux/idr.h> +#include <linux/xarray.h>
#include <uapi/drm/drm.h>
@@ -251,10 +252,8 @@ struct drm_file { /** @table_lock: Protects @object_idr. */ spinlock_t table_lock;
- /** @syncobj_idr: Mapping of sync object handles to object pointers. */ - struct idr syncobj_idr; - /** @syncobj_table_lock: Protects @syncobj_idr. */ - spinlock_t syncobj_table_lock; + /** @syncobjs: Mapping of sync object handles to object pointers. */ + struct xarray syncobjs;
/** @filp: Pointer to the core file structure. */ struct file *filp;
Relax the spinlock used for looking up the handle in the XArray and acquiring a reference to it to an RCU protected critical section. This incurs the requirement that we protect the syncobj struct itself using RCU, which we achieve by simply calling kfree_rcu() and being more careful in acquiring our reference.
Signed-off-by: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_syncobj.c | 12 +++++------- include/drm/drm_syncobj.h | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 4fc71dc9fc43..aafc03986a48 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -86,13 +86,11 @@ struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, { struct drm_syncobj *syncobj;
- xa_lock(&file_private->syncobjs); - + rcu_read_lock(); syncobj = xa_load(&file_private->syncobjs, handle); - if (syncobj) - drm_syncobj_get(syncobj); - - xa_unlock(&file_private->syncobjs); + if (syncobj && !kref_get_unless_zero(&syncobj->refcount)) + syncobj = NULL; + rcu_read_unlock();
return syncobj; } @@ -309,7 +307,7 @@ void drm_syncobj_free(struct kref *kref) struct drm_syncobj, refcount); drm_syncobj_replace_fence(syncobj, NULL); - kfree(syncobj); + kfree_rcu(syncobj, rcu); } EXPORT_SYMBOL(drm_syncobj_free);
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index 6cf7243a1dc5..7c1503d47abf 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -61,6 +61,8 @@ struct drm_syncobj { * @file: A file backing for this syncobj. */ struct file *file; + + struct rcu_head rcu; };
void drm_syncobj_free(struct kref *kref);
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master] [cannot apply to v5.3-rc2 next-20190802] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-syncobj-Convert-sy... reproduce: make htmldocs
If you fix the issue, kindly add following tag Reported-by: kbuild test robot lkp@intel.com
All warnings (new ones prefixed by >>):
include/linux/skbuff.h:893: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:893: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:233: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:233: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:515: warning: Function parameter or member 'sk_rx_skb_cache' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_wq_raw' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_tx_skb_cache' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock' include/net/sock.h:515: warning: Function parameter or member 'sk_bpf_storage' not described in 'sock' include/net/sock.h:2439: warning: Function parameter or member 'tcp_rx_skb_cache_key' not described in 'DECLARE_STATIC_KEY_FALSE' include/net/sock.h:2439: warning: Excess function parameter 'sk' description in 'DECLARE_STATIC_KEY_FALSE' include/net/sock.h:2439: warning: Excess function parameter 'skb' description in 'DECLARE_STATIC_KEY_FALSE' include/linux/netdevice.h:2040: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'name_assign_type' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'mpls_ptr' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'xdp_prog' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'qdisc_hash' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device' include/linux/netdevice.h:2040: warning: Function parameter or member 'xps_rxqs_map' 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' drivers/net/phy/phylink.c:593: warning: Function parameter or member 'config' not described in 'phylink_create' drivers/net/phy/phylink.c:593: warning: Excess function parameter 'ndev' description in 'phylink_create' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quotactl' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quota_on' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'getprocattr' not described in 'security_list_options' include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'setprocattr' not described in 'security_list_options' drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:142: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:347: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor ' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:348: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor ' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:494: warning: Function parameter or member 'start' not described in 'amdgpu_vm_pt_first_dfs' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:823: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_flags' drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:2822: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute' drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:378: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch' drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:379: warning: Function parameter or member 'ih' not described in 'amdgpu_irq_dispatch' drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:379: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch' drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:1: warning: no structured comments found drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1: warning: no structured comments found drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1: warning: 'pp_dpm_sclk pp_dpm_mclk pp_dpm_pcie' not found drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:131: warning: Incorrect use of kernel-doc format: * @atomic_obj drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:237: warning: Incorrect use of kernel-doc format: * gpu_info FW provided soc bounding box struct or 0 if not drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'atomic_obj' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'backlight_link' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'backlight_caps' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'freesync_module' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'fw_dmcu' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'dmcu_fw_version' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:242: warning: Function parameter or member 'soc_bounding_box' not described in 'amdgpu_display_manager' drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'dm_pflip_high_irq' not found drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'dm_crtc_high_irq' not found drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: 'register_hpd_handlers' not found include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver' include/drm/drm_modeset_helper_vtables.h:1053: warning: Function parameter or member 'prepare_writeback_job' not described in 'drm_connector_helper_funcs' include/drm/drm_modeset_helper_vtables.h:1053: warning: Function parameter or member 'cleanup_writeback_job' not described in 'drm_connector_helper_funcs' include/drm/drm_atomic_state_helper.h:1: warning: no structured comments found
include/drm/drm_syncobj.h:67: warning: Function parameter or member 'rcu' not described in 'drm_syncobj'
include/net/cfg80211.h:1092: warning: Function parameter or member 'txpwr' not described in 'station_parameters' include/net/mac80211.h:4043: warning: Function parameter or member 'sta_set_txpwr' not described in 'ieee80211_ops' Documentation/admin-guide/xfs.rst:257: WARNING: Block quote ends without a blank line; unexpected unindent. include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string. drivers/firewire/core-transaction.c:606: WARNING: Inline strong start-string without end-string. drivers/message/fusion/mptbase.c:5057: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1964: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/index.rst:94: WARNING: toctree contains reference to nonexisting document 'virtual/index' Documentation/crypto/crypto_engine.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent. Documentation/kbuild/makefiles.rst:1142: WARNING: Inline emphasis start-string without end-string. Documentation/kbuild/makefiles.rst:1152: WARNING: Inline emphasis start-string without end-string. Documentation/kbuild/makefiles.rst:1154: WARNING: Inline emphasis start-string without end-string. include/linux/i2c.h:522: WARNING: Inline strong start-string without end-string. include/linux/regulator/driver.h:284: WARNING: Unknown target name: "regulator_regmap_x_voltage". include/linux/spi/spi.h:382: WARNING: Unexpected indentation. fs/seq_file.c:40: WARNING: Inline strong start-string without end-string. fs/seq_file.c:40: WARNING: Inline strong start-string without end-string. fs/seq_file.c:40: WARNING: Inline strong start-string without end-string. fs/seq_file.c:40: WARNING: Inline strong start-string without end-string. fs/posix_acl.c:636: WARNING: Inline emphasis start-string without end-string. fs/debugfs/inode.c:399: WARNING: Inline literal start-string without end-string. fs/debugfs/inode.c:478: WARNING: Inline literal start-string without end-string. fs/debugfs/inode.c:510: WARNING: Inline literal start-string without end-string. fs/debugfs/inode.c:603: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:394: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:400: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:439: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:445: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:484: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:490: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:530: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:536: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:578: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:584: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:845: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:851: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:898: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:904: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:1090: WARNING: Inline literal start-string without end-string. fs/debugfs/file.c:1096: WARNING: Inline literal start-string without end-string. drivers/ata/libata-core.c:5945: WARNING: Unknown target name: "hw". kernel/signal.c:349: WARNING: Inline literal start-string without end-string. include/linux/xarray.h:232: WARNING: Unexpected indentation. include/linux/netdevice.h:3482: WARNING: Inline emphasis start-string without end-string. include/linux/netdevice.h:3482: WARNING: Inline emphasis start-string without end-string. net/core/dev.c:5008: WARNING: Unknown target name: "page_is". Documentation/security/keys/core.rst:1110: WARNING: Inline emphasis start-string without end-string. Documentation/security/keys/core.rst:1110: WARNING: Inline emphasis start-string without end-string. Documentation/security/keys/core.rst:1108: WARNING: Inline emphasis start-string without end-string. Documentation/security/keys/core.rst:1108: WARNING: Inline emphasis start-string without end-string. Documentation/security/keys/core.rst:1108: WARNING: Inline emphasis start-string without end-string. Documentation/trace/kprobetrace.rst:99: WARNING: Explicit markup ends without a blank line; unexpected unindent. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:245: WARNING: Unexpected indentation. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:248: WARNING: Block quote ends without a blank line; unexpected unindent. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:271: WARNING: Unexpected indentation. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:282: WARNING: Unexpected indentation. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:2202: WARNING: Inline emphasis start-string without end-string. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:2204: WARNING: Inline emphasis start-string without end-string. include/drm/drm_connector.h:540: WARNING: Inline interpreted text or phrase reference start-string without end-string. include/drm/drm_connector.h:540: WARNING: Inline interpreted text or phrase reference start-string without end-string. Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:458: WARNING: Unknown target name: "nitrokey pro". Documentation/virt/index.rst: WARNING: document isn't included in any toctree include/linux/slab.h:500: WARNING: undefined label: memory-allocation (if the link has no caption the label must precede a section header) Documentation/gpu/drm-internals.rst:302: WARNING: Could not lex literal_block as "c". Highlighting skipped. WARNING: LaTeX command 'latex' cannot be run (needed for math display), check the imgmath_latex setting WARNING: LaTeX command 'latex' cannot be run (needed for math display), check the imgmath_latex setting WARNING: LaTeX command 'latex' cannot be run (needed for math display), check the imgmath_latex setting Documentation/trace/kprobetrace.rst:68: WARNING: undefined label: user_mem_access (if the link has no caption the label must precede a section header) WARNING: LaTeX command 'latex' cannot be run (needed for math display), check the imgmath_latex setting
vim +67 include/drm/drm_syncobj.h
e9083420bbacce2 Dave Airlie 2017-04-04 @67 e9083420bbacce2 Dave Airlie 2017-04-04 68 void drm_syncobj_free(struct kref *kref); e9083420bbacce2 Dave Airlie 2017-04-04 69 e9083420bbacce2 Dave Airlie 2017-04-04 70 /** e9083420bbacce2 Dave Airlie 2017-04-04 71 * drm_syncobj_get - acquire a syncobj reference e9083420bbacce2 Dave Airlie 2017-04-04 72 * @obj: sync object e9083420bbacce2 Dave Airlie 2017-04-04 73 * 924fe8df7fcfa50 Daniel Vetter 2017-12-14 74 * This acquires an additional reference to @obj. It is illegal to call this e9083420bbacce2 Dave Airlie 2017-04-04 75 * without already holding a reference. No locks required. e9083420bbacce2 Dave Airlie 2017-04-04 76 */ e9083420bbacce2 Dave Airlie 2017-04-04 77 static inline void e9083420bbacce2 Dave Airlie 2017-04-04 78 drm_syncobj_get(struct drm_syncobj *obj) e9083420bbacce2 Dave Airlie 2017-04-04 79 { e9083420bbacce2 Dave Airlie 2017-04-04 80 kref_get(&obj->refcount); e9083420bbacce2 Dave Airlie 2017-04-04 81 } e9083420bbacce2 Dave Airlie 2017-04-04 82 e9083420bbacce2 Dave Airlie 2017-04-04 83 /** e9083420bbacce2 Dave Airlie 2017-04-04 84 * drm_syncobj_put - release a reference to a sync object. e9083420bbacce2 Dave Airlie 2017-04-04 85 * @obj: sync object. e9083420bbacce2 Dave Airlie 2017-04-04 86 */ e9083420bbacce2 Dave Airlie 2017-04-04 87 static inline void e9083420bbacce2 Dave Airlie 2017-04-04 88 drm_syncobj_put(struct drm_syncobj *obj) e9083420bbacce2 Dave Airlie 2017-04-04 89 { e9083420bbacce2 Dave Airlie 2017-04-04 90 kref_put(&obj->refcount, drm_syncobj_free); e9083420bbacce2 Dave Airlie 2017-04-04 91 } e9083420bbacce2 Dave Airlie 2017-04-04 92 131280a162e7fc2 Eric Anholt 2018-11-08 93 /** 131280a162e7fc2 Eric Anholt 2018-11-08 94 * drm_syncobj_fence_get - get a reference to a fence in a sync object 131280a162e7fc2 Eric Anholt 2018-11-08 95 * @syncobj: sync object. 131280a162e7fc2 Eric Anholt 2018-11-08 96 * 131280a162e7fc2 Eric Anholt 2018-11-08 97 * This acquires additional reference to &drm_syncobj.fence contained in @obj, 131280a162e7fc2 Eric Anholt 2018-11-08 98 * if not NULL. It is illegal to call this without already holding a reference. 131280a162e7fc2 Eric Anholt 2018-11-08 99 * No locks required. 131280a162e7fc2 Eric Anholt 2018-11-08 100 * 131280a162e7fc2 Eric Anholt 2018-11-08 101 * Returns: 131280a162e7fc2 Eric Anholt 2018-11-08 102 * Either the fence of @obj or NULL if there's none. 131280a162e7fc2 Eric Anholt 2018-11-08 103 */ 131280a162e7fc2 Eric Anholt 2018-11-08 104 static inline struct dma_fence * 131280a162e7fc2 Eric Anholt 2018-11-08 105 drm_syncobj_fence_get(struct drm_syncobj *syncobj) 131280a162e7fc2 Eric Anholt 2018-11-08 106 { 131280a162e7fc2 Eric Anholt 2018-11-08 107 struct dma_fence *fence; 131280a162e7fc2 Eric Anholt 2018-11-08 108 131280a162e7fc2 Eric Anholt 2018-11-08 109 rcu_read_lock(); 131280a162e7fc2 Eric Anholt 2018-11-08 110 fence = dma_fence_get_rcu_safe(&syncobj->fence); 131280a162e7fc2 Eric Anholt 2018-11-08 111 rcu_read_unlock(); 131280a162e7fc2 Eric Anholt 2018-11-08 112 131280a162e7fc2 Eric Anholt 2018-11-08 113 return fence; 131280a162e7fc2 Eric Anholt 2018-11-08 114 } 131280a162e7fc2 Eric Anholt 2018-11-08 115 e9083420bbacce2 Dave Airlie 2017-04-04 116 struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private, e9083420bbacce2 Dave Airlie 2017-04-04 117 u32 handle); 44f8a1396e83f10 Christian König 2019-04-01 118 void drm_syncobj_add_point(struct drm_syncobj *syncobj, 44f8a1396e83f10 Christian König 2019-04-01 119 struct dma_fence_chain *chain, 44f8a1396e83f10 Christian König 2019-04-01 120 struct dma_fence *fence, 44f8a1396e83f10 Christian König 2019-04-01 121 uint64_t point); 0b258ed1a219a97 Christian König 2018-11-14 122 void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, e9083420bbacce2 Dave Airlie 2017-04-04 123 struct dma_fence *fence); afaf59237843bf8 Jason Ekstrand 2017-08-25 124 int drm_syncobj_find_fence(struct drm_file *file_private, 649fdce23cdf516 Chunming Zhou 2018-10-15 125 u32 handle, u64 point, u64 flags, e9083420bbacce2 Dave Airlie 2017-04-04 126 struct dma_fence **fence); e9083420bbacce2 Dave Airlie 2017-04-04 127 void drm_syncobj_free(struct kref *kref); 1321fd2c010e7cc Marek Olšák 2017-09-12 128 int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags, 1321fd2c010e7cc Marek Olšák 2017-09-12 129 struct dma_fence *fence); 1321fd2c010e7cc Marek Olšák 2017-09-12 130 int drm_syncobj_get_handle(struct drm_file *file_private, 1321fd2c010e7cc Marek Olšák 2017-09-12 131 struct drm_syncobj *syncobj, u32 *handle); 684fd0af4732f37 Marek Olšák 2017-09-12 132 int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd); e9083420bbacce2 Dave Airlie 2017-04-04 133 e9083420bbacce2 Dave Airlie 2017-04-04 134 #endif
:::::: The code at line 67 was first introduced by commit :::::: e9083420bbacce27e43d418064d0d2dfb4b37aaa drm: introduce sync objects (v4)
:::::: TO: Dave Airlie airlied@redhat.com :::::: CC: Dave Airlie airlied@redhat.com
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
dri-devel@lists.freedesktop.org