drm/vgem: off by one in vgem_gem_fault()If page_offset is == num_pages then we end up reading beyond the end ofobj->pages[].Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces")Sign
drm/vgem: off by one in vgem_gem_fault()If page_offset is == num_pages then we end up reading beyond the end ofobj->pages[].Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces")Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: https://patchwork.freedesktop.org/patch/msgid/20180703122921.brlfxl4vx2ybvrd2@kili.mountain
show more ...
gpu: drm: vgem: Change return type to vm_fault_tUse new return type vm_fault_t for fault handler.Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>Reviewed-by: Matthew Wilcox <mawilcox@micro
gpu: drm: vgem: Change return type to vm_fault_tUse new return type vm_fault_t for fault handler.Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: https://patchwork.freedesktop.org/patch/msgid/20180416150232.GA26745@jordon-HP-15-Notebook-PC
treewide: setup_timer() -> timer_setup()This converts all remaining cases of the old setup_timer() API into usingtimer_setup(), where the callback argument is the structure alreadyholding the str
treewide: setup_timer() -> timer_setup()This converts all remaining cases of the old setup_timer() API into usingtimer_setup(), where the callback argument is the structure alreadyholding the struct timer_list. These should have no behavioral changes,since they just change which pointer is passed into the callback withthe same available pointers after conversion. It handles the followingexamples, in addition to some other variations.Casting from unsigned long: void my_callback(unsigned long data) { struct something *ptr = (struct something *)data; ... } ... setup_timer(&ptr->my_timer, my_callback, ptr);and forced object casts: void my_callback(struct something *ptr) { ... } ... setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);become: void my_callback(struct timer_list *t) { struct something *ptr = from_timer(ptr, t, my_timer); ... } ... timer_setup(&ptr->my_timer, my_callback, 0);Direct function assignments: void my_callback(unsigned long data) { struct something *ptr = (struct something *)data; ... } ... ptr->my_timer.function = my_callback;have a temporary cast added, along with converting the args: void my_callback(struct timer_list *t) { struct something *ptr = from_timer(ptr, t, my_timer); ... } ... ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;And finally, callbacks without a data assignment: void my_callback(unsigned long data) { ... } ... setup_timer(&ptr->my_timer, my_callback, 0);have their argument renamed to verify they're unused during conversion: void my_callback(struct timer_list *unused) { ... } ... timer_setup(&ptr->my_timer, my_callback, 0);The conversion is done with the following Coccinelle script:spatch --very-quiet --all-includes --include-headers \ -I ./arch/x86/include -I ./arch/x86/include/generated \ -I ./include -I ./arch/x86/include/uapi \ -I ./arch/x86/include/generated/uapi -I ./include/uapi \ -I ./include/generated/uapi --include ./include/linux/kconfig.h \ --dir . \ --cocci-file ~/src/data/timer_setup.cocci@fix_address_of@expression e;@@ setup_timer(-&(e)+&e , ...)// Update any raw setup_timer() usages that have a NULL callback, but// would otherwise match change_timer_function_usage, since the latter// will update all function assignments done in the face of a NULL// function initialization in setup_timer().@change_timer_function_usage_NULL@expression _E;identifier _timer;type _cast_data;@@(-setup_timer(&_E->_timer, NULL, _E);+timer_setup(&_E->_timer, NULL, 0);|-setup_timer(&_E->_timer, NULL, (_cast_data)_E);+timer_setup(&_E->_timer, NULL, 0);|-setup_timer(&_E._timer, NULL, &_E);+timer_setup(&_E._timer, NULL, 0);|-setup_timer(&_E._timer, NULL, (_cast_data)&_E);+timer_setup(&_E._timer, NULL, 0);)@change_timer_function_usage@expression _E;identifier _timer;struct timer_list _stl;identifier _callback;type _cast_func, _cast_data;@@(-setup_timer(&_E->_timer, _callback, _E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, &_callback, _E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, _callback, (_cast_data)_E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, &_callback, (_cast_data)_E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, (_cast_func)_callback, _E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, (_cast_func)&_callback, _E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E._timer, _callback, (_cast_data)_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, _callback, (_cast_data)&_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, &_callback, (_cast_data)_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, &_callback, (_cast_data)&_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);+timer_setup(&_E._timer, _callback, 0);| _E->_timer@_stl.function = _callback;| _E->_timer@_stl.function = &_callback;| _E->_timer@_stl.function = (_cast_func)_callback;| _E->_timer@_stl.function = (_cast_func)&_callback;| _E._timer@_stl.function = _callback;| _E._timer@_stl.function = &_callback;| _E._timer@_stl.function = (_cast_func)_callback;| _E._timer@_stl.function = (_cast_func)&_callback;)// callback(unsigned long arg)@change_callback_handle_cast depends on change_timer_function_usage@identifier change_timer_function_usage._callback;identifier change_timer_function_usage._timer;type _origtype;identifier _origarg;type _handletype;identifier _handle;@@ void _callback(-_origtype _origarg+struct timer_list *t ) {( ... when != _origarg _handletype *_handle =-(_handletype *)_origarg;+from_timer(_handle, t, _timer); ... when != _origarg| ... when != _origarg _handletype *_handle =-(void *)_origarg;+from_timer(_handle, t, _timer); ... when != _origarg| ... when != _origarg _handletype *_handle; ... when != _handle _handle =-(_handletype *)_origarg;+from_timer(_handle, t, _timer); ... when != _origarg| ... when != _origarg _handletype *_handle; ... when != _handle _handle =-(void *)_origarg;+from_timer(_handle, t, _timer); ... when != _origarg) }// callback(unsigned long arg) without existing variable@change_callback_handle_cast_no_arg depends on change_timer_function_usage && !change_callback_handle_cast@identifier change_timer_function_usage._callback;identifier change_timer_function_usage._timer;type _origtype;identifier _origarg;type _handletype;@@ void _callback(-_origtype _origarg+struct timer_list *t ) {+ _handletype *_origarg = from_timer(_origarg, t, _timer);+ ... when != _origarg- (_handletype *)_origarg+ _origarg ... when != _origarg }// Avoid already converted callbacks.@match_callback_converted depends on change_timer_function_usage && !change_callback_handle_cast && !change_callback_handle_cast_no_arg@identifier change_timer_function_usage._callback;identifier t;@@ void _callback(struct timer_list *t) { ... }// callback(struct something *handle)@change_callback_handle_arg depends on change_timer_function_usage && !match_callback_converted && !change_callback_handle_cast && !change_callback_handle_cast_no_arg@identifier change_timer_function_usage._callback;identifier change_timer_function_usage._timer;type _handletype;identifier _handle;@@ void _callback(-_handletype *_handle+struct timer_list *t ) {+ _handletype *_handle = from_timer(_handle, t, _timer); ... }// If change_callback_handle_arg ran on an empty function, remove// the added handler.@unchange_callback_handle_arg depends on change_timer_function_usage && change_callback_handle_arg@identifier change_timer_function_usage._callback;identifier change_timer_function_usage._timer;type _handletype;identifier _handle;identifier t;@@ void _callback(struct timer_list *t) {- _handletype *_handle = from_timer(_handle, t, _timer); }// We only want to refactor the setup_timer() data argument if we've found// the matching callback. This undoes changes in change_timer_function_usage.@unchange_timer_function_usage depends on change_timer_function_usage && !change_callback_handle_cast && !change_callback_handle_cast_no_arg && !change_callback_handle_arg@expression change_timer_function_usage._E;identifier change_timer_function_usage._timer;identifier change_timer_function_usage._callback;type change_timer_function_usage._cast_data;@@(-timer_setup(&_E->_timer, _callback, 0);+setup_timer(&_E->_timer, _callback, (_cast_data)_E);|-timer_setup(&_E._timer, _callback, 0);+setup_timer(&_E._timer, _callback, (_cast_data)&_E);)// If we fixed a callback from a .function assignment, fix the// assignment cast now.@change_timer_function_assignment depends on change_timer_function_usage && (change_callback_handle_cast || change_callback_handle_cast_no_arg || change_callback_handle_arg)@expression change_timer_function_usage._E;identifier change_timer_function_usage._timer;identifier change_timer_function_usage._callback;type _cast_func;typedef TIMER_FUNC_TYPE;@@( _E->_timer.function =-_callback+(TIMER_FUNC_TYPE)_callback ;| _E->_timer.function =-&_callback+(TIMER_FUNC_TYPE)_callback ;| _E->_timer.function =-(_cast_func)_callback;+(TIMER_FUNC_TYPE)_callback ;| _E->_timer.function =-(_cast_func)&_callback+(TIMER_FUNC_TYPE)_callback ;| _E._timer.function =-_callback+(TIMER_FUNC_TYPE)_callback ;| _E._timer.function =-&_callback;+(TIMER_FUNC_TYPE)_callback ;| _E._timer.function =-(_cast_func)_callback+(TIMER_FUNC_TYPE)_callback ;| _E._timer.function =-(_cast_func)&_callback+(TIMER_FUNC_TYPE)_callback ;)// Sometimes timer functions are called directly. Replace matched args.@change_timer_function_calls depends on change_timer_function_usage && (change_callback_handle_cast || change_callback_handle_cast_no_arg || change_callback_handle_arg)@expression _E;identifier change_timer_function_usage._timer;identifier change_timer_function_usage._callback;type _cast_data;@@ _callback((-(_cast_data)_E+&_E->_timer|-(_cast_data)&_E+&_E._timer|-_E+&_E->_timer) )// If a timer has been configured without a data argument, it can be// converted without regard to the callback argument, since it is unused.@match_timer_function_unused_data@expression _E;identifier _timer;identifier _callback;@@(-setup_timer(&_E->_timer, _callback, 0);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, _callback, 0L);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E->_timer, _callback, 0UL);+timer_setup(&_E->_timer, _callback, 0);|-setup_timer(&_E._timer, _callback, 0);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, _callback, 0L);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_E._timer, _callback, 0UL);+timer_setup(&_E._timer, _callback, 0);|-setup_timer(&_timer, _callback, 0);+timer_setup(&_timer, _callback, 0);|-setup_timer(&_timer, _callback, 0L);+timer_setup(&_timer, _callback, 0);|-setup_timer(&_timer, _callback, 0UL);+timer_setup(&_timer, _callback, 0);|-setup_timer(_timer, _callback, 0);+timer_setup(_timer, _callback, 0);|-setup_timer(_timer, _callback, 0L);+timer_setup(_timer, _callback, 0);|-setup_timer(_timer, _callback, 0UL);+timer_setup(_timer, _callback, 0);)@change_callback_unused_data depends on match_timer_function_unused_data@identifier match_timer_function_unused_data._callback;type _origtype;identifier _origarg;@@ void _callback(-_origtype _origarg+struct timer_list *unused ) { ... when != _origarg }Signed-off-by: Kees Cook <keescook@chromium.org>
drm/vgem: switch to drm_*_get(), drm_*_put() helpersUse drm_*_get() and drm_*_put() helpers instead of drm_*_reference()and drm_*_unreference() helpers.drm_*_reference() and drm_*_unreference()
drm/vgem: switch to drm_*_get(), drm_*_put() helpersUse drm_*_get() and drm_*_put() helpers instead of drm_*_reference()and drm_*_unreference() helpers.drm_*_reference() and drm_*_unreference() functions are justcompatibility alias for drm_*_get() and drm_*_put() and should not beused by new code. So convert all users of compatibility functions touse the new APIs.Generated by: scripts/coccinelle/api/drm-get-put.cocciSigned-off-by: Cihangir Akturk <cakturk@gmail.com>Signed-off-by: Sean Paul <seanpaul@chromium.org>Link: https://patchwork.freedesktop.org/patch/msgid/1502454794-28558-26-git-send-email-cakturk@gmail.com
drm/vgem: add compat_ioctl supportDRM drivers should supply a compat version if they're going to providean ioctl implementation at all. This can confuse 32-bit user space on a64-bit system.Sign
drm/vgem: add compat_ioctl supportDRM drivers should supply a compat version if they're going to providean ioctl implementation at all. This can confuse 32-bit user space on a64-bit system.Signed-off-by: Brian Norris <briannorris@chromium.org>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: https://patchwork.freedesktop.org/patch/msgid/20170715031212.108695-1-briannorris@chromium.org
drm/vgem: Pin our pages for dmabuf exportsWhen the caller maps their dmabuf and we return an sg_table, the callerdoesn't expect the pages beneath that sg_table to vanish on a whim (i.e.under memp
drm/vgem: Pin our pages for dmabuf exportsWhen the caller maps their dmabuf and we return an sg_table, the callerdoesn't expect the pages beneath that sg_table to vanish on a whim (i.e.under mempressure). The contract is that the pages are pinned for theduration of the mapping (from dma_buf_map_attachment() todma_buf_unmap_attachment). To comply, we need to introduce our ownvgem_object.pages_pin_count and elevate it across the mapping. However,the drm_prime interface we use calls drv->prime_pin on dma_buf_attachand drv->prime_unpin on dma_buf_detach, which while that does cover themapping is much broader than is desired -- but it will do for now.v2: also hold the pin across prime_vmap/vunmapReported-by: Tomi Sarvela <tomi.p.sarvela@intel.com>Testcase: igt/gem_concurrent_blit/*swap*vgem*Fixes: 5ba6c9ff961a ("drm/vgem: Fix mmaping")Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>Cc: Laura Abbott <labbott@redhat.com>Cc: Sean Paul <seanpaul@chromium.org>Cc: Matthew Auld <matthew.auld@intel.com>Cc: Daniel Vetter <daniel.vetter@ffwll.ch>Cc: <stable@vger.kernel.org> # needs a backportSigned-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20170622134617.17912-1-chris@chris-wilson.co.uk
drm/vgem: Fix return value check in vgem_init()In case of error, the function platform_device_register_simple() returnsERR_PTR() and never returns NULL. The NULL test in the return valuecheck sho
drm/vgem: Fix return value check in vgem_init()In case of error, the function platform_device_register_simple() returnsERR_PTR() and never returns NULL. The NULL test in the return valuecheck should be replaced with IS_ERR().Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces")Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>[danvet: Fix fixes: tag per Chris' review.]Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20170521011939.8111-1-weiyj.lk@gmail.com
drm: drop drm_[cm]alloc* helpersNow that drm_[cm]alloc* helpers are simple one line wrappers aroundkvmalloc_array and drm_free_large is just kvfree alias we can dropthem and replace by their nati
drm: drop drm_[cm]alloc* helpersNow that drm_[cm]alloc* helpers are simple one line wrappers aroundkvmalloc_array and drm_free_large is just kvfree alias we can dropthem and replace by their native forms.This shouldn't introduce any functional change.Changes since v1- fix typo in drivers/gpu//drm/etnaviv/etnaviv_gem.c - noticed by 0day build robotSuggested-by: Daniel Vetter <daniel@ffwll.ch>Signed-off-by: Michal Hocko <mhocko@suse.com>drm: drop drm_[cm]alloc* helpers[danvet: Fixup vgem which grew another user very recently.]Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Acked-by: Christian König <christian.koenig@amd.com>Link: http://patchwork.freedesktop.org/patch/msgid/20170517122312.GK18247@dhcp22.suse.cz
drm/vgem: remove unneeded -Iinclude/drm compiler flagWith the include directives under include/drm/ fixed, this flag isno longer needed.Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.
drm/vgem: remove unneeded -Iinclude/drm compiler flagWith the include directives under include/drm/ fixed, this flag isno longer needed.Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/1493009447-31524-29-git-send-email-yamada.masahiro@socionext.com
drm/vgem: Convert to a struct drm_device subclassWith Laura's introduction of the fake platform device for importingdmabuf, we add a second static that is logically tied to the vgem_device.Conver
drm/vgem: Convert to a struct drm_device subclassWith Laura's introduction of the fake platform device for importingdmabuf, we add a second static that is logically tied to the vgem_device.Convert vgem over to using the struct drm_device subclassing, so thatthe platform device is stored inside its owner.Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>Cc: Laura Abbott <labbott@redhat.com>Cc: Daniel Vetter <daniel.vetter@ffwll.ch>Reviewed-by: Laura Abbott <labbott@redhat.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20170508132228.9509-1-chris@chris-wilson.co.uk
drm/vgem: Enable dmabuf import interfacesEnable the GEM dma-buf import interfaces in addition to the exportinterfaces. This lets vgem be used as a test source for other allocators(e.g. Ion).Rev
drm/vgem: Enable dmabuf import interfacesEnable the GEM dma-buf import interfaces in addition to the exportinterfaces. This lets vgem be used as a test source for other allocators(e.g. Ion).Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>Signed-off-by: Laura Abbott <labbott@redhat.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/1493923548-20878-4-git-send-email-labbott@redhat.com
drm/vgem: Add a dummy platform deviceThe vgem driver is currently registered independent of any actualdevice. Some usage of the dmabuf APIs require an actual device structureto do anything. Regis
drm/vgem: Add a dummy platform deviceThe vgem driver is currently registered independent of any actualdevice. Some usage of the dmabuf APIs require an actual device structureto do anything. Register a dummy platform device for use with dmabuf.Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>Signed-off-by: Laura Abbott <labbott@redhat.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/1493923548-20878-2-git-send-email-labbott@redhat.com
Merge tag 'doc-4.11-images' of git://git.lwn.net/linux into drm-misc-nextPointer for Markus's image conversion work.We need this so we can merge all the pretty drm graphs for 4.12.Signed-off-by
Merge tag 'doc-4.11-images' of git://git.lwn.net/linux into drm-misc-nextPointer for Markus's image conversion work.We need this so we can merge all the pretty drm graphs for 4.12.Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drm/vgem: switch to postcloseI didn't spot anything that would require ordering here (well notanywhere else either), and I'm trying to unify at least modern driverson one close hook.Cc: Chris W
drm/vgem: switch to postcloseI didn't spot anything that would require ordering here (well notanywhere else either), and I'm trying to unify at least modern driverson one close hook.Cc: Chris Wilson <chris@chris-wilson.co.uk>Reviewed-by: Sean Paul <seanpaul@chromium.org>Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com>Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>Link: http://patchwork.freedesktop.org/patch/msgid/20170308141257.12119-18-daniel.vetter@ffwll.ch
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsPull vfs pile two from Al Viro: - orangefs fix - series of fs/namei.c cleanups from me - VFS stuff coming fro
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsPull vfs pile two from Al Viro: - orangefs fix - series of fs/namei.c cleanups from me - VFS stuff coming from overlayfs tree* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: orangefs: Use RCU for destroy_inode vfs: use helper for calling f_op->fsync() mm: use helper for calling f_op->mmap() vfs: use helpers for calling f_op->{read,write}_iter() vfs: pass type instead of fn to do_{loop,iter}_readv_writev() vfs: extract common parts of {compat_,}do_readv_writev() vfs: wrap write f_ops with file_{start,end}_write() vfs: deny copy_file_range() for non regular files vfs: deny fallocate() on directory vfs: create vfs helper vfs_tmpfile() namei.c: split unlazy_walk() namei.c: fold the check for DCACHE_OP_REVALIDATE into d_revalidate() lookup_fast(): clean up the logics around the fallback to non-rcu mode namei: fold unlazy_link() into its sole caller
Merge remote-tracking branch 'ovl/for-viro' into for-linusOverlayfs-related series from Miklos and Amir
mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf->fault(), ->page_mkwrite(), and ->pfn_mkwrite() calls do not need totake a vma and vmf parameter when the vma already resides i
mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf->fault(), ->page_mkwrite(), and ->pfn_mkwrite() calls do not need totake a vma and vmf parameter when the vma already resides in vmf.Remove the vma parameter to simplify things.[arnd@arndb.de: fix ARM build] Link: http://lkml.kernel.org/r/20170125223558.1451224-1-arnd@arndb.deLink: http://lkml.kernel.org/r/148521301778.19116.10840599906674778980.stgit@djiang5-desk3.ch.intel.comSigned-off-by: Dave Jiang <dave.jiang@intel.com>Signed-off-by: Arnd Bergmann <arnd@arndb.de>Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>Cc: Theodore Ts'o <tytso@mit.edu>Cc: Darrick J. Wong <darrick.wong@oracle.com>Cc: Matthew Wilcox <mawilcox@microsoft.com>Cc: Dave Hansen <dave.hansen@intel.com>Cc: Christoph Hellwig <hch@lst.de>Cc: Jan Kara <jack@suse.com>Cc: Dan Williams <dan.j.williams@intel.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm: use helper for calling f_op->mmap()Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
drm/vgem: Switch to reservation_object_lock() helpersFor the convenience of encapsulation the reservation object's ww_mutexwas wrapped in pair of lock/unlock helpers.Signed-off-by: Chris Wilson
drm/vgem: Switch to reservation_object_lock() helpersFor the convenience of encapsulation the reservation object's ww_mutexwas wrapped in pair of lock/unlock helpers.Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20170123095357.29514-1-chris@chris-wilson.co.uk
drm: Move drm_clflush prototypes to drm_cache header fileContinue to clean up drmP.h by moving the cache flushing functions intoit's own header file.Compile-tested onlySigned-off-by: Gabriel K
drm: Move drm_clflush prototypes to drm_cache header fileContinue to clean up drmP.h by moving the cache flushing functions intoit's own header file.Compile-tested onlySigned-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>Reviewed-by: Alex Deucher <alexander.deucher@amd.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20170109215649.6860-2-krisman@collabora.co.uk
mm: use vmf->address instead of of vmf->virtual_addressEvery single user of vmf->virtual_address typed that entry to unsignedlong before doing anything with it so the type of virtual_address does
mm: use vmf->address instead of of vmf->virtual_addressEvery single user of vmf->virtual_address typed that entry to unsignedlong before doing anything with it so the type of virtual_address doesnot really provide us any additional safety. Just use maskedvmf->address which already has the appropriate type.Link: http://lkml.kernel.org/r/1479460644-25076-3-git-send-email-jack@suse.czSigned-off-by: Jan Kara <jack@suse.cz>Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>Cc: Dan Williams <dan.j.williams@intel.com>Cc: Ross Zwisler <ross.zwisler@linux.intel.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drm: Take ownership of the dmabuf->obj when exportingCurrently the reference for the dmabuf->obj is incremented for thedmabuf in drm_gem_prime_handle_to_fd() (at the high level userspaceinterface
drm: Take ownership of the dmabuf->obj when exportingCurrently the reference for the dmabuf->obj is incremented for thedmabuf in drm_gem_prime_handle_to_fd() (at the high level userspaceinterface), but is released in drm_gem_dmabuf_release() (the lowlevelhandler). Improve the symmetry of the dmabuf->obj ownership by acquiringthe reference in drm_gem_dmabuf_export(). This makes it easier to usethe prime functions directly.Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>[danvet: Update kerneldoc.]Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20161207214527.22533-1-chris@chris-wilson.co.uk
drm/vgem: Use ww_mutex_(un)lock even with a NULL contextv2: use resv->lock instead of resv->lock.base (Christian König)Cc: Peter Zijlstra <peterz@infradead.org>Cc: Ingo Molnar <mingo@redhat.com>
drm/vgem: Use ww_mutex_(un)lock even with a NULL contextv2: use resv->lock instead of resv->lock.base (Christian König)Cc: Peter Zijlstra <peterz@infradead.org>Cc: Ingo Molnar <mingo@redhat.com>Cc: Maarten Lankhorst <dev@mblankhorst.nl>Cc: Daniel Vetter <daniel@ffwll.ch>Cc: Chris Wilson <chris@chris-wilson.co.uk>Cc: dri-devel@lists.freedesktop.orgSigned-off-by: Nicolai Hähnle <Nicolai.Haehnle@amd.com>Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/1480601214-26583-2-git-send-email-nhaehnle@gmail.com
dma-buf: Rename struct fence to dma_fenceI plan to usurp the short name of struct fence for a core kernel struct,and so I need to rename the specialised fence/timeline for DMAoperations to make r
dma-buf: Rename struct fence to dma_fenceI plan to usurp the short name of struct fence for a core kernel struct,and so I need to rename the specialised fence/timeline for DMAoperations to make room.A consensus was reached inhttps://lists.freedesktop.org/archives/dri-devel/2016-July/113083.htmlthat making clear this fence applies to DMA operations was a good thing.Since then the patch has grown a bit as usage increases, so hopefully itremains a good thing!(v2...: rebase, rerun spatch)v3: Compile on msm, spotted a manual fixup that I broke.v4: Try again for msm, sorry Danielcoccinelle script:@@@@- struct fence+ struct dma_fence@@@@- struct fence_ops+ struct dma_fence_ops@@@@- struct fence_cb+ struct dma_fence_cb@@@@- struct fence_array+ struct dma_fence_array@@@@- enum fence_flag_bits+ enum dma_fence_flag_bits@@@@(- fence_init+ dma_fence_init|- fence_release+ dma_fence_release|- fence_free+ dma_fence_free|- fence_get+ dma_fence_get|- fence_get_rcu+ dma_fence_get_rcu|- fence_put+ dma_fence_put|- fence_signal+ dma_fence_signal|- fence_signal_locked+ dma_fence_signal_locked|- fence_default_wait+ dma_fence_default_wait|- fence_add_callback+ dma_fence_add_callback|- fence_remove_callback+ dma_fence_remove_callback|- fence_enable_sw_signaling+ dma_fence_enable_sw_signaling|- fence_is_signaled_locked+ dma_fence_is_signaled_locked|- fence_is_signaled+ dma_fence_is_signaled|- fence_is_later+ dma_fence_is_later|- fence_later+ dma_fence_later|- fence_wait_timeout+ dma_fence_wait_timeout|- fence_wait_any_timeout+ dma_fence_wait_any_timeout|- fence_wait+ dma_fence_wait|- fence_context_alloc+ dma_fence_context_alloc|- fence_array_create+ dma_fence_array_create|- to_fence_array+ to_dma_fence_array|- fence_is_array+ dma_fence_is_array|- trace_fence_emit+ trace_dma_fence_emit|- FENCE_TRACE+ DMA_FENCE_TRACE|- FENCE_WARN+ DMA_FENCE_WARN|- FENCE_ERR+ DMA_FENCE_ERR) ( ... )Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>Acked-by: Sumit Semwal <sumit.semwal@linaro.org>Acked-by: Christian König <christian.koenig@amd.com>Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
drm: Don't swallow error codes in drm_dev_alloc()There are many reasons other than ENOMEM that drm_dev_init() canfail. Return ERR_PTR rather than NULL to be able to distinguishthese in the caller
drm: Don't swallow error codes in drm_dev_alloc()There are many reasons other than ENOMEM that drm_dev_init() canfail. Return ERR_PTR rather than NULL to be able to distinguishthese in the caller.Signed-off-by: Tom Gundersen <teg@jklm.no>Signed-off-by: Sean Paul <seanpaul@chromium.org>Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no
1234